-
Notifications
You must be signed in to change notification settings - Fork 138
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
VS Code reports test status incorrectly when classname ends with IT #381
Comments
Hi @boyarsky, is the problem still occur by using the newest version of Test Runner? If yes, would you mind to provide a sample project with us to repro the issue? |
It actually got worse. Now when I click "run test" on JeanneIT, it doesn't show anything in the report or the bottom bar. Here's a project with just the two classes in it. JeanneTest behaves as expected. JeanneIT does not. Other than the name, the files are the same. |
Root CauseWe are using Junit 5's junit-platform-console to launch the test execution. The CLI has an option to restrict the class name,
WorkaroundYou can change the default value by setting a workspace setting for {
"java.test.config": {
"args": ["--include-classname", ".*"]
}
} Open the Follow-upIf the user does not set |
When using Maven, it is common to use *IT.java as the test class name to show it is an integration test. (vs an unit test). The failsafe plugin recommends this convention.
I wrote a very simple JUnit 5 integration tests class with one passing test and one failing test. In the Java editor, VS Code correctly shows a green check for the "good" test and a red check for the "bad" test. However, it shows both tests as skipped in the test reports list. It also shows zero tests as run on the bottom of the screen.
![junit5-it](https://user-images.githubusercontent.com/416926/47967065-98ff1380-e027-11e8-9212-b6b3bb54b549.jpg)
VS Code does behave properly if I rename my test from JeanneIT to JeanneTest. The test results and bottom bar both acknowledge the tests were run.
![junit5-test](https://user-images.githubusercontent.com/416926/47967064-956b8c80-e027-11e8-9553-86e621ec6881.jpg)
The text was updated successfully, but these errors were encountered: