Jenkins reporter then fails with:
Failed to read test report file /home/www/data/jenkins/jenkins_home/workspace/REDACTED/target/test-reports/TEST-com.foo.BarSpec.xml
org.dom4j.DocumentException: Error on line 12 of document : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.
Examination of this file shows that some contents is written twice, as if two reporters tried to write to the same file without locking.
We've been using forked parallel testing for a while but only after upgrading to SBT 1.2.6 did the problem surface.
EDIT: The bug still shows after disabling forked parallel testing
EDIT2: The bug still shows after disabling forking.
I believe the cause is a regression in SBT. https://github.com/sbt/sbt/pull/4400
Let me close this issue for now as there's nothing to be fixed in scalatest
For the record, disabling either SBT's built-in JUnitXmlReportPlugin or scalatest's JUnit XML reporter solved the issue.
Thanks to your comment, saved my time. I suggest writing the report using atomic write. Users should notice the redundancy in the reports anyway...
Arguably, an "experimental" plugin shouldn't be enabled by default. This could be considered a mistake from sbt.
Most helpful comment
For the record, disabling either SBT's built-in
JUnitXmlReportPluginor scalatest's JUnit XML reporter solved the issue.