I worked on something similar in the past, not as a Jenkins plugin. You will need a strategy to cache all of the test-case information, so that you avoid the need to crawl each of your builds, for each click.

List<AbstractTestResultAction> actionsWithTests = TestResultSummaryCache.getActions(AbstractTestResultAction.class);

After each build, update the summary. Pardon the pseudo-code but I am not familiar with the Jenkins API.
for (AbstractTestResultAction action : getAllTestResultActionsFromBuild(build)) 
{
    TestResultSummaryCache.addAction(build, action);
}


On 10/17/12 8:45 AM, Christopher Orr wrote:
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




Reply via email to