I have inherited a project with about 1000 tests. Until recently, all of them have been executed when I entered the gradle clean test
command.
From one day to another some of the tests stopped being included in the test statistic (the number of passed, failed and ignored tests that Gradle and Idea output at the end of execution of all tests). The code is still there and the tests were not ignored. Nor was any of the build scripts modified. When I run the tests in IntelliJ Idea they are executed (i. e. there are no compiler errors that could have explained why the tests don't run).
I believe that the tests are executed, but they results are not included in the overall statistics for the following reason. I executed the command gradle --debug --rerun-tasks clean test > 2017_11_24_gradle.log
. Then I looked for the occurrences of one of the missing tests, com.mycompany.comm.CommApplicationTests
in the resulting 2017_11_24_gradle.log
file (grep "com.mycompany.comm.CommApplicationTests" 2017_11_24_gradle.log).
This is grep's output:
17:00:54.861 [QUIET] [system.out] 17:00:54.860 [DEBUG] [org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor] Executing test class com.mycompany.comm.CommApplicationTests
17:00:54.867 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests STARTED
17:00:55.169 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests > validateProtocol STARTED
17:00:55.875 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests > validateProtocol STANDARD_OUT
17:00:57.272 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests > validateProtocol PASSED
17:00:57.273 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests > contextLoads STARTED
17:00:57.273 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests > contextLoads PASSED
17:00:57.274 [DEBUG] [TestEventLogger] com.mycompany.comm.CommApplicationTests PASSED
From this I conclude that the tests are executed.
The only suspicious thing which may or may not account for the non-inclusion of some test results is this:
16:37:47.251 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
16:37:47.343 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
16:37:47.343 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
16:37:47.346 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
16:37:47.346 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
16:37:47.347 [ERROR] [system.err] *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
These messages are output to System.err
during the execution of gradle --debug --rerun-tasks clean test
.
How can I fix or work around the erorr (i. e. make sure that all executed tests are reflected in the end statistics (number of passed, failed, and ignored tests) that Gradle prints at the end)?
Aucun commentaire:
Enregistrer un commentaire