Can anyone help me with the steps to get reports in custom tab from all jobs running in parallel in one stage, AS i have noticed i am getting report only for 1 stage and other stage reports are lost. I have created custom tab for report

35 views
Skip to first unread message

Sunaina Awadhiya

unread,
Jul 30, 2020, 1:20:26 PM7/30/20
to go-cd
Can anyone help me with the steps to get reports in custom tab from all jobs running in parallel in one stage, AS i have noticed i am getting report only for 1 stage and other stage reports are lost. I have created custom tab for report

Jason Smyth

unread,
Jul 31, 2020, 3:19:43 PM7/31/20
to go-cd
Hello Sunaia,

Could you provide an example that shows what you have done and maybe a mock-up explaining what you would like to accomplish?

My understanding is that Custom Tabs are created at the Job level, not at the Stage level, so I am having a hard time envisioning a workflow that might produce what you seem to be asking for.

Regards,
Jason

Sasa Mitrovic

unread,
Aug 2, 2020, 3:47:48 PM8/2/20
to go-cd
Hi,

You need to create test artifacts for every single one you need. Path where to save it must be different file or folder. Important part is that this folder names becomes Artifact path after job finish and upload  content to GOCD Server and you will see results in Artifacts Tab from UI. Now create Custom tabs and set source to point into this Artifacts. Your full nice report will be rendered inside custom tab. If you want to include only one report to show all of them, this report format need to include nice HTML page report created from all source jobs as one page with sub pages where all of them are in separate folder per each job you have. Use pure html or JS to create this summary page. This of this as HTML page with other source pages in different folders.

I hope this will give you way and direction of thinking to better use Test Artifacts and Artifacts location on server after upload and combination with Custom Tabs. In this way Reporting becomes must powerful way how to do it from any other known CI/CD software. 

P.S Not forget that all these paths are relative from Agent working directory so test it and learn it.

B. Regards

Sunaina Awadhiya

unread,
Aug 5, 2020, 6:13:08 AM8/5/20
to go...@googlegroups.com
Thanks Sim,

Really helpful information. I did create different folder path for html report for 2 separate jobs which are executing in parallel and i have got html reports successfully for both jobs but most of the times only 1 job return html report. So just curious to know what could be the reason behind and can you please help me how to merge all jobs report and put in one single html.

More detail steps with example would be more helpful.

Thanks and Regards,
Sunaina

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/3291b8ad-06ba-4810-8684-19a565972ccco%40googlegroups.com.


--
Sunaina Awadhiya
Bangalore

Jason Smyth

unread,
Aug 5, 2020, 9:37:15 AM8/5/20
to go-cd
Hi Sunaina,

If you want to merge the HTML reports from multiple GoCD Jobs into a single HTML document, you will need a process that runs after all of the relevant Jobs has completed.

The simplest way to accomplish this in GoCD is to add a new Stage that can consume the artifacts generated in the previous Stage:
  1. Stage 1: Do stuff in multiple Jobs. Generate multiple HTML reports.
  2. Stage 2: Merge HTML reports from Stage 1.
Another way to accomplish this is to add a Job to the existing Stage where the first Task is to wait for all other Jobs in the Stage to complete:
  1. Job 1:
    1. Task 1: Do stuff
    2. Task 2: Create HTML report
  2. Job 2:
    1. Task 1: Do stuff
    2. Task 2: Create HTML report
  3. Job 3:
    1. Task 1: Wait for all other Jobs to complete
    2. Task 2: Merge HTML reports from all other Jobs
There are some downsides to this approach. Job 3 will often have a much longer runtime than is required to do its work. If you're not using Elastic Agents this means that Job 3 needlessly ties up one of your Agents while waiting for the other Jobs to complete. Depending on the specifics of your GoCD infrastructure configuration, it is even possible for Jobs to be scheduled in such a way that the Pipeline Stage gets blocked. Imagine this as a Template in a setup with just 2 static Agents and 2 Pipelines based on this Template. It is possible, in this scenario, that Pipeline 1 Job 3 gets started on Agent 1 and Pipeline 2 Job 3 gets started on Agent 2 before Job 1/2 from either Pipeline, resulting in both Pipelines being blocked as Job 3 runs forever waiting for the other Jobs to finish and the other Jobs stuck waiting for an Agent on which they can run.

A third way to do it is to add a Task to end of each Job that does the merge work if it is the last Job running for the Stage:
  1. Job 1:
    1. Task 1: Do stuff
    2. Task 2: Generate HTML report
    3. Task 3: Am I the only unfinished Job? If yes, merge all reports.
  2. Job 2:
    1. Task 1: Do stuff
    2. Task 2: Generate HTML report
    3. Task 3: Am I the only unfinished Job? If yes, merge all reports.
  3. ...
  4. Job N:
    1. Task 1: Do stuff
    2. Task 2: Generate HTML report
    3. Task 3: Am I the only unfinished Job? If yes, merge all reports.
This solution is subject to race conditions, though, because GoCD Jobs do not complete until all Artifacts have been uploaded and Artifacts are not uploaded until after all Tasks complete. This means that it is possible for the last Job to run its "am I the last?" check while the second-to-last Job is still uploading Artifacts. If this happens then the last Job will not recognize that it is the last one and will not run the HTML merge task.

Hope this helps.

Regards,
Jason
To unsubscribe from this group and stop receiving emails from it, send an email to go...@googlegroups.com.


--
Sunaina Awadhiya
Bangalore
Reply all
Reply to author
Forward
0 new messages