#Allure Test Report Represents a concise test reporting framework
The following guide helps to enable and include Allure within a Travis pipeline context.
The extension is developed in the following way:
- Wait for tests to be executed
- Collect the tests artifacts on a specific S3 bucket
On the report generation side, a new Travis stage is added "Generate tests report" and is developed in the following way:
- Download all the tests artifacts from the specified S3 bucket
- Run the Allure command to generate an aggregated report for all the previous tests executed
- Upload the generated report inside an S3 bucket
##Allure installation:
-
Set travis aws environment variables or override the existing ones inside your
travis.yaml
file in order to point to the desired bucket:ARTIFACTS_BUCKET = <aws bucket name> ARTIFACTS_KEY = <aws key ID> ARTIFACTS_SECRET = <aws key SECRET> ARTIFACTS_REGION = <aws region>
-
Open travis.yml file and add below commands line in your
before_install
instructions:sudo add-apt-repository ppa:qameta/allure -y sudo apt-get updated sudo apt-get install allure
-
On your test stage activate the addon from Travis in order to upload test artifacts in your bucket:
addons: artifacts: paths: - {PROJECT-LOCATION}/target/surefire-reports - {PROJECT-LOCATION}/target/reports target_paths: $TRAVIS_BUILD_NUMBER/content-filters-tests
-
Add the script
upload_test_artifacts.sh
in your scripts folder:# uploads all the artifacts generated by maven surefire to amazon s3 storage based on travis build number aws s3 sync s3://test-report-allure/$TRAVIS_BUILD_NUMBER reports/$TRAVIS_BUILD_NUMBER # change directory and list all artifacts in reports folder cd reports/$TRAVIS_BUILD_NUMBER export ARTIFACTS_LIST=$(ls) # print out list of artifacts echo $ARTIFACTS_LIST # allure generates report after clear list of artifacts and set output directory in S3 based on travis build number allure generate -c $ARTIFACTS_LIST -o allure/$TRAVIS_BUILD_NUMBER # upload and aggregate one single allure report to amazon s3 storage, in the final-report folder, # which will contain all test suites results aws s3 sync allure/$TRAVIS_BUILD_NUMBER s3://test-report-allure/final-report/$TRAVIS_BUILD_NUMBER
-
Add a new build stage called report:
name: "Generate tests report" stage: report install: skip script: - bash scripts/travis/upload_test_artifacts.sh
##Allure report visualization:
- Navigate to https://s3.console.aws.amazon.com/
- Login with your aws credentials account
- Search your bucket where tests artifacts are stored
- Open folder with aggregated test report, e.g.
final-report
- Make sure that above folder is public in order to be able to view the report
- Open folder which corresponding to travis build number
- Access
index.html
url