Skip to content
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

On latest SBT (1.2.6) JUnit reporter can mangle output files #1427

Closed
mauhiz opened this issue Oct 22, 2018 · 4 comments
Closed

On latest SBT (1.2.6) JUnit reporter can mangle output files #1427

mauhiz opened this issue Oct 22, 2018 · 4 comments

Comments

@mauhiz
Copy link

mauhiz commented Oct 22, 2018

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.

@mauhiz mauhiz changed the title On latest SBT (1.2.6) JUnit reporter can mangle output files when testForkedParallel On latest SBT (1.2.6) JUnit reporter can mangle output files Oct 22, 2018
@mauhiz
Copy link
Author

mauhiz commented Oct 23, 2018

I believe the cause is a regression in SBT. sbt/sbt#4400

Let me close this issue for now as there's nothing to be fixed in scalatest

@mauhiz mauhiz closed this as completed Oct 23, 2018
@mauhiz
Copy link
Author

mauhiz commented Oct 23, 2018

For the record, disabling either SBT's built-in JUnitXmlReportPlugin or scalatest's JUnit XML reporter solved the issue.

@itchyny
Copy link

itchyny commented Oct 29, 2018

Thanks to your comment, saved my time. I suggest writing the report using atomic write. Users should notice the redundancy in the reports anyway...

@stewSquared
Copy link

Arguably, an "experimental" plugin shouldn't be enabled by default. This could be considered a mistake from sbt.

Nboaram pushed a commit to hmrc/vat-api that referenced this issue Jan 30, 2020
lutnos added a commit to hmrc/help-to-save-frontend that referenced this issue Aug 4, 2020
lutnos added a commit to hmrc/help-to-save-frontend that referenced this issue Sep 9, 2020
burns238 added a commit to hmrc/interest-restriction-return that referenced this issue Nov 18, 2020
carwynellis added a commit to hmrc/eu-subsidy-compliance-frontend that referenced this issue Feb 21, 2022
This can cause issues with Junit XML output getting mangled causing
unstable builds in Jenkins.

See scalatest/scalatest#1427
dboresjo added a commit to hmrc/income-tax-penalties-frontend that referenced this issue Aug 7, 2024
dboresjo added a commit to hmrc/income-tax-penalties-frontend that referenced this issue Aug 7, 2024
TheDanielDoyle added a commit to hmrc/uknw-auth-checker-api-stub that referenced this issue Sep 6, 2024
TheDanielDoyle added a commit to hmrc/uknw-auth-checker-api-stub that referenced this issue Sep 6, 2024
oarshad added a commit to hmrc/crs-fatca-fi-management that referenced this issue Sep 12, 2024
Disable JUnitXmlReportPlugin in the project configuration to prevent issues related to scalatest/scalatest#1427. This change ensures smoother build and testing processes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants