Gitea: Pull Request approval status - jenkins

Im managing a jenkins pipeline for automation tests, and I need to start different suite of tests depending on whether the PR is approved or not. Is there a way to get this info from console or any API?

Related

How can I improve my pipeline efficiency?

I need to create a parallel pipeline that has the following steps:
Execute the Integration Tests;
Generate the Integration Tests HTML Report;
Publish the Integration Tests HTML Report on Jenkins;
Generate the Integration Tests HTML Coverage Report;
Publish the Integration Tests HTML Coverage Report on Jenkins;
The same steps for integration tests also should be done to mutation tests;
Deploy the application (jar file) to a pre-configured staging server (Tomcat Server instance);
Perform a automatic smoke test that will consist in performing a curl to check if the base URL of the application is responsive after deployment;
A UI Acceptance Manual Test will be performed in the following way. A user will be notified of the successful execution of all the previous tests and be asked to perform a manual test. In order to cancel the progression or proceed, a UI Acceptance Manual Test must take place. The pipeline should wait for a user manual confirmation on Jenkins;
A tag shall be pushed to my SCM ( Source Control Management) repository with the Jenkins build number and status.
For now I only a initial design of what I want my pipeline to be like.
I took the decision to generate and publish the Javadoc in parallel with the mutation and integration tests since these tests don't need the Javadoc to be done.
I think that I can parallelize my pipeline more, what do you guys think and what's your opinion on my desing?
I think your Pipeline is already well-optimized. IMHO trying to parallize it further will not yeild better performance, rather will add more complexity to the Pipeline.

Stress testing jenkins master using jmeter

I am trying to stress test my jenkins infrastructure using jmeter. I have created a Jmeter TestPlan which uses HTTPRequest component of jmeter to trigger the jenkins builds using jenkins rest api. The idea is to trigger a large number of builds and monitor the System health. when I run the jmeter test plan for single thread it works fine, but when I run it with multiple threads each HTTPrequest to trigger the jenkins build should be run for each thread... but it runs only once i.e. each build is triggered only once on jenkins (no matter what is the thread count). In Jmeter test results, it shows that the HTTPRequest is successful for all the threads.. but on Jenkins the build seems to be triggered only for 1 thread group.
Well-behaved JMeter test must represent real system usage, if you want to simulate user clicking Jenkins "Build Now" button you need to send request like:
http://jenkins_host:port/job/jobname/build?delay=0sec
this delay=0sec parameter is uber important as if you don't have it only first request will trigger the job, with this parameter you will have either as many concurrent jobs as available executors:
If there are not enough executors to serve all the jobs, the jobs will be put into queue
You can use JMeter PerfMon Plugin for monitoring Jenkins node health (CPU, RAM, JVM metrics, etc.)

How to get jenkins pipeline test results into ReportPortal.io instance?

I have an automated Jenkins workflow that runs and tests a java project. I need to get all the data and results that are outputted by Jenkins into Report Portal (RP).
Initially, I was under the impression that you have to install the ReportPortal.io Jenkins plugin to be able to configure Jenkins to communicate with RP.
However, it appears that the plugin will eventually be deprecated.
According to one of the RP devs, there are APIs that can be used, but investigating them on our RP server does not give very clear instructions on what every API does or if it is what is required to get test data from Jenkins to RP.
How then do I get Jenkins to send all generated data to RP?
I am very familiar with Jenkins, but I am extremely new to Report Portal.
ReportPortal is intended for test execution results collection, not for jenkins logs gathering.
In two words, you need to find reporting agent at their github organization which depends on your testing framework (e.g. junit, testng, jbehave) and integrate it into your project.
Here is example for TestNG framework:
https://github.com/reportportal/example-java-TestNG/

Additional feature for Post build task Jenkins

Is there a way to check the error log and, in particular, the number of consecutive failures and then integrate the post build task in the Jenkins job?
I want to integrate the Pagerduty plugin after my job failure under some specific conditions.

Can Jenkins detect when a new build is available on a Bamboo server?

Can Jenkins detect when a new build is available on a Bamboo server?
What I want is to create a Jenkins job that checks a Bamboo server for a new build. I want this job to run once per hour.
Then, other tests that I have on that Jenkins server will rely on that check passing in order for them to kick off.
If this is possible, what is the usual way of doing this? The Bamboo server is internal and does not need authentication to see status of builds or get build resources.
If there is no plugin for this, I do see a RSS feed at this URI: /rss/createAllBuildsRssFeed.action?feedType=rssAll&buildKey=RELEASE . What method would other Jenkins administrators use to read this feed?
I figured out the answer myself. I wrote a Gradle unit test to run in Jenkins that can read the RSS feed in Bamboo.
The real way to do it though, which didn't answer my question, is to add a post-build hook to either Subverison or Bamboo to send a HTTP get request to Jenkins, which notifies a job to run.

Resources