Open GoogleCodeExporter opened 8 years ago
The first problem: js-test-driver is build differently when run from command
line and when run from the eclipse:
* command line: JsTestdriver configuration runs through
TestResultPrintingModule.configure() method. This method adds
TestResultHolder.class to Multibinder. Multibinder uses onTestComplete method
to broadcast all tests results to TestResultHolder. As a result,
FailureCheckerAction is informed about all passed tests.
* eclipse: JsTestdriver is build in getJstd() method of JstdTestRunner. The
method never adds TestResultHolder to the list of test result listeners.
Therefore, FailureCheckerAction always assumes that no tests have been run.
I do not feel confident in js-test-driver binding enought to fix this.
Original comment by m.jurcov...@gmail.com
on 21 Dec 2011 at 11:32
The second problem is caused by the --raiseOnFailure flag added in
JsTestDriver.createFlagsArray(String...coreflags) method. The method is called
only when the tests are run from the eclipse plugin. Attached patch removes the
flag.
This patch fixes also the problem 1, but I do not know whether it is 'by
design' or whether it accidently hides another bug.
Original comment by m.jurcov...@gmail.com
on 21 Dec 2011 at 11:33
Attachments:
Simulate the third problem:
1.) Create a long running test case (see attachment).
2.) Run it.
3.) Close the browser while the test is running.
4.) Wait long enought.
Eclipse shows an error:
An internal error occurred during: "Run js-test-driver Tests Job".
Failures during test run.
Error log:
!ENTRY org.eclipse.core.jobs 4 2 2011-12-21 12:42:44.677
!MESSAGE An internal error occurred during: "Run js-test-driver Tests Job".
!STACK 0
Failures during test run.
Caused by:
com.google.jstestdriver.browser.BrowserPanicException: Browser Chrome
16.0.912.63 Windows
During
{"browserInfo":{"id":1324467689658,"name":"Chrome","version":"16.0.912.63","os":
"Windows","uploadSize":50,"serverReceivedHeartbeat":true,"ready":true},"cause":"
Browser unresponsive since 2011-12-21T11:42:13.972Z during command\u003d
{\"command\":\"runTests\",\"parameters\":[\"[\\\"SlowTest.testSlowGreet1\\\",\\\
"SlowTest.testSlowGreet2\\\"]\",\"false\",\"1\"]}"}
at com.google.jstestdriver.CommandTask.run(CommandTask.java:136)
at com.google.jstestdriver.JsTestDriverClientImpl.sendCommand(JsTestDriverClientImpl.java:103)
at com.google.jstestdriver.JsTestDriverClientImpl.runTests(JsTestDriverClientImpl.java:141)
at com.google.jstestdriver.RunTestsAction.run(RunTestsAction.java:70)
at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:70)
at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:37)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.google.jstestdriver.browser.BrowserActionExecutorAction.run(BrowserActionExecutorAction.java:149)
at com.google.jstestdriver.ActionRunner.runActions(ActionRunner.java:81)
at com.google.jstestdriver.JsTestDriver.runConfigurationWithFlags(JsTestDriver.java:384)
at com.google.jstestdriver.JsTestDriver.runTests(JsTestDriver.java:304)
at com.google.jstestdriver.JsTestDriver.runTests(JsTestDriver.java:297)
at com.google.eclipse.javascript.jstestdriver.core.JstdTestRunner.runTests(JstdTestRunner.java:43)
at com.google.eclipse.javascript.jstestdriver.ui.launch.EclipseTestRunnerJob.run(EclipseTestRunnerJob.java:88)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by:com.google.jstestdriver.browser.BrowserPanicException: Browser Chrome
16.0.912.63 Windows
During
{"browserInfo":{"id":1324467689658,"name":"Chrome","version":"16.0.912.63","os":
"Windows","uploadSize":50,"serverReceivedHeartbeat":true,"ready":true},"cause":"
Browser unresponsive since 2011-12-21T11:42:13.972Z during command\u003d
{\"command\":\"runTests\",\"parameters\":[\"[\\\"SlowTest.testSlowGreet1\\\",\\\
"SlowTest.testSlowGreet2\\\"]\",\"false\",\"1\"]}"}
com.google.jstestdriver.browser.BrowserPanicException: Browser Chrome
16.0.912.63 Windows
During
{"browserInfo":{"id":1324467689658,"name":"Chrome","version":"16.0.912.63","os":
"Windows","uploadSize":50,"serverReceivedHeartbeat":true,"ready":true},"cause":"
Browser unresponsive since 2011-12-21T11:42:13.972Z during command\u003d
{\"command\":\"runTests\",\"parameters\":[\"[\\\"SlowTest.testSlowGreet1\\\",\\\
"SlowTest.testSlowGreet2\\\"]\",\"false\",\"1\"]}"}
at com.google.jstestdriver.CommandTask.run(CommandTask.java:136)
at com.google.jstestdriver.JsTestDriverClientImpl.sendCommand(JsTestDriverClientImpl.java:103)
at com.google.jstestdriver.JsTestDriverClientImpl.runTests(JsTestDriverClientImpl.java:141)
at com.google.jstestdriver.RunTestsAction.run(RunTestsAction.java:70)
at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:70)
at com.google.jstestdriver.browser.BrowserActionRunner.call(BrowserActionRunner.java:37)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Original comment by m.jurcov...@gmail.com
on 21 Dec 2011 at 11:47
The third problem: the attached patch catches two exceptions I managed to
cause:
* BrowserPanicException (during dry run),
* TestErrors.
It analyses what is found inside TestErrors and composes error message for the
user. Almost all errors are shown as they came from the server. The only
exception is browser panic exception - the patch adds (sort of) user friendly
explanation to it.
Original comment by m.jurcov...@gmail.com
on 21 Dec 2011 at 5:12
Attachments:
Original issue reported on code.google.com by
m.jurcov...@gmail.com
on 21 Dec 2011 at 11:30