7

I've successfully created a small demo HTML report of test results from a build. Simply put, I'm doing numerical computations, and would like to give more detailed information on test results than a binary pass/fail. The HTML report consists of multiple HTML files with relative links between them.

However, linking to one file from the other sometimes leads to the file being opened in the browser, and sometimes a "download file" dialog opens. Any ideas what the rules are, so I can look at the whole report in-browser without resorting to downloading a zip file of the whole report, unzipping, etc etc?

Kara
  • 6,115
  • 16
  • 50
  • 57
pletnes
  • 439
  • 4
  • 15

3 Answers3

5

Just a quick note here, if anyone should need it - as this was where I ended up in my search.

After upgrading our Bamboo to 6.8.1 build 60805 our code coverage artifacts started downloading, instead of being displayed inline.

This can be fixed by setting the Security and permission setting Allow artifacts to be embedded in Bamboo pages.

Be aware of the note about Cross-Site-Scripting vulnerabilities if enabled.

ankhansen
  • 853
  • 9
  • 20
4

On our project we use this simple solution

1.In Stage configure final task script to copy reports to some folder:

echo "Copy artifact report"
rm -rf ../artifacts
mkdir ../artifacts
cp -r functionalTests/build/html/behat/* ../artifacts/

2.On Artifacts tab edit artifact definition and set Copy pattern to artifacts/**

Then when you navigate to build artifact then folder with reports will be opened in browser

jhenya-d
  • 399
  • 7
  • 19
  • This solution works to the extent that you can show the HTML, able to download it; However it will only shows the html artifact as "text/plain", means that the browser will only show the HTML source code, instead of rendered HTML objects. – Daniel Baktiar Jan 24 '18 at 09:06
  • we move to artifacts whole generated report with screenshots, etc, and it rendered correct – jhenya-d Apr 28 '18 at 10:11
  • 4
    Found out that this only works when the Bamboo Admin enables certain security settings to allow viewing based on file extension. In your case it's been setup properly. The default Bamboo settings will not view .html file as text/html. – Daniel Baktiar May 10 '18 at 05:50
  • Once we refer the artifact, we have to manually click the HTML report in the folder structure then view the html report. is there any way I can directly have a link to the html present inside the artifact and then on clicking the html artifact the report is directly displayed? – Bharathan Kumaran Oct 15 '19 at 10:18
1

To have an embedded html page in bamboo showing the coverage results, this page has partially helped me to make bamboo cooperate with python coverage:

Troubleshooting The Clover tab shows the directory listing instead of the HTML report

Please check which artifact handler you use. The Amazon S3 Artifact Handler serves files on a one-by-one basis, instead of exposing all files as a static website. To change this, open Configure plan and on the Miscellaneous tab select the Use custom artifact handler settings check-box. Then select Server-Local Artifact Handler for shared and non-shared artifacts and finally re-run the build.

In my setup though "Server-Local Artifact Handler" failed completely, but choosing "Bamboo remote handler" did the job.

Oliver Bestwalter
  • 5,219
  • 33
  • 47