Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section guides you through adding Perfecto Smart Reporting to Jenkins.

Add a link to your report from within Jenkins

You can add a dynamically generated link to the report for a given Jenkins job by using the Groovy Postbuild Plugin.

The script should include the following code:

Code Block
languagejava
themeMidnight
jobName = manager.build.getProject().getName()
buildNumber = manager.build.getNumber()

summary = manager.createSummary("graph.gif")
summary.appendText("<a href=\"https://<CQL_NAME>.reporting.perfectomobile.com/library?jobName[0]=${jobName}&jobNumber[0]=${buildNumber}\">Perfecto Test Report</a>", false)

See the details of the reporting server.

Panel

On this page:

Table of Contents
maxLevel2
stylesquare

Group tests by job and build in the Report Library

To view tests grouped by continuous integration system job and build in the Report Library, you need to provide the job name and build number into reporting as system variables. This enables you to group your test executions in reporting first by job name and then by build number, providing you a complete overview of the build quality.

Supply Maven or Ivy parameters

If you are running your tests using Maven or Ivy, add the following JVM parameters and (optionally) the Report-tags parameter:

Code Block
languagebash
themeMidnight
-Dreportium-job-name=${JOB_NAME} -Dreportium-job-number=${BUILD_NUMBER} -Dreportium-job-branch=${GIT_BRANCH} -Dreportium-tags=${myTag}

You need to supply the myTag value. Jenkins automatically supplies the JOB_NAME, BUILD_NUMBER, and GIT_BRANCH.

To add CustomField pairs, use the following format:

Code Block
languagejs
themeMidnight
-DReportiumCustomFields=customField1=value1,customField2=value2


This video shows how to add the Jenkins Job Name and Build Number parameters.

Widget Connector
width854
urlhttps://www.youtube.com/watch?v=Z3f0-ReHRnQ
height458

Anchor
slackNotif
slackNotif
Set up Slack notifications

Using the Slack plugin for Jenkins, you can configure Jenkins to send you a notification when the tests complete and include the link to the report for easy access.

To do this:

  1. Go to the Post-build Actions section of the project configuration in Jenkins. 
  2. In the Slack Notifications sub-section, do the following:
    1. Find and select the Include Custom Message checkbox. 
      Note: You may need to click Advanced to access this field.
    2. In the Custom Message field, add the following:

      View your Perfecto report at: https://<CQL_NAME>.reporting.perfectomobile.com/library?jobName[0]=${JOB_NAME}&jobNumber[0]=${BUILD_NUMBER}&tags[0]=${myTag}

      where:
        <CQL_NAME> is the prefix of your Perfecto CQ Lab. For example, if you access the Perfecto Lab at https://demo.perfectomobile.com, then <CQL_NAME>=demo.

This video shows how to add Jenkins notifications for reporting to your Slack channel.

Widget Connector
width854
urlhttps://www.youtube.com/watch?v=uyUicdRsiF4&feature=youtu.be
height458