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

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/

Related

How to trigger a Jenkins build from XRay jira?

I am trying to trigger a build in Jenkins directly from Xray. I have been successfully able to create a trigger in jira and has provided the webhook url and other information needed to run the build. But on triggering the build from any Test Plan, I am getting the following error:
Error publishing web request. Response HTTP status:503
ERROR: The requested URL could not be retrieved.
When i'm hitting the same webhook url in any browser, then the build is getting triggered in jenkins, hence it seems there's no issue with the provided webhook url.
One thing to note is that our Xray is in Jira cloud whereas the Jenkins is running behind a VPN. Can anyone help me in resolving the above issue?
If your Xray on Jira Cloud is trying to acess Jenkins, the Jenkins server needs to have a public URL. If you have it behind the firewall then it's not possible for Xray or any other tool to trigger it directly.
You can call the Jenkins URL from your browser because you are probably with your vpn connected.
The possible workaround would be to use a tool such as ngrok, as mentioned in the docs, to make a tunnel, but beware with the security implications of exposing your Jenkins url to the world.
For reference, Xray cloud provides documentation/examples showcasing how to take advantage of Jira Cloud automation capabilities to trigger jobs, for example in Jenkins.

Access GitLab Plug-in's API Token from Jenkins Job

I have instances of Jenkins and GitLab which are successfully connected. Part of setting up the GitLab plug-in involves providing an API token. I believe this is used by the plug-in to get details of the commit which is triggering a job.
I need to run a daily Jenkins job which collects some statistics using the API and then (using R) generates a report. So this is not triggered by an event in GitLab.
To complicate issues a little further, the R code will run inside a container (to avoid hving to install R and all the packages on every Jenkins slave),
It does not appear that the plug-in makes the token available to be used in jobs ... and I can see a sane reason for that.
Is it possible to access the API token from the plug-in?
There is a plugin which supports credential injecting (https://wiki.jenkins.io/display/JENKINS/Credentials+Binding+Plugin) to the builds which could be used later as an environment variable. Gitlab api token could be also selected.

CICD with jenkins and sonarqube

from the last week i am working with jenkins, and its going good but at the end of R&D I have lost of confusion, these are questions which confusingto me.
How to do Continuous Integration with jenkins of Website?
hoe to view Testing analysis reports produced by sonarqube server to my local system?
what happens where all my developers will do commit and push at the same time on repository?
How to deploy my web application on targeted server using jenkins?
How to I use sonarqube to test my website ?
If you are building a .net website, install msbuild plugin in jenkins. Create a jenkins job, add a step checkout your website (git/svn - install required repo plugin). Schedule to run nightly or hourly depending on your needs.
Type in url for your sonarqube server and then you can view the reports.
This is not an issue if your developers are comitting simultaneously. Usually a CI tool such as Jenkins will take care of that.
This is called continuous deployment or continuous delivery. Something like Octopus Deploy can help you if you are deploying .net applications. You can use the tool octo.exe and pass the API key as parameter to deploy to a specific environment.
SonarQube is used as a quality gate for code analysis. It is not a test framework. Try to investigate on how to use selenium framework for automation testing.
I hope that I have answered your questions.

GitLab and Jenkins integration

I've read the differences between Gitlab Community and Enterprise in this page: https://about.gitlab.com/features/
Based on that page I understand the integration with Jenkins is only available in the enterprise version. However, I've seen that using web hooks I can trigger builds in Jenkins when a push happens in Gitlab.
So my question is which is the difference between community and enterprise regarding the integration with jenkins?
On the merge request page, there is a state widget that shows the status of tests for that particular merge request, and on your project home page, there is test status badging. These two UI elements only show up if you enable a 'ci service' on the project. In community you can turn it on with Gitlab CI. In enterprise you can set it up to work with jenkins.
Based on that page I understand the integration with Jenkins is only
available in the enterprise version.
This is no longer true, the Jenkins GitLab Plugin (from a 3rd party) works to hook Jenkins into GitLab as a CI provider.
The wiki page has an example setup with lots of details you'll need to get it working.
This will give per-commit build/test status indicators in GitLab and also hook into the Merge Request system (both in the local repo and when merge requests come from forked repos).
You can also integrate GitLab with Jenkins using the Generic Webhook Trigger Plugin.
An example of integrating with that plugin, to perform static code analysis on merge requests, is available in the Violation Comments to GitLab Plugin wiki page.

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