Jenkins - Running install tests on remote machine and reporting results back to Jenkins

automated-tests, jenkins

Solution

I didn't actually need any plugins for this. I simply set up the job to run on the slave, had a build step that ran some tests and generated an xml file (similar to the jUnit xml results) and then added a post build step to look at the jUnit results (even though the tests weren't jUnit tests).

This worked a charm and I have builds being marked as unstable if they fail tests that I specify, like did they install an rpm and did such and such happen.

I was able to get the latest stable builds as the latest stable builds are coppied to a file server anyway, any failed builds don't go there so that was simple.

Problem

I am looking to add some automated tests to run nightly on a project. Currently the project has a few jobs that create multiple builds of various components of the project. The builds create rpm files, there are multiple jobs creating multiple rpms, I want to grab all of the rpms and install them and test them all under a single test job, there are lots of dependencies on each other. I can install via the command line but these rpms are stored on the Jenkins master machine. This is as far as I have got; - I have set up the job in Jenkins - I have created a slave for the job to run on - I have used Jenkins to run a bash script on the slave (works) What I want to do is the following; - At regular intervals (lets say once per day when I know builds have all completed) fetch the most recent passed builds of all the projects and copy them to the slave machine - Install the rpms using a script. - The script performs certain tests during the install (looking at logs etc...) so I want to collect these all and send the results back to Jenkins (may eventually perform other tests here too) - I want the status of the last build image to be determined by my own tests - I also want the test results, logs, etc... to be stored in the Jenkins test job so that we can view them and marvel at their awesomeness! What I don't know how to do is; - How to copy the files to the slave? Should this be handled on the slave itself using wget or something, or does Jenkins have the functionality (plugin maybe) that handles this all for me? - How do I report my custom results back to the Jenkins job? I only started working with Jenkins three days ago (the project and Jenkins build jobs are a lot older than that), apologies if I'm missing anything obvious. UPDATE I'm thinking a combination of these plugins might do the trick, I've not yet looked into these too much yet though. Copy artifact plugin to copy the rpms from the latest stable builds of the other jobs xUnit plugin to interpret some xml files that I generate during the test process

Original source