Closed selivanovm closed 11 years ago
Hi,
I have tested the plugin on linux and mac machines, but it's supposed to run in a windows environment too, but you're the first :)
please can you provide me the complete output from your IDE, when running a the grails plugin? I will setup a windows machine in parallel and try to get it run...
Hi,
I got it running... The problem is like the same when starting the tests on a mac - the karma executable could not be found...
Have a look at https://github.com/FlorianGrundig/grails-angular-phonecat/blob/master/scripts/test.bat https://github.com/FlorianGrundig/grails-angular-phonecat/blob/master/scripts/e2e-test.bat
To get your tests running on windows, please create two batch files for unit and e2e test (like the links above). In the script files set the PATH variable to include the karma runnable (look for the location where nodejs saves the globally installed artifacts) -> on my windows xp with german language machine it was located under "C:\Dokumente und Einstellungen\florian\Anwendungsdaten\npm" - in an english version it should be in appdata? - please give me your path when you're using a different windows... In the script files set the karma start command with your path to your karma config files...
When finished the configuration of the scripts annotate your tests classes with @KarmaTestSuiteRunner.KarmaProcessBuilderArgs("./scripts/test.bat") // or "./scripts/e2e-test.bat" for your e2e tests
Please let me know if you got it running - I will update the documentation soon... :)
Hi,
I got it running - see at the comments in that issue…
with kind regards Florian
Am 23.09.2013 um 20:20 schrieb Mikhail Selivanov notifications@github.com:
Hi,
Nice plugin. I managed to configure it in Linux but had no luck with Windows. Karma runner works if I run it from command line, but there are no visible result when I run it with grails plugin. Is it supposed to be usable in Windows environment?
Thanks
— Reply to this email directly or view it on GitHub.
Thank you so much. I'll check this out soon and give you feedback :)
Best regards, Mikhail
Hi Mikhail,
can you please publish the cloned grails-angular-phonecat on your github account with all the changes you made? Which windows version you're using?
Mikhail wrote: Hi Florian,
I've cloned your project 'grails-angular-phonecat' and made changes as you wrote but tests still don't work for me. When I run scripts/test.bat at least Chrome is started, but when I run 'grails test-app' I only get errors.
Changes I made:
test.bat
set CHROME_BIN="C:\Users\mike\AppData\Local\Google\Chrome\Application\chrome.exe" set IE_BIN="C:\Program Files\Internet Explorer\iexplore.exe"
KarmaTestSuiteRunner.java
@RunWith(KarmaTestSuiteRunner.class) @KarmaTestSuiteRunner.KarmaConfigPath("./test/javascript/config/karma.conf.js") @KarmaTestSuiteRunner.KarmaProcessBuilderArgs("./scripts/test.bat") public class JavaScriptUnitTestKarmaSuite { }
Here is the log:
| Loading Grails 2.2.4 | Configuring classpath | Configuring classpath. | Environment set to test | Running 1 javascript test... | Error C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\7-Zip;f:\mingw\bin;f:\qt\4.7.3\bin;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\nodejs\;C:\Users\mike\AppData\Roaming\npm\node_modules\karma\bin;C:\Users\mike\AppData\Roaming\npm Warning: Native modules not compiled. XOR performance will be degraded. Program terminated! | Failure: Test mechanism | java.lang.NullPointerException: Cannot invoke method finish() on null object at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41) at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68) at de.is24.grails.tools.KarmaTestType.doRun(KarmaTestType.groovy:54) at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:290) at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:248) at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184) at TestApp$_run_closure1.doCall(TestApp.groovy:82) | Completed 0 javascript test, 1 failed in 1313ms | Packaging Grails application | Running Grails application | Server running. Browse to http://localhost:8080/angular-phonecat | Running 1 javascript test... | Error C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\7-Zip;f:\mingw\bin;f:\qt\4.7.3\bin;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\nodejs\;C:\Users\mike\AppData\Roaming\npm\node_modules\karma\bin;C:\Users\mike\AppData\Roaming\npm Warning: Native modules not compiled. XOR performance will be degraded. WARN [proxy]: proxy "/angular-phonecat" normalized to "/angular-phonecat/" Program terminated! | Failure: Test mechanism | java.lang.NullPointerException: Cannot invoke method finish() on null object at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41) at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68) at de.is24.grails.tools.KarmaTestType.doRun(KarmaTestType.groovy:54) at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:290) at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:248) at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184) at TestApp$_run_closure1.doCall(TestApp.groovy:82) | Completed 0 javascript test, 1 failed in 923ms | Tests FAILED - view reports in C:\devel\grails-angular-phonecat-master\target\test-reports
Cheers, Mikhail
— Reply to this email directly or view it on GitHub.
The log shows that you're using java 6. The plugin works only with java 7 - please try it with java 7 and post the logs.
Hi Florian,
Here is the output with java 7.
| Loading Grails 2.2.4 | Configuring classpath | Running 1 javascript test... | Error C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\7-Zip;f:\mingw\bin;f:\qt\4.7.3\bin;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.7.0_40;C:\Users\mike\AppData\Roaming\npm\node_modules\karma\bin;C:\Users\mike\AppData\Roaming\npm Warning: Native modules not compiled. XOR performance will be degraded. Program terminated! | Failure: Test mechanism | java.lang.NullPointerException: Cannot invoke method finish() on null object at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41) at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68) at de.is24.grails.tools.KarmaTestType.doRun(KarmaTestType.groovy:54) at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:290) at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:248) at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184) at TestApp$_run_closure1.doCall(TestApp.groovy:82) | Completed 0 javascript test, 1 failed in 1193ms | Packaging Grails application..... | Running Grails application | Server running. Browse to http://localhost:8080/angular-phonecat | Running 1 javascript test... | Error C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\7-Zip;f:\mingw\bin;f:\qt\4.7.3\bin;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.7.0_40;C:\Users\mike\AppData\Roaming\npm\node_modules\karma\bin;C:\Users\mike\AppData\Roaming\npm Warning: Native modules not compiled. XOR performance will be degraded. WARN [proxy]: proxy "/angular-phonecat" normalized to "/angular-phonecat/" Program terminated! | Failure: Test mechanism | java.lang.NullPointerException: Cannot invoke method finish() on null object at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71) at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41) at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68) at de.is24.grails.tools.KarmaTestType.doRun(KarmaTestType.groovy:54) at _GrailsTest_groovy$_run_closure4.doCall(_GrailsTest_groovy:290) at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:248) at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184) at TestApp$_run_closure1.doCall(TestApp.groovy:82) | Completed 0 javascript test, 1 failed in 775ms | Tests FAILED - view reports in C:\devel\grails-angular-phonecat-master\target\test-reports
My best regards, Mikhail
I got it working on a windows 7 machine. I had to change the port on which the plugin listens for the test results: you can change the port in your testclass with:
@KarmaTestSuiteRunner.KarmaRemoteServerPort(9877)
=> you have to change the port in the karma(-e2e).conf.js too:
remoteReporter: {
host: 'localhost',
port: '9877'
},
I have committed these changes in the grails-angular-phonecat app in my personal repo: https://github.com/FlorianGrundig/grails-angular-phonecat/commit/caed9e8f9046d49e21a5791c82d31fd97437554d
Please change the port and give me feedback...
Cool, now it works.
Hi,
Nice plugin. I managed to configure it in Linux but had no luck with Windows. Karma runner works if I run it from command line, but there are no visible result when I run it with grails plugin. Is it supposed to be usable in Windows environment?
Thanks