No tests in build (scala test runner + gradle)
Created a project running scala tests from gradle, but teamcity does not see these tests. The tests are being run, but teamcity does not see them (no tests tab in build results, no tests count in build summary).
At the same time scala tests executed by SBT are seen just fine and JUnit tests ran by gradle.
Anyone having the same problem?
Using teamcity 2017 and gradle 4.
Please sign in to leave a comment.
Hi Oleg,
it will depend on where gradle is leaving the test reports. TeamCity will automatically gather the results from the standard paths but if some non-standard place is used it will not be picked up automatically. You can add the "XML Report Processing" feature and pass the path where the test results are being placed so that TeamCity will pick them up and add them to the build results.
Hi Denis,
I think it normally capture test results from build log, not XML reports. XML reports contain only summary on number of tests ran and no details on failed tests
Hi Oleg,
results from the build log are only picked up if they are passed as service messages (https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-servMsgsServiceMessages).
If you run the gradle "test" task, at least for java/kotlin, it generates a test-reports folder inside the "build" folder, and while there are some general reports with only a summary, there are also detailed reports with stacktraces, those are picked up usually automatically by teamcity and used for the test reports, but I'm unaware of the same holds true for scala. You might need to check that with whatever you are using to run the tests on scala (i assume gradle has a scala plugin)
According to this, it seems that gradle with a scala plugin ignores JUnit tests: https://stackoverflow.com/questions/28592343/how-do-i-run-both-scalatest-and-junit-tests-with-gradle, so you might want to check that as well.
It works for me if I have the XML report processing Build Feature enabled with the following configuration:
%teamcity.build.checkoutDir%/**/build/test-results/**/*.xml