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

Store executed tests on reports xml #235

Merged
merged 41 commits into from
Apr 20, 2020

Conversation

imonteroperez
Copy link
Contributor

  • Provides the names of the executed tests under the PCT
[INFO] -------------------------------------------------------
[INFO] Solving test names
[INFO] -------------------------------------------------------
[INFO] Reading /tmp/pct/work/ant/target/surefire-reports
[INFO] Extracted 3 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntWrapperTest.xml
[INFO] Extracted 1 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks._ant.AntTargetAnnotationTest.xml
[INFO] Extracted 3 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks._ant.AntTargetNoteTest.xml
[INFO] Extracted 15 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntTest.xml
[INFO] Extracted 1 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntJCasCCompatibilityTest.xml
[INFO] 
[INFO] Results:
[INFO] 
[INFO] - hudson.tasks.AntJCasCCompatibilityTest.roundTripTest
[INFO] - hudson.tasks.AntTest.customBuildFileTest
[INFO] - hudson.tasks.AntTest.emptyParameterTest
[INFO] - hudson.tasks.AntTest.invokeCustomTargetTest
[INFO] - hudson.tasks.AntTest.invokeDefaultTargetTest
[INFO] - hudson.tasks.AntTest.jenkinsEnvVarsFromBuildScriptTest
[INFO] - hudson.tasks.AntTest.optionsInTargetFieldTest
[INFO] - hudson.tasks.AntTest.propertyReplacedByEmptyBuildParameter
[INFO] - hudson.tasks.AntTest.propertyReplacedByVariable
[INFO] - hudson.tasks.AntTest.testConfigRoundtrip
[INFO] - hudson.tasks.AntTest.testEscapeXmlInParameters
[INFO] - hudson.tasks.AntTest.testGlobalConfigAjax
[INFO] - hudson.tasks.AntTest.testParameterExpansion
[INFO] - hudson.tasks.AntTest.testParameterExpansionByShell
[INFO] - hudson.tasks.AntTest.testSensitiveParameters
[INFO] - hudson.tasks.AntTest.unexistingCustomBuildFileTest
[INFO] - hudson.tasks.AntWrapperTest.configRoundTrip
[INFO] - hudson.tasks.AntWrapperTest.durability
[INFO] - hudson.tasks.AntWrapperTest.smokes
[INFO] - hudson.tasks._ant.AntTargetAnnotationTest.test1
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testAnnotateTarget
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testAnnotateTargetContainingColon
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testDisabled
  • Stores the info inside the xml reports
<compatResult>
   <coreCoordinates>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>plugin</artifactId>
      <version>2.222.1</version>
   </coreCoordinates>
   <status>SUCCESS</status>
   <compatTestExecutedOn>2020-04-06 10:28:57.703 UTC</compatTestExecutedOn>
   <warningMessages />
   <executedTests>
      <string>hudson.tasks.AntTest.optionsInTargetFieldTest</string>
      <string>hudson.tasks.AntTest.invokeDefaultTargetTest</string>
      <string>hudson.tasks.AntWrapperTest.smokes</string>
      <string>hudson.tasks.AntTest.testEscapeXmlInParameters</string>
      <string>hudson.tasks.AntTest.customBuildFileTest</string>
      <string>hudson.tasks.AntTest.jenkinsEnvVarsFromBuildScriptTest</string>
      <string>hudson.tasks.AntTest.testConfigRoundtrip</string>
      <string>hudson.tasks._ant.AntTargetNoteTest.testAnnotateTarget</string>
      <string>hudson.tasks._ant.AntTargetNoteTest.testDisabled</string>
      <string>hudson.tasks._ant.AntTargetNoteTest.testAnnotateTargetContainingColon</string>
      <string>hudson.tasks.AntTest.propertyReplacedByEmptyBuildParameter</string>
      <string>hudson.tasks.AntTest.testParameterExpansion</string>
      <string>hudson.tasks.AntTest.testParameterExpansionByShell</string>
      <string>hudson.tasks.AntWrapperTest.configRoundTrip</string>
      <string>hudson.tasks.AntTest.testGlobalConfigAjax</string>
      <string>hudson.tasks.AntJCasCCompatibilityTest.roundTripTest</string>
      <string>hudson.tasks.AntTest.unexistingCustomBuildFileTest</string>
      <string>hudson.tasks.AntTest.propertyReplacedByVariable</string>
      <string>hudson.tasks.AntTest.testSensitiveParameters</string>
      <string>hudson.tasks._ant.AntTargetAnnotationTest.test1</string>
      <string>hudson.tasks.AntTest.invokeCustomTargetTest</string>
      <string>hudson.tasks.AntWrapperTest.durability</string>
      <string>hudson.tasks.AntTest.emptyParameterTest</string>
   </executedTests>
   <buildLogPath>logs/ant/v1.11_against_org.jenkins-ci.plugins_plugin_2.222.1.log</buildLogPath>
</compatResult>

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it would be a great improvement! At the same time it may bloat reports and files for plugins which have thousands of tests and configuration combinations. It would be great to make this data an opt-in feature.

E.g.:

  • Store/log failed tests by defult
  • Store/log passed tests only if there is a flag set

@imonteroperez
Copy link
Contributor Author

Thanks, it would be a great improvement! At the same time it may bloat reports and files for plugins which have thousands of tests and configuration combinations. It would be great to make this data an opt-in feature.

E.g.:

  • Store/log failed tests by defult
  • Store/log passed tests only if there is a flag set

Love that idea, I will update providing support on classifying tests, thanks!

@imonteroperez
Copy link
Contributor Author

After applying @oleg-nenashev proposal here: 7ee332a, here is an example with some ant unit tests modified with assertEquals(true,false) to force some failures:

[INFO] -------------------------------------------------------
[INFO] Solving test names
[INFO] -------------------------------------------------------
[INFO] Reading /tmp/pct/work/ant/target/surefire-reports
[INFO] Extracted 3 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntWrapperTest.xml
[WARNING] Extracted: 1, Expected: 5 from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks._ant.AntTargetAnnotationTest.xml
[INFO] Extracted 3 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks._ant.AntTargetNoteTest.xml
[WARNING] Extracted: 15, Expected: 19 from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntTest.xml
[INFO] Extracted 1 testnames from /tmp/pct/work/ant/target/surefire-reports/TEST-hudson.tasks.AntJCasCCompatibilityTest.xml
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Executed: 21
[INFO] - hudson.tasks.AntJCasCCompatibilityTest.roundTripTest
[INFO] - hudson.tasks.AntTest.customBuildFileTest
[INFO] - hudson.tasks.AntTest.emptyParameterTest
[INFO] - hudson.tasks.AntTest.invokeCustomTargetTest
[INFO] - hudson.tasks.AntTest.invokeDefaultTargetTest
[INFO] - hudson.tasks.AntTest.jenkinsEnvVarsFromBuildScriptTest
[INFO] - hudson.tasks.AntTest.optionsInTargetFieldTest
[INFO] - hudson.tasks.AntTest.propertyReplacedByEmptyBuildParameter
[INFO] - hudson.tasks.AntTest.propertyReplacedByVariable
[INFO] - hudson.tasks.AntTest.testEscapeXmlInParameters
[INFO] - hudson.tasks.AntTest.testGlobalConfigAjax
[INFO] - hudson.tasks.AntTest.testParameterExpansion
[INFO] - hudson.tasks.AntTest.testParameterExpansionByShell
[INFO] - hudson.tasks.AntTest.testSensitiveParameters
[INFO] - hudson.tasks.AntTest.unexistingCustomBuildFileTest
[INFO] - hudson.tasks.AntWrapperTest.configRoundTrip
[INFO] - hudson.tasks.AntWrapperTest.durability
[INFO] - hudson.tasks.AntWrapperTest.smokes
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testAnnotateTarget
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testAnnotateTargetContainingColon
[INFO] - hudson.tasks._ant.AntTargetNoteTest.testDisabled
[INFO] 
[INFO] Failed: 2
[INFO] - hudson.tasks.AntTest.testConfigRoundtrip
[INFO] - hudson.tasks._ant.AntTargetAnnotationTest.test1

Generated report by default:

<testDetails class="sorted-set">
       <string>hudson.tasks.AntTest.testConfigRoundtrip</string>
       <string>hudson.tasks._ant.AntTargetAnnotationTest.test1</string>
</testDetails>

If user setup -storeAll option on running the PCT report will provide all the tests inside testDetails entry.

@raul-arabaolaza
Copy link
Contributor

Given that the changes requested by @oleg-nenashev have been implemented and the builder is green I am going to merge

@raul-arabaolaza raul-arabaolaza merged commit 4322009 into jenkinsci:master Apr 20, 2020
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 this pull request may close these issues.

4 participants