Aggregating Downstream test results - Not working though everything is setup fine

3,225 views
Skip to first unread message

Gergely Brautigam

unread,
Sep 17, 2015, 11:02:48 AM9/17/15
to Jenkins Users
Hello guys.

I know this has been chewed upon many times, and I've read blogs after posts after questions and answers and descriptions and every damn thing I was able to find on the internetz, still, I can't get aggregation to work.

I have a project main-aggregator who has 6-10 other jobs configured as a downstream project which generate test results in junit test format. Configuration is handled through Jenkins DSL, but I tried without it as well, so that doesn't matter.

Jobs are configured to be downstream through this guy => Trigger / call builds on other projects. This has a list of jobs to trigger.

After that, the Aggregate Downstream Test result is added as post build task and enabled to Automatically Generate results ( I tried defining them by name as well ).

Next, the downstream projects have fingerprinting setup like this =>

            publishers{
                archiveJunit("project/build/${taskName}-results/TEST*xml")
                fingerprint("project/build/${taskName}-results/TEST*xml")
            }

This all works. I see the fingerprinted xml files, awesomeness.

But on the main calling build Jenkins says this =>

Aggregated Test Result

Fingerprinting not enabled on this build. Test aggregation requires fingerprinting.

Well, of course it's not enabled. How would it be? This job isn't generating anything it should AGGREGATE. Or I'm missing a vital point here... But If I understand correctly aggregation requires tracked results which I'm tracking on the build which is creating the result. But I can't fingerprint anything on a build which is not doing anything else other than triggering these builds. There is no flag to set that says enable fingerprint and that's it, unless I'm missing something.

Could somebody please help me before I loose my mind over this?

Thank you very much!
Gergely.

Eric Pyle

unread,
Sep 17, 2015, 1:38:57 PM9/17/15
to jenkins...@googlegroups.com
I think the way aggregation was intended to work, a job would produce some artifact, fingerprint the artifact, and trigger downstream builds to do something with the artifact. The test results would be aggregated by the upstream job which created the artifact. The fingerprint provides the link between a particular artifact build and the tests run on that artifact. You can give the main-aggregator job this pattern by having it create a simple artifact such as a timestamp and archive and fingerprint it, and have the downstream jobs retrieve the artifact.

Regards,
Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d3466540-cc52-4130-8b9c-7e1c885ef1c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gergely Brautigam

unread,
Sep 18, 2015, 1:05:00 AM9/18/15
to Jenkins Users
And that would be enough to create the connection between the two jobs? Even though there are no tests performed on the timestamp? The connection is enough? I'll try to do that once I get to work. Thank you very much for the suggestion! :-)

Gergely Brautigam

unread,
Sep 18, 2015, 2:54:44 AM9/18/15
to Jenkins Users
Btw. What did you mean by, simple artefact such as a timestamp? What's a timestamp as an artefact? :)

Gergely Brautigam

unread,
Sep 18, 2015, 8:32:19 AM9/18/15
to Jenkins Users
I understand now everything!!

It's working. And it's awesome. Thanks very much. It all became suddenly so clear how this aggregate plug-in works. :) It makes sense now. I shall write a blog post about it.

All I did was add an echo `date` > timestamp.data. Fingerprinted this data, and on the downstream projects said => copy from upstream project. And that made the link between the two clear and the aggregate test result now has a build from which to gather data from.

What I did wrong was that, in the upstream job I waited for the downstreams to finish. And that was wrong!

Cheers!
Gergely

Alok Bhaskar

unread,
Aug 8, 2016, 5:41:08 PM8/8/16
to Jenkins Users
Hi Gergely,

I am also running into the same issue. The part I am confused about is that archiving and fingerprinting the timestamp.data in the parent project can only be a 'post build' action. So when the downstream project is configured to copy from upstream it will not find it since it wont be archived until Parent job 'build' phase is completed. How were you able to archive and fingerprint timestamp.data before the downstream projects were triggered. Please post the ink for your blog post if possible. Thanks

below is the error I get in the downstream project

15:51:14 Unable to access upstream artifacts area /var/lib/jenkins/jobs/parent-job/builds/1686/archive. Does source project archive artifacts?
15:51:14 ERROR: Failed to copy artifacts from parent-job with filter: timestamp.data

Gergely Brautigam

unread,
Aug 10, 2016, 2:50:17 AM8/10/16
to Jenkins Users
Hi Alok!

The clue is this part:

"What I did wrong was that, in the upstream job I waited for the downstreams to finish. And that was wrong!"

This means that your jobs aren't finishing before that. It needs to be a fire and forget, because, as you said, the post build action must run. Now, this might not fit your scenario, in which case you might have to run some intermediary job which aggregates for your other jobs.

Reply all
Reply to author
Forward
0 new messages