The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
junit: Archive JUnit-formatted test resultsTo use this feature, first set up your build to run tests, then specify the path to JUnit XML files in the Ant glob syntax, such as **/build/test-reports/*.xml. Be sure not to include any non-report files into this pattern. You can specify multiple patterns of files separated by commas.
testResults : String
allowEmptyResults : boolean (optional)
archiveAttachments : boolean (optional)
TestReporter.publishFile (JUnit 5.12 or later) to Open Test Reporting reports, so they can be opened from the page of each test. They are archived like build artifacts, under test-attachments/, so they are stored by the configured artifact manager (for example in cloud storage) and removed together with the build.
Attached files are looked up relative to the directory of their report; files outside of it or outside of the workspace are ignored. Legacy JUnit XML reports are not affected.
checksName : String (optional)
healthScaleFactor : double (optional)
1.0
0.0 will disable the test result contribution to build health score.0.1 means that 10% of tests failing will score 99% health0.5 means that 10% of tests failing will score 95% health1.0 means that 10% of tests failing will score 90% health2.0 means that 10% of tests failing will score 80% health2.5 means that 10% of tests failing will score 75% health5.0 means that 10% of tests failing will score 50% health10.0 means that 10% of tests failing will score 0% healthkeepLongStdio : boolean (optional)
keepProperties : boolean (optional)
keepTestNames : boolean (optional)
skipMarkingBuildUnstable : boolean (optional)
skipMarkingStageUnstable is also set.
skipMarkingStageUnstable : boolean (optional)
skipMarkingBuildUnstable as well.
skipOldReports : boolean (optional)
skipPublishingChecks : boolean (optional)
stdioRetention : String (optional)
testDataPublishers (optional)
attachmentsshowAttachmentsAtClassLevel : boolean (optional)
showAttachmentsInStdOut : boolean (optional)
$class: 'AutomateTestDataPublisher'$class: 'ClaimTestDataPublisher'displayClaimActionsInTestResultsTable : boolean
junitFlakyTestPublisherjiraTestResultReporterconfigs
jiraSelectableArrayFieldfieldKey : String
values
value : String
jiraSelectableFieldfieldKey : String
value : String
jiraStringArrayFieldfieldKey : String
values
value : String
jiraStringFieldfieldKey : String
value : String
Insert a string value.
You can include Jenkins Environment variables (see link), or the following variables defined by this plugin:
Variable usage: ${VAR_NAME}CRFL - new line
DEFAULT_SUMMARY - configured in the global configuration page
DEFAULT_DESCRIPTION - configured in the global configuration page
TEST_RESULT
TEST_NAME
TEST_FULL_NAME
TEST_STACK_TRACE
TEST_ERROR_DETAILS
TEST_DURATION
TEST_PACKAGE_NAME
TEST_PACKAGE_CLASS_METHOD_NAME
TEST_STDERR
TEST_STDOUT
TEST_OVERVIEW
TEST_AGE
TEST_PASS_COUNT
TEST_SKIPPED_COUNT
TEST_FAIL_SINCE
TEST_IS_REGRESSION - expands to true/false
BUILD_RESULT
jiraUserFieldfieldKey : String
value : String
Insert the username.
For example if you have a user with:
Display Name: John Doe, Username: johndoe, Email: johndoe@email.com,
you need to write johndoe in this field. Any other value (like display name, or email) will not work.
projectKey : String
issueType : String
autoRaiseIssue : boolean
autoResolveIssue : boolean
autoUnlinkIssue : boolean
overrideResolvedIssues : boolean
manualAddIssue : boolean
additionalAttachments : boolean (optional)
$class: 'JunitResultPublisher'urlOverride : String
$class: 'PerfSigTestDataPublisher'dynatraceProfile : String
$class: 'SahaginTestDataPublishser'$class: 'SauceOnDemandReportPublisher'jobVisibility : String (optional)
$class: 'StabilityTestDataPublisher'$class: 'TestCafePublisher'$class: 'TestReporter'$class: 'YoutrackTestDataPublisher'step([$class: 'JUnitResultArchiver']): Publish JUnit test result reportTo use this feature, first set up your build to run tests, then specify the path to JUnit XML files in the Ant glob syntax, such as **/build/test-reports/*.xml. Be sure not to include any non-report files into this pattern. You can specify multiple patterns of files separated by commas.
testResults : String
allowEmptyResults : boolean (optional)
archiveAttachments : boolean (optional)
TestReporter.publishFile (JUnit 5.12 or later) to Open Test Reporting reports, so they can be opened from the page of each test. They are archived like build artifacts, under test-attachments/, so they are stored by the configured artifact manager (for example in cloud storage) and removed together with the build.
Attached files are looked up relative to the directory of their report; files outside of it or outside of the workspace are ignored. Legacy JUnit XML reports are not affected.
checksName : String (optional)
healthScaleFactor : double (optional)
1.0
0.0 will disable the test result contribution to build health score.0.1 means that 10% of tests failing will score 99% health0.5 means that 10% of tests failing will score 95% health1.0 means that 10% of tests failing will score 90% health2.0 means that 10% of tests failing will score 80% health2.5 means that 10% of tests failing will score 75% health5.0 means that 10% of tests failing will score 50% health10.0 means that 10% of tests failing will score 0% healthkeepLongStdio : boolean (optional)
If checked, any standard output or error from a test suite will be retained in the test results after the build completes. (This refers only to additional messages printed to console, not to a failure stack trace.) Such output is always kept if the test failed, but by default lengthy output from passing tests is truncated to save space. Check this option if you need to see every log message from even passing tests, but beware that Jenkins's memory consumption can substantially increase as a result, even if you never look at the test results!
keepProperties : boolean (optional)
keepTestNames : boolean (optional)
skipMarkingBuildUnstable : boolean (optional)
skipOldReports : boolean (optional)
skipPublishingChecks : boolean (optional)
stdioRetention : String (optional)
testDataPublishers (optional)
attachmentsshowAttachmentsAtClassLevel : boolean (optional)
showAttachmentsInStdOut : boolean (optional)
$class: 'AutomateTestDataPublisher'$class: 'ClaimTestDataPublisher'displayClaimActionsInTestResultsTable : boolean
junitFlakyTestPublisherjiraTestResultReporterconfigs
jiraSelectableArrayFieldfieldKey : String
values
value : String
jiraSelectableFieldfieldKey : String
value : String
jiraStringArrayFieldfieldKey : String
values
value : String
jiraStringFieldfieldKey : String
value : String
Insert a string value.
You can include Jenkins Environment variables (see link), or the following variables defined by this plugin:
Variable usage: ${VAR_NAME}CRFL - new line
DEFAULT_SUMMARY - configured in the global configuration page
DEFAULT_DESCRIPTION - configured in the global configuration page
TEST_RESULT
TEST_NAME
TEST_FULL_NAME
TEST_STACK_TRACE
TEST_ERROR_DETAILS
TEST_DURATION
TEST_PACKAGE_NAME
TEST_PACKAGE_CLASS_METHOD_NAME
TEST_STDERR
TEST_STDOUT
TEST_OVERVIEW
TEST_AGE
TEST_PASS_COUNT
TEST_SKIPPED_COUNT
TEST_FAIL_SINCE
TEST_IS_REGRESSION - expands to true/false
BUILD_RESULT
jiraUserFieldfieldKey : String
value : String
Insert the username.
For example if you have a user with:
Display Name: John Doe, Username: johndoe, Email: johndoe@email.com,
you need to write johndoe in this field. Any other value (like display name, or email) will not work.
projectKey : String
issueType : String
autoRaiseIssue : boolean
autoResolveIssue : boolean
autoUnlinkIssue : boolean
overrideResolvedIssues : boolean
manualAddIssue : boolean
additionalAttachments : boolean (optional)
$class: 'JunitResultPublisher'urlOverride : String
$class: 'PerfSigTestDataPublisher'dynatraceProfile : String
$class: 'SahaginTestDataPublishser'$class: 'SauceOnDemandReportPublisher'jobVisibility : String (optional)
$class: 'StabilityTestDataPublisher'$class: 'TestCafePublisher'$class: 'TestReporter'$class: 'YoutrackTestDataPublisher'withOpenTestReporting: Record JUnit test results streamed over Open Test ReportingRecords test results that JUnit Platform streams while the enclosed steps run, using the Open Test Reporting format.
The step listens on a socket on the loopback interface of the agent. Test JVMs started by the enclosed steps connect to it and send events as tests start and finish, so:
When the block ends, whether or not it succeeded, the results are recorded just like the junit step would, and the step returns the same summary.
withOpenTestReporting {
sh 'mvn -B test'
}
Requirements: JUnit Platform 6.1 or later, with org.junit.platform:junit-platform-reporting on the test runtime classpath, and tests running in the same network namespace as the agent process, so that they can reach its loopback interface. Being on the same machine is not enough when they run in a separate container. With the default settings, the JUnit configuration parameters junit.platform.reporting.open.xml.enabled=true and junit.platform.reporting.open.xml.socket=port are added to the JAVA_TOOL_OPTIONS environment variable so that no change to the build is needed. The port is also available in the JUNIT_OTR_SOCKET_PORT environment variable.
Open Test Reporting files (open-test-report.xml) can also be recorded with the junit step, without streaming.
allowEmptyResults : boolean (optional)
archiveAttachments : boolean (optional)
TestReporter.publishFile, so they can be opened from the page of each test. Enabled by default. They are archived like build artifacts, under test-attachments/, so they are stored by the configured artifact manager (for example in cloud storage) and removed together with the build.
Attached files are written by the test JVMs to their JUnit output directory (junit.platform.reporting.output.dir), which is not part of the stream. When the block ends, they are looked up in the workspace by their path relative to that directory, ignoring files older than the block.
checksName : String (optional)
healthScaleFactor : double (optional)
1.0
0.0 will disable the test result contribution to build health score.0.1 means that 10% of tests failing will score 99% health0.5 means that 10% of tests failing will score 95% health1.0 means that 10% of tests failing will score 90% health2.0 means that 10% of tests failing will score 80% health2.5 means that 10% of tests failing will score 75% health5.0 means that 10% of tests failing will score 50% health10.0 means that 10% of tests failing will score 0% healthjavaToolOptions : boolean (optional)
-Djunit.platform.reporting.open.xml.enabled=true -Djunit.platform.reporting.open.xml.socket=port to the JAVA_TOOL_OPTIONS environment variable of the enclosed steps, so that test JVMs stream their results without any change to the build. Every JVM started in the block sees the variable (and prints a Picked up JAVA_TOOL_OPTIONS message), but only JUnit Platform test runs act on it.
Uncheck to configure the test JVMs yourself, using the port from the JUNIT_OTR_SOCKET_PORT environment variable, e.g. mvn test -Djunit.platform.reporting.open.xml.enabled=true -Djunit.platform.reporting.open.xml.socket=$JUNIT_OTR_SOCKET_PORT.
keepLongStdio : boolean (optional)
keepProperties : boolean (optional)
keepTestNames : boolean (optional)
liveUpdateInterval : int (optional)
0 to disable live results; results are still recorded when the block ends.
skipMarkingBuildUnstable : boolean (optional)
skipMarkingStageUnstable is also set.
skipMarkingStageUnstable : boolean (optional)
skipMarkingBuildUnstable as well.
skipOldReports : boolean (optional)
skipPublishingChecks : boolean (optional)
stdioRetention : String (optional)
testDataPublishers (optional)
attachmentsshowAttachmentsAtClassLevel : boolean (optional)
showAttachmentsInStdOut : boolean (optional)
$class: 'AutomateTestDataPublisher'$class: 'ClaimTestDataPublisher'displayClaimActionsInTestResultsTable : boolean
junitFlakyTestPublisherjiraTestResultReporterconfigs
jiraSelectableArrayFieldfieldKey : String
values
value : String
jiraSelectableFieldfieldKey : String
value : String
jiraStringArrayFieldfieldKey : String
values
value : String
jiraStringFieldfieldKey : String
value : String
Insert a string value.
You can include Jenkins Environment variables (see link), or the following variables defined by this plugin:
Variable usage: ${VAR_NAME}CRFL - new line
DEFAULT_SUMMARY - configured in the global configuration page
DEFAULT_DESCRIPTION - configured in the global configuration page
TEST_RESULT
TEST_NAME
TEST_FULL_NAME
TEST_STACK_TRACE
TEST_ERROR_DETAILS
TEST_DURATION
TEST_PACKAGE_NAME
TEST_PACKAGE_CLASS_METHOD_NAME
TEST_STDERR
TEST_STDOUT
TEST_OVERVIEW
TEST_AGE
TEST_PASS_COUNT
TEST_SKIPPED_COUNT
TEST_FAIL_SINCE
TEST_IS_REGRESSION - expands to true/false
BUILD_RESULT
jiraUserFieldfieldKey : String
value : String
Insert the username.
For example if you have a user with:
Display Name: John Doe, Username: johndoe, Email: johndoe@email.com,
you need to write johndoe in this field. Any other value (like display name, or email) will not work.
projectKey : String
issueType : String
autoRaiseIssue : boolean
autoResolveIssue : boolean
autoUnlinkIssue : boolean
overrideResolvedIssues : boolean
manualAddIssue : boolean
additionalAttachments : boolean (optional)
$class: 'JunitResultPublisher'urlOverride : String
$class: 'PerfSigTestDataPublisher'dynatraceProfile : String
$class: 'SahaginTestDataPublishser'$class: 'SauceOnDemandReportPublisher'jobVisibility : String (optional)
$class: 'StabilityTestDataPublisher'$class: 'TestCafePublisher'$class: 'TestReporter'$class: 'YoutrackTestDataPublisher'Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.