vscode-java-test icon indicating copy to clipboard operation
vscode-java-test copied to clipboard

Wrong Testing Result Display

Open Ao-Last opened this issue 1 year ago • 5 comments

What happened?

Run test from the side panel and it display with green icon while the test cannot even build.

image

Ao-Last avatar Feb 01 '24 08:02 Ao-Last

Those 'dark' green check marks are the history test status.

You can run the command Test: Clear All Results to reset them.

What's your build error in the output channel?

jdneo avatar Feb 02 '24 01:02 jdneo

Those 'dark' green check marks are the history test status.

You can run the command Test: Clear All Results to reset them.

What's your build error in the output channel?

Thanks for pointing out the 'dark' icon's meaning. The build error is caused by an undefined symbol. I cannot reproduce it again and I will reopen the issue once I meet it again.

Ao-Last avatar Feb 02 '24 03:02 Ao-Last

@jdneo To reproduce,

  1. make an build error caused by a wrong usage of assert methods. E.g. assertTrue(String) image
  2. run the test from the sidebar by clicking the triangle button and wait for prompt error message image
  3. click "Continue", and the icon would be green check again. image

Build error: image

Tested with "Test: Clear All Results", the icon does not change (in a untested statu not a error status).

Ao-Last avatar Feb 02 '24 16:02 Ao-Last

Ok, so the green check in step 3 is a history status.

A better solution might be that display the compilation error in the peek view and mark the test as failed.

jdneo avatar Feb 04 '24 04:02 jdneo

Yep, it shows the history status when meeting a compilation error. I suggest to mark it as a test error instead of test failed to distinguish between wrong test code and wrong source code.

Ao-Last avatar Feb 04 '24 05:02 Ao-Last