Continues Testing through Jenkins and Jira zephyr squad
Ravikiran HM
Test Automation Architect || QA Manager || PSPO? || Recreational runner || Fitness enthusiast
The goal of this article is to help automation testers to achieve Continues Test (CT) using Jenkins (a popular CI-CD tool) and zephyr squad for Jira (Test management software)
1st things 1st, What is CT?
By definition, CT stands for the software development process in which applications are tested continuously throughout the entire SDLC. The goal of CT is to evaluate software quality across the SDLC, providing critical feedback earlier and enabling higher-quality and faster deliveries.
Table of Contents
Pre-requisites:
Installation of Jenkins on EC2:
The below steps will help you deploy Jenkins on your EC2 instance
Connecting to your EC2 instance:
Connect to the EC2 instance with the below command
$ ssh -i /path/my-key-pair.pem [email protected]
?Enter “yes” as your response
You will receive a response like the below:
Warning: Permanently added '[email protected]' (RSA) to the list of known hosts.
?Now you are inside the EC2 instance !!
Downloading and installing Jenkins
?Run the below command to update the software package on your EC2 instance
[ec2-user ~]$ sudo yum update - y
Add the Jenkins repo using the following command:
[ec2-user ~]$ sudo wget -O /etc/yum.repos.d/jenkins.repo\https://pkg.jenkins.io/redhat-stable/jenkins.repo?
?Import a key file from Jenkins-CI to enable installation from the package:
[ec2-user ~]$ sudo rpm --import https://pkg.jenkins.io/redhatstable/jenkins.io.key
update the software package again!
[ec2-user ~]$ sudo yum update - y
Install Jenkins :
[ec2-user ~]$ sudo yum install jenkins -y
Enable the Jenkins service to start at boot:
[ec2-user ~]$ sudo systemctl enable Jenkins
Start Jenkins as a service:
[ec2-user ~]$ sudo systemctl start Jenkins
?check the status of the Jenkins service using the command:
[ec2-user ~]$ sudo systemctl status jenkins
?Install Java:
[ec2-user ~]$ sudo amazon-linux-extras install java-openjdk11 -y
Install Maven :
[ec2-user ~]$ sudo yum install -y apache-maven
Configure Jenkins:
?Now that Jenkins is installed on your EC2 instance
?Connect to https://<your_server_public_DNS>:8080 from your browser. You will be able to access Jenkins through its management interface
?Enter Password found the mentioned location on the screen Or use the command to see the password below
[ec2-user ~]$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
The Jenkins installation script directs you to the?Customize Jenkins page. Click?Install suggested plugins.
Once the installation is complete, the?Create First Admin User?will open. Enter your information, and then select?Save and Continue.
Installing Maven Plugin :
Click on the?Manage Jenkins?link in the left menu bar,
Under the?System Configuration?section, click on the?Manage Plugins?options:
Under the?Plugin Manager, click on the?Available?tab?and search for the?maven integration?plugin. Maven Integration plugin will show up, install the plugin and restart the Jenkins.
领英推荐
Under the?System Configuration?section, click on the Global Tool Configuration option, and scroll to Add Maven section.
Click on Add Maven button, enter a suitable name (Maven) click on Save.
Creating your 1st Jenkins Job
Click on New Item
Select Maven Project and enter a name for the project
Enter Description as per your requirement
Select the Git option in?Source Code Management
Enter the URL of the git into the Repository URL text box, now we need to pass the app password along with the user name as below
userName: Bitbucket User name
EncryptedAppPassword: Visit this page to Generate the same
https://userName:[email protected]/yourCompany/RepoName.git
else you will see the below error during the run time of the Jenkins job in the output console
> Failed to connect to repository : Command "git ls-remote -h --
> https://bitbucket.org/<project>/<repo>.git HEAD" returned status code
> 128: stdout: stderr: remote: Bitbucket Cloud recently stopped
> supporting account passwords for Git authentication. remote: See our
> community post for more details:
> https://atlassian.community/t5/x/x/ba-p/1948231 remote: App passwords
> are recommended for most use cases and can be created in your Personal
> settings: remote:
> https://bitbucket.org/account/settings/app-passwords/ fatal:
> Authentication failed for
> 'https://bitbucket.org/<project>/<repo>.git/'
Under "Build Triggers" section enter value as below to run this job daily at aroun 10 AM.
Add "Invoke top-level Maven targets" options in Add pre-build step
Select Maven Version and Set Goal as "clean test"
In Post Build Section , enter the path for your suite.xml file
Make sure you have installed Editable email notification plugin( if you want email notification for every build) and ensure you have done SMTP configuration properly.
You can make use of AWS SES (Simple Email Serves) , get your email verified and use it for SMTP configuration. you can refer below link for complete instruction for same
Enter details as per your requirement , take reference of below pic
Now Add "Execute Script" as post build action , add the Zephyr Squad Cloud integration script path as below
Please refere below link for detailed explanation of integration script
The script will take care of uploading the result to jira cloud and mark test case appropriately.
Jenkins publishing results in jira
Once all the above set up is done,build your jenkins job
you can see jira being executed and updated at the end sucessfully.
You will receive email notification as below
Actual JIRA test task being updated
Check your JIRA test case and you will find that its been marked appropriately.
Conclusion :
By now you have understood
I have done lot of google search and put all the things at one place to orchestrate "jenkins to jira integration" on AWS ubuntu ec2 instance for enabling continues testing in my project which is working perfectly fine.
In case if you want to try this and not moving ahead or any suggestions on this flow please feel free to DM me or email me at [email protected]