Here's a quick (and dirty) groovy script for that https://gist.github.com/3906161
I wrote it in some spare time after lunch, but I think it may help you on writing an Groovy script for that. If you write a better version, I would like to see it in the Scriptler plug-in scripts repository. The HistoryResult class is not really necessary. I started writing with this class and forgot to remove it. And the output (a sample at the bottom of the script) is ugly. Probably you'll want to use some formatter or output to a HTML file. Hope that helps, just my 0.02 cents :-) ps: You'll notice that I wrote it for a junit-and-tap project. This project contains both TAP and JUnit results. This script works only for the junit test results. But it's very easy to add support to TAP too. Bruno P. Kinoshita http://kinoshita.eti.br http://tupilabs.com >________________________________ > From: Christopher Orr <[email protected]> >To: [email protected] >Sent: Wednesday, 17 October 2012 9:45 AM >Subject: Re: Track history of an individual testcase > >Yeah, that certainly sounds useful. > >A quick possibility could be to write a Groovy script (and contribute it >to the "jenkins-scripts" repo) which takes a job name and a test name, >and then loops through all builds, printing out a basic list containing >build number, and test status for each. > >Chris > > >On 16/10/12 15:25, Bruno P. Kinoshita wrote: >> Hi Björn, >> >> I don't know if a plug-in for this already exists or not, but I think it >> doesn't and it sounds like a good idea :) >> >> You could use a Recorder [1], and iterate through the past builds >> (perhaps a depth option here would be a good idea). You can then use the >> following (not tested) to retrieve the tests in a Build*: >> >> List<AbstractTestResultAction> actionsWithTests = >> build.getActions(AbstractTestResultAction.class); >> for(AbstractTestResultAction<?> leAction : actionsWithTests) { >> TestResult testResult = (TestResult)leAction.getResult(); // if >> instanceof... >> // look for certain test status, and report it >> } >> >> Hope that helps, >> >> [1] http://javadoc.jenkins-ci.org/?hudson/tasks/Recorder.html >> * Depending on the plug-in, you may have to use other classes, junit and >> tap plugin adds a AbstractTestResultAction. I believe TestNG has a >> custom build action with test results. >> Bruno P. Kinoshita >> http://kinoshita.eti.br >> http://tupilabs.com >> >> ------------------------------------------------------------------------ >> *From:* Björn Julander <[email protected]> >> *To:* [email protected] >> *Sent:* Tuesday, 16 October 2012 6:38 AM >> *Subject:* Track history of an individual testcase >> >> I'm looking for the feature of getting a history of an individual >> test case, does such already exist? >> >> Motivation: I have a Unit testcase that failed in the last run. >> I have a suspicion that it might be an intermittent failure and >> would like >> to investigate that. Today I can only click manually through each build >> which is time consuming and don't give me an overview. >> >> What I would like to do is to click on the testcase and see it's >> history for each run, >> preferable with a summary of the other test cases. >> >> I assume this doesn't exist (or please point me in the right direction). >> I have not developet a jenkins plugin before, can you give me some >> pointers >> on where one should hook in such a feature. >> I guess there should be some good existing extension point for this, >> but which one? >> >> Any tips in any direction is hightly appreciated! >> >> Thanks // Björn >> >> > > > >
