I have a build.gradle running on CircleCI with the following characteristics:
It contains the dependency: testCompile ‘junit:junit:4.12’
It contains normal JUnit test cases.
Tests run with commands like gradle build or gradle test
When tests run, JUnit writes their results as XML files in the build/test-results directory. These are files with names like TEST-*.xml
However, CircleCI seems to be unable to parse these files. All it shows is a message like ‘The following errors were encountered parsing test results:’, and, then, a list of all the XML files.
Does anyone know whether it is necessary to generate these test results in a particular format? If so, what would it be?
I added the Gradle Wrapper to my project, and the problem disappeared. I think it’s impossible to know which version of Gradle CircleCI is using unless you specify it with the Gradle Wrapper, and, apparently, this makes a difference. In addition, if you decide to add the Gradle Wrapper to your project, you must be careful and make sure that you commit both the “gradlew” executable file and the “gradle” directory to your code repository.