Closed mattchanner closed 9 years ago
Hmm - the log seems to be fine.
To downgrade karma-remote-reporter to 0.1.5 was correct - the grails plugin is still incompatible with 0.2.0 (I will release a new version for grails this weekend).
Is the log output you posted - from karma-remote-reporter 0.1.5 ?
The log indicates that something on the grails-plugin (karma-test-runner) side closes the connection... maybe debugging the junit-karma-testrunner-1.4.jar::ResultReceiverServer::run/start gives you a clue about what's going on - I'm wondering why there's no error in the log (if you look at the code in case of an error we print an error message at least to the console...) ...
What grails version are you using - I'll try to reproduce the error...
Thanks for the quick response, I am using grails 2.4.4.
I have re-tried with 0.1.5 and the log is different to the one I posted (I tried a number of variations last night so may have lost track a bit).
The log output from 0.1.5 is as follows:
........Karma will be started with process builder args: [karma.cmd, start, C:\git\main\gnosis-app\test\unit\javascript\karma.conf.js] |Running 1 javascript test... Karma result receiver server startet at port: 8888 INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS INFO [reporter.remote]: Connected to localhost:8888 INFO [PhantomJS 1.9.8 (Windows 7)]: Connected on socket YcleSkQ_TFkFTclJrStz with id 374373 INFO [reporter.remote]: browser + connectionPhantomJS 1.9.8 (Windows 7) INFO [reporter.remote]: onBrowserStart: 374373 INFO [reporter.remote]: Connection closed ERROR [reporter.remote]: Not connected to server. INFO [reporter.remote]: Error while communicate to remote server ("localhost:8888") to report test results. Error: This socket has been ended by the other party INFO [reporter.remote]: Karma finished... Program terminated! |Completed 0 javascript test, 1 failed in 0m 5s
Thanks!
Hi again,
I updated my demo project git@github.com:FlorianGrundig/grails-angular-phonecat.git to grails 2.4.4 and run "grails test-app" with java 6 and 7 without any errors.
Can you please clone my demo project, run "npm install --save-dev", run "grails test-app unit:javascript" - is that working for you?
Update: I released a new version 0.2.3 which uses junit-karma-testrunner 0.1.6 and karma-remote-reporter 0.2.0. I updated my demo project git@github.com:FlorianGrundig/grails-angular-phonecat.git to use these new versions (please keep in mind that you have to manage/update your karma-remote-reporter manually).
Do you made any progress?
Hi, Thanks for the replies.
I tried the upgraded plugin in our project and it seemed to produce a different problem failing to parse JSON (which at least indicates something is now receiving the messages in the grails world!).
I cloned your phonecat project but that caused errors with karma not being a valid Win32 executable (the one that the tests point to inside of node_modules) - so I need to investigate that before I can get any further).
The log of running test-app is:
Karma result receiver server startet at port: 8888 INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS Error | Unexpected character (G) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (U) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (C) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (S) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (S) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (H) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected character (S) at position 0. Error | at org.shaded.json.simple.parser.Yylex.yylex(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.nextToken(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) Error | Unexpected token END OF FILE at position 0. Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at org.shaded.json.simple.parser.JSONParser.parse(Unknown Source) Error | at de.is24.util.karmatestrunner.TestReporter.handleMessage(TestReporter.java:40) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:54) Error | at java.lang.Thread.run(Thread.java:744) INFO [PhantomJS 1.9.8 (Windows 7)]: Connected on socket YAfE7-n1HCoZjWu4fPo3 with id 998058 WARN [web-server]: 404: /aaa.svg WARN [web-server]: 404: /bbb.svg WARN [web-server]: 404: /ccc.svg WARN [web-server]: 404: /aaa.svg WARN [web-server]: 404: /bbb.svg WARN [web-server]: 404: /ccc.svg WARN [web-server]: 404: /zzz.svg WARN [web-server]: 404: /zzz.svg WARN [web-server]: 404: /aaa.svg Error | java.net.SocketException: Connection reset Error | at java.net.SocketInputStream.read(SocketInputStream.java:189) Error | at java.net.SocketInputStream.read(SocketInputStream.java:121) Error | at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) Error | at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) Error | at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) Error | at java.io.InputStreamReader.read(InputStreamReader.java:184) Error | at java.io.BufferedReader.fill(BufferedReader.java:161) Error | at java.io.BufferedReader.readLine(BufferedReader.java:324) Error | at java.io.BufferedReader.readLine(BufferedReader.java:389) Error | at de.is24.util.karmatestrunner.ResultReceiverServer$ResultReceiver.run(ResultReceiverServer.java:51) Error | at java.lang.Thread.run(Thread.java:744) Program terminated! |Completed 0 javascript test, 1 failed in 0m 6s ........ Configuring Spring Security Core ... ... finished configuring Spring Security Core Configuring Spring Security REST ... ... finished configuring Spring Security REST ........ |Running 4 integration tests...|Running 4 integration tests... 1 of 4|Running 4 integration tests... 2 of 4|Running 4 integration tests... 3 of 4|Running 4 integration tests... 4 of 4|Running 4 integration tests... 5 of 5|Running 4 integration tests... 6 of 6|Running 4 integration tests... 7 of 7|Running 4 integration tests... 8 of 8|Running 4 integration tests... 9 of 9|Running 4 integration tests... 10 of 10|Running 4 integration tests... 11 of 11|Running 4 integration tests... 12 of 12|Running 4 integration tests... 13 of 13|Running 4 integration tests... 14 of 14|Running 4 integration tests... 15 of 15|Running 4 integration tests... 16 of 16|Running 4 integration tests... 17 of 17|Completed 17 integration tests, 0 failed in 0m 1s .........Tests FAILED
Hi,
if I tried the upgraded plugin in our project and it seemed to produce a different problem failing to parse > JSON (which at least indicates something is now receiving the messages in the grails
Are you sure that you're using the 0.2.0 version of the karma-remote-reporter plugin? Your log output indicates that you're still using the previous 0.1.x version of karma-remote-reporter....
If you clone my test project and run it under windows - just remove @KarmaTestSuiteRunner.KarmaProcessName("./node_modules/karma/bin/karma") annotation at the test classes as they're valid only for linux environments...
Did it help you to get the demo project running?
Ah yes, commenting out the annotation worked on your project, thanks!
I will double check the karma-remote-reporter version and let you know
You are correct, I had not upgraded the version of the karma-remote-reporter plugin. After doing that it works great!
Thanks again for your help
I am trying to get the karma-test-runner plugin to work but whenever I run the tests, it reports that the connection has been closed.
The log reports the following:
''' |Running 1 javascript test... Karma result receiver server startet at port: 8888 INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS INFO [reporter.remote]: Connected to localhost:8888 INFO [PhantomJS 1.9.8 (Windows 7)]: Connected on socket Em1lBUzTMKsGT3mgVETX with id 3845261 INFO [reporter.remote]: browser + connectionPhantomJS 1.9.8 (Windows 7) INFO [reporter.remote]: onBrowserStart: 3845261 INFO [reporter.remote]: Connection closed ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. ERROR [reporter.remote]: Not connected to server. INFO [reporter.remote]: Error while communicate to remote server ("localhost:8888") to report test results. Error: This socket has been ended by the other party INFO [reporter.remote]: Karma finished... Program terminated! '''
My grails test class is defined like this (I have been playing with different ports to see if that could be the issue, but it does not seem to be):
import de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner import org.junit.runner.RunWith
@RunWith(KarmaTestSuiteRunner.class) @KarmaTestSuiteRunner.KarmaRemoteServerPort(8888) @KarmaTestSuiteRunner.KarmaConfigPath("test/unit/javascript/karma.conf.js") class JavaScriptUnitTestKarmaSuite { }
My karma config file is:
/global module: false/ module.exports = function (config) { "use strict"; config.set({
};
The config basically work, and can run the correct tests on the command line with
karma start karma.conf.js
Any ideas why the connection is being closed? I downgraded the karma-remote-reporter to 0.15 in case the more recent changes to use sockets directly could be the problem but it seems to report similar errors in both cases.