Intland's free requirements, development and test management hosting.
This server hosts 100.000+ users on the cloud!
Tags: 

Jenkins-Codebeamer integration demo project

This project contains the code and instructions about how to set up and repeat the demo for the Jenkins->Codebeamer integration.

Prerequities:

  • The demo works with CodeBeamer 7.1.2 or above only
  • Was tested and run on latest Jenkins version 1.558
  • use Java version 7

Steps to set up the demo:

CodeBeamer configuration

  • Start a CodeBeamer instance and create following Test Cases:

namedescription
Multiplication TestMultiply 3*1, the result should be 3
Subtraction TestSubstract 3-1, the result should be 2
Addition TestAdd 3+1, the result should be 4
  • Modify Test Case workflow and add a new "Automated" step as here:
  • Check out the demo project and modify the ArithmeticTest.java to contain the appropriate ids of the just created Test Cases in Codebeamer. Commit and push that back to repository.

Jenkins configuration

  • Create a new Jenkins project and check out cbci project into that
  • Set up Maven build with "test" target in this Jenkins project
  • Configure "codeBeamer Trigger" in Jenkins so the schedule should be "* * * * *" to run it every minute. As groovy script use the "trigger-script.groovy" file available in this demo repository: http://javaforge.com/scm/dir/486166/master/src/scripts/open
  • Configure Junit test result report to use "target/surefire-reports/*.xml" project
  • Enable "codeBeamer Publisher" script and use "postbuild-script.groovy" in there. Can be found in this scripts.
  • Edit these scripts and modify the CodeBeamer login url and user name to be able to connect the CB repository
  • Also update and use the correct id for the Test Run tracker in both scripts at this line:
    testRunTrackerId = 1036
    

Running the demo

The demo is performed as:
  • Make all 3 TestCases "Accepted" status, and turn the "Multiplication" and "Addition" tests automatic
  • Start a new Test-set-run with all these 3 testcases inside
  • The Jenkins trigger should run and detect that there are new "Automated" tests appeared in Codebeamer
  • The Jenkins should do the build and the post-build script should write back the result of the Junit test runs to Codebeamer as here:

As presentation we should show inside Jenkins that the junit tests has run and one of them was failed. And then show that the integration has sent back the 2 "Automated" tests' result to Codebeamer. These are appeared the Test Run tacker. The "Failed" test's description contains the detailed junit test failure: