5

after reading answer to the question How to serve Allure Report without automatically starting the browser

I wonder how to use nginx to host allure reports properly? I suppose it would be enough if you may give an example of command for nginx and allure in proper order.

PS: I am trying to create a shared Allure report as a hosted website across company without the necessity for each user of the report to have Allure installed on his local machine, without executing "allure serve" on each new test result. Hosting is planned on AWS EC2, resolving domain and etc is planned to be done separetly with AWS ELBs. Allure documentation does not cover this topic, as there are no other questions wth detailed specific answer on this topic on StackOverflow in regards to allure.

Thanks in advance.

Evgeny Z
  • 75
  • 1
  • 2
  • 6

2 Answers2

14
  1. Configure a web server that everyone in your company can access

    • Sounds like that will be taken care of with your AWS setup. You basically just need a web server that everyone you wish to see the reports can get to.
  2. Execute your tests to output the Allure source files

    • Execute your tests with whatever process and framework you are using and make sure to set the configuration so the necessary source files for Allure are output as part of the test run
  3. Run the Allure test adapter with the source files from step 2 in order to generate the reports

    • Command line version works
  4. Drop the Allure reports from step 3 into the webserver

    • Create a new directory titled "Allure" in the place that your web server is configured to host out of. The html file is already named "index.html"
  5. Navigate to "http://machinename/Allure/"

    • This should pull up your Allure report via the web just as if you had executed "Allure serve" locally

In my case I...

  1. Create a Windows Server 2012 R2 VM on the company network and configure IIS to host out of C:\inetpub\wwwroot

  2. Install the Allure NUnit 2 Adapter to the machine where I run the tests which adds a new "addins" directory with various files to the NUnit install location, edit the config.xml to set the output directory for Allure's source files, and then execute the tests

    C:\NUnit.org\NUnit-2.6.4\bin\addins\config.xml

    <results-path>C:\AllureSourceFiles</results-path>

  3. Run Allure with the source files to generate the report

    allure generate --output C:\AllureOutputReport C:\AllureSourceFiles

  4. Create an "Allure" directory in the web server and copy all of the Allure report output files/directories into that place from "C:\AllureOutputReport" where the tests were ran

    C:\inetpub\wwwroot\Allure\app.js

    C:\inetpub\wwwroot\Allure\favicon.ico

    C:\inetpub\wwwroot\Allure\index.html

    C:\inetpub\wwwroot\Allure\styles.css

    C:\inetpub\wwwroot\Allure\data

    C:\inetpub\wwwroot\Allure\export

    C:\inetpub\wwwroot\Allure\history

    C:\inetpub\wwwroot\Allure\plugins

  5. Navigating to "http://machinename/Allure/" from any browser in the company network shows the allure report

J_L
  • 304
  • 3
  • 13
  • 2
    @Evgeny Z I hate to bother, but can you mark this as the answer for this old question? – J_L Jul 08 '19 at 05:40
1

You can host Allure Docker Service in any machine with docker. It's easy to use, you don't have to do a lot of configurations:https://github.com/fescobar/allure-docker-service

Frank Escobar
  • 648
  • 5
  • 15