Skip to end of metadata
Go to start of metadata

Jenkins is a continuous integration tool that helps with the deployment of software projects. Through this, you can run automated tests while building a project, and monitor the results. 

The TM4J Jenkins plugin enables a task that reports on automated test results. 

TM4J's plugin supports Jenkins: 2.73.3 and above.


Workflow: TM4J and Jenkins 


Installing the TM4J Plugin for Jenkins 

  1. Go to settings.
  2. Click Manage Plugins.



  3. Click the Available tab.
  4. Scroll to and select the Test Management for Jira plugin.



  5. Click Install.

Setting Up the TM4J Plugin for Jenkins

Once you've installed the Test Management for Jira plugin for Jenkins, follow these steps to set it up.

  1. Go to the Jenkins home page. 
  2. Click Manage Jenkins.
  3. Click Configure System



  4. Scroll to the Test Management for Jira section, and enter your TM4J Cloud API Key
    Check out Generating Access Keys if you need a refresher.



  5. Click Test Configuration to ensure that the connection is valid. 



  6. Once valid, click Save.

Publishing Jenkins Test Results to TM4J  

The post-build task explained here helps you configure the publishing of Jenkins automated-test results to Jira once a project build completes. 

  1. Click on your project in Jenkins.
  2. Click Configure on the sidebar. 
  3. Scroll to the Post-Build Action section.
  4. Click Add Post-Build Action, then click Test Management for Jira: Publish Test Results in the drop-down menu. 



    A new section appears and includes configuration fields.

  5. Complete the configuration fields:

    • Jira Instance - The URL of your Jira instance. 
    • Project Key - The Jira project key where the results will be sent.
    • Test Framework - Select Cucumber or JUnit. 
    • File Path - The file path for the results file that is generated from the automated tests.
    • Automatically Create Non-Existing Test Cases (optional) - This creates a relationship with the test case key used to annotate a test within a development project. 



  6. Click Save.

Running BDD Test Cases in Jira 

This build task pulls existing BDD test cases from TM4J. When you execute these tests within Jenkins, the results are then sent back to TM4J. 

To enable this task to run before a build takes place, complete the following steps:

  1. Click on your project in Jenkins.
  2. Click Configure on the sidebar. 
  3. Scroll down to the Build section, and click Add Build Step.
  4. Click Test Management for Jira: Export Feature Files in the drop-down menu. 



    A new section appears and includes configuration fields.

  5. Complete the configuration fields:

    • Jira Instance - The URL of your Jira instance.
    • Project Key - The Jira project key where the results will be sent.
    • Target Path - The file path for the results file that is generated from the automated tests.



  6. Click Save.
  • No labels