Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Test Result Analyzer doesn't display results

I have been using jenkins' TRA plugin for a while and all of a sudden it stopped showing results for some of the jobs I'm running. The message, which I'm getting:

No build data retrieved. You may need to select a Module.

I've read this answer but I'm already using Publish JUnit test result report under Post-build Actions.

Job's workspace path is correct, all of the test report .xml files are there.

What am I missing?

like image 449
Noa Avatar asked Dec 14 '17 09:12

Noa


People also ask

How do I see Jenkins results?

You get to the Test Result page by clicking a build link on the Status or History page of your Jenkins project, or by clicking Test Result in the menu on the left. Click the image to enlarge it. At the top of the page, Jenkins displays summary information about the executed tests and their total execution time.

How do I enable test result trend in Jenkins?

To get the resulting trend of Jenkins's job execution you just go into your project and click on the hyperlink trend which would be available just after build history. By doing this, you will get the result of the last 20 or 30 days which is again configurable.


1 Answers

No build data retrieved. You may need to select a Module.

What this means depends somewhat on the kind of Jenkins project you're dealing with. It also seems to be the only error message the plugin has, which makes deciphering it more difficult than it should be.

This question appears to be about about a Freestyle job (as opposed to a Maven job), since the Publish JUnit test result post-build action is mentioned.

Freestyle Job

With a freestyle job, this error typically means that the published XML file (or series of published XML files) isn't found. "Selecting a Module" doesn't make any sense in this context.

When you publish JUnit results, the xml files in your workspace are processed into a single file, called junitResult.xml. This is what I mean when I refer to the published XML file. This file is stored outside of the workspace, in the build history:

D:.                                   
└───jobs                              
    └───MavenFreestyle                
        ├───builds                    
        │   ├───1                     
        │   │       build.xml         
        │   │       changelog.xml     
        │   │       junitResult.xml   
        │   │       log               
        │   │                         
        │   └───2                     
        │           build.xml         
        │           changelog.xml     
        │           junitResult.xml   
        │           log               
        │                             
        └───workspace                 
            │   pom.xml               
            │                         
            ├───.mvn                  
            ├───src                   
            └───target      

If these junitResult.xml files are missing, you'll get empty TRA results. Of course, if no test results are found in the workspace, no junitResult.xml files will ever get created. I suppose it's also at least possible that they're being created, but then modified or deleted by some process or person.

At any rate, these are the files whose existence (and contents) you want to verify, more than anything in the workspace.

If these junitResult.xml files appear to be in place for your jobs with empty results, updating the question with the contents of one of them would be helpful.


To verify files are found in the workspace to publish, make sure this check box is unchecked:

Fail on empty test results

This way, if there is a mismatch between your Ant pattern and your actual file locations, the build will fail. If this box is checked, and you fat finger your include pattern, the job will succeed but your TRA results will be empty.

Maven Job

For readers running into this using Maven Jobs:

Here, "select a Module" does make sense. The Test Results Analyzer link works from a Module page, but shows blank results when accessed from a Project page.

I found this "documentation" of said behavior buried in the comments of the plugin wiki page.

Maven Project page

Maven Module page

Multi-configuration job

With a Multi-configuration project, you must access the results via a Configuration page. Accessing them from the Project page always yields empty results.

Multi-configuration project page

Multi-configuration Configuration page

like image 146
Mike Patrick Avatar answered Oct 14 '22 07:10

Mike Patrick