wwag110465 / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Missing failure and error messages with Chrome 14+ #263

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Failing tests running in Chrome do no longer report the details of the failure 
or the error that occurred.

What is the expected output? What do you see instead?

This is the output from the test case I've attached. The last test simply 
catches an error, printing its name and message to the console (to verify that 
they're set):

  Chrome 14.0.835.35 Mac OS: Run 3 tests (Passed: 1; Fails: 1; Errors 1) (0.00 ms)
    MsgTest.test should fail with message failed (0.00 ms): AssertError: 
      AssertError: 

    MsgTest.test should throw error error (0.00 ms): : 
      : 

    MsgTest.test should log error message passed (0.00 ms)
      [LOG] Caught error: TypeError An error occurred

This is the correct output when running with Firefox:

  Firefox 5.0.1 Mac OS: Run 3 tests (Passed: 1; Fails: 1; Errors 1) (2.00 ms)
    MsgTest.test should fail with message failed (1.00 ms): AssertError: expected 1 but was -1
      AssertError: expected 1 but was -1
      ()@http://localhost:9876/test/test/test.js:3

    MsgTest.test should throw error error (1.00 ms): TypeError: An error occurred
      TypeError: An error occurred
      ()@http://localhost:9876/test/test/test.js:7

    MsgTest.test should log error message passed (0.00 ms)
      [LOG] Caught error: TypeError An error occurred

What version of the product are you using? On what operating system?
JsTestDriver-1.3.1.jar
Mac OS X 10.6.8

Verified both on:
- Chrome 14.0.835.35 (beta channel)
- Chrome 15.0.853.0 (canary channel)

I'm pretty sure the problem appeared after the upgrade to Chrome 14 on August 
11:
http://googlechromereleases.blogspot.com/2011/08/chrome-beta-channel-update.html

Please provide any additional information below.

I've attached a sample setup that demonstrates the problem.

Original issue reported on code.google.com by meyer...@gmail.com on 16 Aug 2011 at 7:24

Attachments:

GoogleCodeExporter commented 8 years ago
Same bug with Firefox/6.0 (Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101)

Original comment by andrew.p...@gmail.com on 18 Aug 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Subsequent versions of Firefox also suffer from the same problem, e.g.:

  Firefox 9.0 Mac OS: Run 3 tests (Passed: 1; Fails: 1; Errors 1) (1,00 ms)
    MsgTest.test should log error message passed (0,00 ms)
      [LOG] Caught error: TypeError An error occurred
    MsgTest.test should fail with message failed (1,00 ms): AssertError: 
      AssertError: 

    MsgTest.test should throw error error (0,00 ms): : 
      : 

Original comment by szafra...@gmail.com on 22 Aug 2011 at 2:29

GoogleCodeExporter commented 8 years ago
I have debugged the issue and found that there is a problem in 
TestRunnerPlugin.js (which is the source for runner.js in the browser)around 
line 154. The error object has a field message which contains the correct text, 
but this field is not accessible through for(k in e) and hence the JSON 
serialization skips it. I have attached a screenshot from the debugging session.
Please, treat this issue with high priority, because it is breaking the 
developer workflow. E.g. one has to debug to see where the error comes from 
instead of just looking at the message.

Original comment by pavel.ge...@gmail.com on 15 Sep 2011 at 9:13

Attachments:

GoogleCodeExporter commented 8 years ago
I could not resist and debugged it a bit more. I guess that for some reason on 
Chrome 14 and Firefox 6 some properties become non-enumerable and hence don't 
show up in the for(k in e) output. If I do:

Object.defineProperty(e, "message", {enumerable: true})

while debugging at the same line, then the for(k in e) correctly displays the 
message property too.
Hope it helps

Original comment by pavel.ge...@gmail.com on 15 Sep 2011 at 9:46

GoogleCodeExporter commented 8 years ago
Could be related to this issue:
http://code.google.com/p/chromium/issues/detail?id=85755

Original comment by pavel.ge...@gmail.com on 15 Sep 2011 at 9:50

GoogleCodeExporter commented 8 years ago
At rev 1037, explicit enumeration. Need a robust Json serializer that handles 
non-enumerated types and cyclical object graphs.

Original comment by corbinrs...@gmail.com on 21 Sep 2011 at 7:55

GoogleCodeExporter commented 8 years ago
Is this fix included in the Eclipse plugin 1.1.1e?
I don't see any failure messages in Eclipse with plugin 1.1.1e.

Original comment by jonas.ba...@gmail.com on 30 Nov 2011 at 12:49