-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failure should not be reported as a compile error #9640
Comments
FWIW this was implemented by an external contributor for a feature request: #120, PR: #3303. If I'm not mistaken the Problems window was used because there isn't a way to jump to the failed lines through the Output window?! But I may be wrong. Anyway, we should then look into a better solution to solve the problem other than using the Problems window. As you pointed out, this isn't a syntax or compilation error. |
IMHO I think the problems window is fine. The user requirement is that when tests fail, they expect to see the failures and be able to jump to the failed lines easily. Currently this isn't possible from the test explorer.
Not sure this is correct. Today we have spell checkers reporting errors in problems window and they aren't compile errors. I wouldn't be surprised if there were others. |
@isidorn I talked to the team about it and the sentiment was that we always thought having that report in the problems window would be fine (after all, having failed tests in your project could be seen as a problem). Are there any guidelines from VS Code that we could refer to in terms of what should or shouldn't be displayed in the Problems window? I think Don raised a good point that the community may be using the Problems window to surface various types of problems, so having some guidelines could help on this. |
Problems view is for code diagnostics which are generated by a compiler and Tests view is for managing and running tests. Former is compile time and later is during run time. I think this is the standard in general everywhere. As always, we never enforced this but it is expected that extensions follow this so that users will get consistent experience. Agreed that before having tests view, authors were using different approaches (output, problems, code-decorations) to show tests. But after introducing this, we recommended all to create a test view and show test results there. You can define your own actions to run, debug the tests and more which you cannot do from Problems view where you can only do quick fixes (which is to fix your code to compile).
I do not think I agree with this and they are compile time errors. |
The problems view is for syntax or semantic errors and for lint'ing messages. You can obviously bend the definition of a "problem" but when we design and plan features for diagnostics then we do not think about test running, e.g "Run & Debug" will prompt you in the presence of diagnostics - that makes sense for compile errors but not for test errors, esp. not when "run" means "re-run the tests". That means there is a chance of future (semantic) breakage and for non-python users this might be confusing Still, we like the idea of showing test failures in-line with sources (we just don't like the use of diagnostics for this) and this issue should also be an invitation to brain storming how VS Code (as a platform) should offer better test reporting UX and API. The Jest extension, while also using diagnostics 😞, uses line-end decorations which I think is pretty cool. So, lets think further than the test explorer and lets start to collect requirements and ideas for better test integration |
Fixed via #16769 |
Have a test failing.
Notice that python reports this as an Error. This shows up in the Problems panel and with a squigle.
This is not the right thing to do. Test errors should not be reported as compile errors.
I am not sure if there is a better alternative to use
fyi @jrieken @luabud
Also we now support rendering emojis so test failures could be rendered a bit better. @jrieken can provide more details.
The text was updated successfully, but these errors were encountered: