BQ Platform provides a feature of running tests from the CI/CD tools. Jenkins is one such tool.
Instructions to Setup Jenkins using Docker
Docker is a nifty tool to run and try pre-configured software images. We will use Docker to guide you through the process. Process to setup Jenkins on non-docker environment remains the same after installation.
Download and install Docker.
Pull Jenkins from the public repo by running the following command
docker pull Jenkins/JenkinsStart Jenkins using the following command
docker run -p 8080:8080 –name=my_jenkins Jenkins/JenkinsOnce it is started, open http://localhost:8080 in browser.
You will see the following screen. It will prompt for password.You can find the password from terminal (at the time of server start)
Install all suggested plugins or select the required plugins
It will take a some time to finish the installation.Create an admin user for accessing the Jenkins account & click on Save and Continue button.
Once the process is complete, it will open the Jenkins dashboard.
Click on Manage Jenkins and then Manage Plugins
Check for HTTP Request under the Installed tab.
If it is not installed, click on Available Tab and search for HTTP Request and click on install button.
This plugin enables you to make HTTP calls from Jenkins tasks. After installing the plugin, restart the Jenkins serverThen go to Jenkins Dashboard and click on Create a job.
Then enter some name in item name field and then click on Freestyle projectFor Scheduling the job, you need to check the Build periodically in Build Triggers group
By setting the schedule period to
15 13 * * *
you tell Jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day.
Jenkins used a cron expression, and the different fields are:MINUTES Minutes in one hour (0-59)
HOURS Hours in one day (0-23)
DAYMONTH Day in a month (1-31)
MONTH Month in a year (1-12)
DAYWEEK Day of the week (0-7) where 0 and 7 are sunday
Please ensure a Plan is created and saved in BQ. See Integrating with CICD pipeline for details.
Click on Build tab and enter Bqurious ci/cd url i.e. https://app.bqurious.com/api2/ci/executeFromCi
Select POST in HTTP mode
Click on Advanced.. button. Then, change the Accept and Content-Type to APPLICTION_JSON
Copy the run token of saved plan form bqurious and use it in Request body as {“runToken”: “COPIED TOKEN“} and save the job.
Go to dashboard and click the created job from list. Here it is Regression Test With Bq
Click on Build Now from left side menu.
This will initiate the execution of selected Plan on BQ.
Related articles
Integrating with CICD pipeline
Running Tests from CICD pipeline
Add Comment