Setting up Continuous Integration with Jenkins for Docker
Setting up Jenkins and Docker Continuous Integration for your Provar project is always recommended. This will help you schedule test runs, get consistent reporting, and execute test cases on a remote server. The following help page(s) can walk you through that process from start to finish:
You can follow this help page to help you set up Jenkins for Provar using Jenkins Build Pipelines:
Another helpful way of executing builds in Jenkins using declarative and scripted pipelines is there. These are pipelines that are created through a scripting language called Groovy. Here is an example Jenkinsfile that will execute your Provar tests inside the docker container generated by your Dockerfile.
Sample of Jenkins File
pipeline { agent { dockerfile true } stages { stage('Run Provar Tests') { steps { echo "Running ${env.BUILD_ID} on ${env.JENKINS_URL}" sh "xvfb-run ant -f ANT/build.xml -v" } } } post { always { junit allowEmptyResults: true, testResults: 'ANT/Results/*.xml' cleanWs notFailBuild: true /* cleans up the workspace */ } success { echo "Success: Good job!" } failure { echo 'Failure: Something went wrong with the Provar ANT build. Printing environment for debugging' sh 'printenv' echo 'Printing hosts' sh 'cat /etc/hosts' echo 'Searching for provar directories/files in the system...' sh 'find / -name "provar*"' echo 'Finding chrome drivers' sh "find / -name '*chromedriver*'" } } }
This Jenkinsfile assumes that your build.xml file is located in the ANT folder of your test project and is named ‘build.xml.’ You can read more about them here:
https://jenkins.io/doc/book/pipeline/jenkinsfile/
17 Easy Steps to Setup Jenkins Pipeline to Execute Provar Test
Follow these steps to set up a Jenkins pipeline using a Jenkinsfile that executes your Provar tests inside the docker container (assuming you have an accessible Jenkins instance that can communicate with your Version Control System).
Step 1: Ensure you have run the tests locally inside the docker container.
Step 2: Ensure your Jenkinsfile and Dockerfile are in the project’s root directory. If your Jenkinsfile is not in the root folder, set its relative location in step 12.
Step 3: Check your Provar test project into a Version Control System (VCS).
Step 4: Select New Item on your Jenkins home page to create a new project and then select Pipeline.
Step 5: Click Ok to create the project and then select the Pipeline tab to navigate to the Pipeline section.
Step 6: Select the dropdown field and change to Pipeline script from SCM. You can also paste the Jenkinsfile into this block if you select Pipeline script. However, if you go down this road, you must add a step in the Jenkinsfile to pull your project files from your VCS/SCM.
Step 7: Change the SCM dropdown to match where your project is checked.
Step 8: Enter the repository URL (with the .git ending if using Git SCM).
Step 9: You must also add credentials to your Jenkins instance to connect to this repository. Click the Add dropdown and select Jenkins. You can authenticate this repository however you like, i.e., using a token or username/password. You should always give the Credentials you save a recognizable ID and Description.
Step 10: Specify the branch you would like to access, if applicable (default is master for repository with a single branch).
Step 11: (Optional) In the Additional Behaviours section, select Add and select Clean before checkout and Clean after checkout. This will ensure you have a clean environment each time this project is built.
Step 12: Provide the relative path to your Jenkinsfile from the repository’s root directory. This will be ‘Jenkinsfile’ unless you did not place your Jenkinsfile in your project’s root and the repository structure does not reflect your Provar test project structure.
Step 13: Here is the final Pipeline section once completed:
Step 14: Click Save unless you would like to set any other Project properties first.
Step 15: It is always a good idea to run a validation build on this project to ensure everything works properly. Select Build Now after saving.
Step 16: After a brief moment, you should see the project being built and can monitor its status by selecting the arrow by the build number and selecting Console Output.
Step 17: You should see a successful test run, assuming your tests pass beforehand. Select Test Result from the build view page.
This article guide should be able to help you with your Jenkins and Docker Integration for your Provar projects.
- Provar Automation
- Installing Provar Automation
- Updating Provar Automation
- Using Provar Automation
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Custom table mapping
- Functions
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Override auto-retry for Test Step
- Managing test steps
- Namespace org testing
- NitroX
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reintroduction of CLI license Check
- Reload Org Cache
- Reporting
- Running tests
- Searching Provar with find usages
- Secrets management and encryption
- Setup and teardown test cases
- Tags and Service Level Agreements (SLAs)
- Test cycles
- Test plans
- Testing browser options
- Tooltip testing
- Using the Test Palette
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Block locator strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript locator support
- Label locator strategies
- Maintaining page objects
- Mapping non-Salesforce fields
- Page object operations
- ProvarX™
- Refresh and reselect field locators in Test Builder
- Using Java method annotations for custom objects
- Applications testing
- DevOps
- Introduction to test scheduling
- Apache Ant
- Configuration for Sending Emails via the Automation Command Line Interface
- Continuous integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Automation secrets password in Microsoft Azure Pipelines
- Parallel Execution in Microsoft Azure Pipelines Using Multiple build.xml Files
- Parallel Execution in Microsoft Azure Pipelines using Targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- CircleCI
- Copado
- Docker
- Flosum
- Gearset DevOps CI/CD
- GitHub Actions
- Integrating GitHub Actions CI to Run Automation CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Jenkins
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team Foundation Server
- Version control
- Provar Automation trial guide and extensions
- Salesforce Testing
- Provar Manager
- Best Practices
- Troubleshooting
- Release Notes