Giving jenkins access to third party logs - jenkins

I have a jenkins job that executes a batch file that runs some tests on a Jenkins slave.
The tests are designed to store their output in an html file on the Jenkins slave.
If I look at the output in Jenkins, it is quite limited since the test data is in the .html file on the slave. How can I then get Jenkins to read this data so that you don't need to log into the slave to review the test logs?

Related

How to display local test report in Jenkins?

My Test suite will generate a XML report and save it in my local machine. Is it possible to read XML report from my local machine and display it in as Jenkins logs.
Your flow seems backwards.
You should run your tests locally BEFORE Jenkins gets involved. Once it looks good locally, use some trigger like a git branch push to have Jenkins also run those tests and create the XML results file on the Jenkins server.
Within the job's configuration you can use a Jenkins plugin for the specific test framework you are using and it will automatically make your test results available within the job's output.
Search for the specific plugin and installation instructions here https://wiki.jenkins.io/display/JENKINS/Plugins

Push files to Jenkins workspace from remote location

I'm currently using Jenkins to trigger tests via an external test system and aggregate results. This system follows a typical master slave relationship and stores results, logs, and other files generated from these tests on the slave machine.
Is there a way to push these files from the test slave to the Jenkins workspace while the job is running? This way they can be available to the developer with the test results on job completion.
This would be a pull rather than a push. You would have Jenkins job pull the files in any method you prefer (scp, rsync, wget etc).
Jenkins workspace locations are typically randomised folders based on the job name with a hash/incrementor number in the path, so a Push would be inadvisable.

Save data from View Results in Table to file and then add it to jenkins workspace

I'm using Jenkins job to run jmeter test plan. In my jmeter test plan I have "Results in Table" listener there is an option to save listener output to file and I'm using that option.
But I can't specify correct path to see that output in Jenkins job's workspace.
How should I configure Jenkins job, or what path should I specify in jmeter listener to see my saved file in Jenkins job's workspace?
I don't think Jenkins has any suitable plugin to display View Results in Table listener data.
There is Performance Plugin which can be used for JMeter test results visualization, check out Continuous Integration 101: How to Run JMeter With Jenkins article for details.

Deploy war generated on another job

I'm coding some integrations tests, and to run then I would like to first have jenkins running unit tests and quality scan in my code. On this first job the war would be generated.
After generating the war and sending statistics to SonarQube server I want to deploy the artifact generated on the first job to the test environment. I don't want to do this in the first job, because it is possible that the deploy process fails because of the test environment and if that happens the sonar statistics wouldn't be stored.
So I want to deploy the artifact generated in the first job to my tomcat on the test environment and trigger a third job to run the integration tests using the deployed war.
How can I configure jenkins to deploy an artifact generated during a previous job execution?
*I tried shared workspace, but couldn't figure out how to do it, and after a while I discovered it is a bad practice (because of files locked)
Well, I managed to do it using the Copy Artifact Plugin, it allows a job to copy the artifact generated by other job

Jenkins - How to get test results?

I'm trying to create the following scenario:
One instance running Jenkins server. It polls repo and if change occurs it spins up a production instance of my app - let's code name this instance APP_INSTANCE. NOTE: this APP_INSTANCE is NOT a Jenkins slave in any way. It is literally the production server of a web application. No Jenkins stuff installed.
Jenkins passes some configs to APP_INSTANCE like BRANCH_NAME.
APP_INSTANCE checks out BRANCH_NAME and runs test suites.
Jenkins polls APP_INSTANCE via ssh to see when test report file is done being generated.
If Jenkins finds test report file, it assumes tests are done and it copies test report file.
This last part is the part I'm stuck on, how to make Jenkins:
1. copy a file from APP_INSTANCE
2. parse it for test results so it can display them in its web interface. (I assume the test report format has to be jUnit or some sht, right?)
So am I dumb for trying to build this?
P.S. I'm using AWS and this is all happening in the cloud.
Try this plugin.
https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs
And read this:
Setup Jenkins to monitor external job

Resources