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?
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.
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.
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:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With