This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Integrating with CI pipeline
adarsh-ramakrishna-sfdc edited this page Oct 16, 2015
·
1 revision
CI engines like Jenkins(https://jenkins-ci.org/) can be used to seamlessly integrate ApexUnit with CI pipelines.
Prerequisites :
- Checkin your ApexUnit(maven) project to a Source Control Management(SCM) system
- If you are using Jenkins, you would need the following plugins
- Plugin specific for your SCM
- Mask passwords plugin : https://wiki.jenkins-ci.org/display/JENKINS/Mask+Passwords+Plugin. This helps in masking passwords and client id/secret if you parameterize your build for the cli options
- Performance plugin - https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin. This plugin allows you to capture reports from JUnit. ApexUnit generates test report in standard JUnit format
- HTML Publisher plugin : https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin. This plugin helps in publishing the consolidated HTML report generated by the tool
- Plugin specific for your SCM
- Generic instructions on building a project using Jenkins : https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
Steps for creating a jenkins job for ApexUnit:
- Create a "Free style project" using jenkins
- (Optional)Select the "This build is parameterized" checkbox and parameterize the build by adding relevant (String/password) parameters for all of the cli options
- Select the SCM where you checked in your code and update the location of source code to your code on SCM
- Add the build step "Invoke Top level maven targets" with the command mentioned above in the "How to build" section. Use the parameters if you parameterized the build, otherwise provide the entire command with hard-coded values
- In the post-build Actions step:
- Add "Publish HTML reports" step and populate 'HTML directory to archive' field with 'Report' and 'Index page[s]' field with 'ApexUnitReport.html' and choose your 'Report title'
- Add "Publish JUnit test result report" step and populate 'ApexUnitReport.xml' for the 'Test Report XMLs' field
- If you would like to get email notifications on the build status for the job, add 'E-mail Notification' step and populate the 'Recipients' field with your and possible your teams email id(s)