Skip to content

Attribute 'errors' must appear on element 'testsuite' #1777

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

Closed
alexKazarin opened this issue Sep 16, 2019 · 1 comment · Fixed by #1778
Closed

Attribute 'errors' must appear on element 'testsuite' #1777

alexKazarin opened this issue Sep 16, 2019 · 1 comment · Fixed by #1778

Comments

@alexKazarin
Copy link

Describe the bug
I'm trying to configure Publish xUnit test result report in Jenkins and faced with problems of format differences.

To Reproduce
Steps to reproduce the behavior:

  1. Use in pom
    --plugin
    junit:${project.build.directory}/cucumber-results.xml
    (cucumber-core v.4.7.2 is used, so cucumber.runtime.formatter.JUnitFormatter is used in it)
  2. Configure in Jenkins 'Post-build Action' step "Publish xUnit test result report" (xUnit plugin version 2.3.1) using generated xml: ./target/cucumber-results.xml
  3. Run the build
  4. In console log multiple warings occure

WARNING: The file '.../target/cucumber-results.xml' is an invalid file. WARNING: At line 2 of file: .../target/cucumber-results.xml:cvc-pattern-valid: Value '110.107047' is not facet-valid with respect to pattern '(([0-9]{0,3},)*[0-9]{3}|[0-9]{0,3})*(\.[0-9]{0,3})?' for type 'SUREFIRE_TIME'. WARNING: At line 2 of file:.../target/cucumber-results.xml:cvc-attribute.3: The value '110.107047' of attribute 'time' on element 'testsuite' is not valid with respect to its type, 'SUREFIRE_TIME'. WARNING: At line 2 of file:.../target/cucumber-results.xml:cvc-complex-type.4: Attribute 'errors' must appear on element 'testsuite'. WARNING: The result file '.../target/cucumber-results.xml' for the metric 'JUnit' is not valid. The result file has been skipped. INFO: Skipping tests recording.

Expected behavior
No parce problems occure

Context & Motivation

Was trying to do an integration with Slack notification from Jenkins. Plugin could send to Slack from Jenkins list with names of failed tests. But to work correct, xml report needed. So step "Publish xUnit test result report" is needed.

Your Environment

  • Jenkins xUnit plugin version 2.3.1
  • cucumber-core version 4.7.2

Additional context
Workaround could be done by using Custom tool with providing valid XSL template.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Sep 17, 2019

Thanks for pointing this out. Looks like we should use the XSD used by Maven Surefire.

mpkorstanje added a commit that referenced this issue Sep 17, 2019
Cucumber JUnits xml format doesn't pass XSD validation in the
Jenkins XUnit plugin because it is missing the errors attribute.
Additionally time should be presented using numbers with both decimal
and thousands separators.

See:
 https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd

Closes #1777
mpkorstanje added a commit that referenced this issue Sep 22, 2019
Cucumber JUnits xml format doesn't pass XSD validation in the
Jenkins XUnit plugin because it is missing the errors attribute.
Additionally time should be presented using numbers with both decimal
and thousands separators.

See:
 https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd

Closes #1777
mpkorstanje added a commit that referenced this issue Sep 22, 2019
Cucumber JUnits xml format doesn't pass XSD validation in the
Jenkins XUnit plugin because it is missing the errors attribute.
Additionally time should be presented using numbers with both decimal
and thousands separators.

From: https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
Via: https://maven.apache.org/surefire/maven-surefire-plugin/

Closes #1777
mpkorstanje added a commit that referenced this issue Sep 22, 2019
Cucumber JUnits xml format doesn't pass XSD validation in the
Jenkins XUnit plugin because it is missing the errors attribute.
Additionally time should be presented using numbers with both decimal
and thousands separators.

From: https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
Via: https://maven.apache.org/surefire/maven-surefire-plugin/

Closes #1777
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

Successfully merging a pull request may close this issue.

2 participants