codebeamer xUnit Uploader Plugin
This plugin publishes xUnit Results into codebeamer test cases and test runs.
It collects the unit test xml result files generated during build and processes them as follows:
Takes the root node and processes each <testcase> subnodes as follows:
- builds ( if does not exist ) a test case folder structure based on the value of "classname" property
- creates ( if if does not exist ) a testcase based on its "name" property
- creates a testrun record and sets the testresult to Failure state if the testcases have any child element from the following set:
- <failure> , <error>, <skipped>, <rerunFailure>
- otherwise the test run result will be set to Passed.
A sample output xml can be defined as follows:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite>
<testcase name="testcase0-success" classname="com.intland.testcases" time="2.382">
</testcase>
<testcase name="testcase1-fail" classname="com.intland.testcases" time="2.382">
<failure/>
</testcase>
<testcase name="testcase2-error" classname="com.intland.testcases" time="2.382">
<error/>
</testcase>
<testcase name="testcase3-skipped" classname="com.intland.testcases" time="2.382">
<skipped/>
</testcase>
<testcase name="testcase4-rerun-fail" classname="com.intland.testcases" time="2.382">
<rerunFailure/>
</testcase>
<testcase name="testcase5-other" classname="com.intland.testcases" time="2.382">
<other/>
</testcase>
</testsuite>
Install Plugin
Go to "Manage jenkins" page and click on "Plugin manager".
You have two options to install:
- First case:
- Go to the Available tab.
- Select XUnit Uploader plugin.
- Click on "Install without restart" button.
- Second case:
- Download the plugin source code from GitHub and build it.
- Go to Advanced tab.
- Go to Upload Plugin section and upload the hpi file.
Add Plugin
- Go to the settings page of your jenkins job.
- Go to "Post-build Actions" tab and click on "Add post-build action" button.
- Select codebeamer XUunit Uploader plugin.
Plugin Settings
Now you can see the following screen:
Options:
- Disable XUnit Uploader
If this is set to true then the plugin does not upload test results to codebeamer.
- codebeamer URL
You can set the URL of codebeamer instance. It is mandatory.
- Credentials
You can set a codebeamer user, user should have "Rest / Remote API - Access" permission. It is mandatory.
- Test Configuration ID
You can set a test configuration to the generated test cases. It is mandatory.
- Test Case Tracker ID
You can set a test case tracker. The generated test cases are created on this tracker. It is mandatory if test case id is not set.
- Test Case ID
You can set a parent test case item. The generated test cases are created under this item. It is optional.
Warning: This option override test case tracker option!
- Test Run Tracker ID
You can set a test run tracker. The generated test case runs are created on this tracker. It is mandatory.
- Release ID
You can set a release. This is set in all generated test case run items. It is optional
- Test Results Directory
You can set the test result directory. This contains the test result xml files. You can use relative path and the root folder is the workspace folder of your jenkins job in this case. It is mandatory.
- Default Package Prefix
You can set a package prefix. It is optional.
For example: abc.test.ng
In this case the test results are filtered by this prefix.
Troubleshooting
SunCertPathBuilderException
Symptoms:
Root cause:
- The CA https certificate used in Codebeamer is not in the Java certificate authority keystore.
Resolution:
- Import the CA certificate in the Java keystore and restart Jenkins.