Skip to main content
No Result Found

Upload Allure Reports to Test Observability

Quick start guide to upload your Allure Reports to BrowserStack Test Observability

Allure Report is a popular tool for generating and reporting test results. However, Allure Reports are quite limited in functionality and offer only a simple HTML report.

Test Observability takes the best of Allure Reports and makes them better - with advanced AI-based failure analysis, rich test analytics, custom dashboards, monitoring, developer workflows and more!

We recommend you upload your Allure Reports only if you do not see your framework in the list of supported frameworks. This provides an easier and deeper integration and more features with Test Observability.

Prerequisites

Upload Allure Reports to Test Observability

Prepare your Allure Reports for upload

Zip the allure-results directory and store it. We recommend you wipe the allure-results directory between build runs to prevent data from previous runs from being included in your reports.

Here is a quick checklist to prepare your report for upload:

  • The file format is zip archive containing the allure-results directory at its root.
  • All files generated by Allure from the same build run are left intact and unmodified.

Upload your Allure Reports

Our CLI tool provides a simple way to upload your Allure Reports to Test Observability without having to use lengthy curl commands. It also automatically detects your CI and Git metadata for deeper integration.

1. Install the CLI

Navigate to your project’s root directory and install the CLI using the following command based on your operating system:

macOS Installation

Choose the appropriate command based on your Mac’s processor:

curl -L "http://api.browserstack.com/sdk/v1/download_cli?os=macos&os_arch=arm64" | bsdtar -xvf- -O > browserstack-cli && chmod 0775 browserstack-cli
curl -L "http://api.browserstack.com/sdk/v1/download_cli?os=macos&os_arch=x64" | bsdtar -xvf- -O > browserstack-cli && chmod 0775 browserstack-cli

Linux Installation

Choose the appropriate command based on your Linux distribution and architecture:

curl -L "http://api.browserstack.com/sdk/v1/download_cli?os=linux&os_arch=x64" | tar -xz -O > browserstack-cli && chmod +x browserstack-cli
curl -L "http://api.browserstack.com/sdk/v1/download_cli?os=linux&os_arch=arm64" | tar -xz -O > browserstack-cli && chmod +x browserstack-cli
curl -L "http://api.browserstack.com/sdk/v1/download_cli?os=alpine&os_arch=arm64" | tar -xz -O > browserstack-cli && chmod +x browserstack-cli

Windows Installation

Run the following PowerShell commands to install the CLI:

Invoke-WebRequest -Uri "http://api.browserstack.com/sdk/v1/download_cli?os=windows&os_arch=x64" -OutFile browserstack-cli.zip
Expand-Archive -Path browserstack-cli.zip -DestinationPath . -Force
Rename-Item -Path "binary-win-x64.exe" -NewName "browserstack-cli.exe"
Remove-Item browserstack-cli.zip  # Cleanup
2. Create the browserstack.yml file
browserstack.yml
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY
projectName: Your Project Name
buildName: Allure Reports Upload
CUSTOM_TAG_1: Regression
CUSTOM_TAG_2: P0
# Use CUSTOM_TAG_<N> and set more build tags as you need.
testObservabilityOptions:
  reportPath: /path/to/your/allure-results
  format: allure

Replace BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY with your BrowserStack credentials, and update the reportPath to point to your Allure results directory or zip file.

3. Upload your test results

Run the following command to upload your test results:

macOS Commands

# Basic usage
./browserstack-cli upload-report

# Advanced usage with explicit parameters
./browserstack-cli upload-report --browserstackConfigFile="path/to/browserstack.yml" --reportPath="path/to/allure-results" --reportFormat="allure"

Linux Commands

# Basic usage
./browserstack-cli upload-report

# Advanced usage with explicit parameters
./browserstack-cli upload-report --browserstackConfigFile="path/to/browserstack.yml" --reportPath="path/to/allure-results" --reportFormat="allure"

Windows Commands

# Basic usage
.\browserstack-cli.exe upload-report

# Advanced usage with explicit parameters
.\browserstack-cli.exe upload-report --browserstackConfigFile="path\to\browserstack.yml" --reportPath="path\to\allure-results" --reportFormat="allure"

Please note that the parsing of the uploaded Allure Reports happens asynchronously. It might take a few seconds for the results to be available on Test Observability after the API request is made.

For more detailed information about the CLI, visit the Report Upload CLI documentation.

Using the API

You can upload your Allure Reports by making a POST request to the Test Observability API endpoint.

Make a POST API request

Make a POST request to https://upload-observability.browserstack.com/upload to upload the Allure Reports. Ensure to:

  1. Provide the path to the Allure results zip file to be uploaded.
  2. Specify format=allure in your request to indicate you’re uploading Allure reports.
  3. Populate the input parameter values according to your requirements.

macOS/Linux

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" -vvv \
    -X POST \
    -F "data=@/Users/TestUser/allure-results.zip" \
    -F "projectName=Allure Report Project" \
    -F "buildName=Allure Upload Build" \
    -F "tags=p0, p1" \
    -F "format=allure" \
    https://upload-observability.browserstack.com/upload

Windows

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" -vvv ^
    -X POST ^
    -F "data=@C:\Users\TestUser\allure-results.zip" ^
    -F "projectName=Allure Report Project" ^
    -F "buildName=Allure Upload Build" ^
    -F "tags=p0, p1" ^
    -F "format=allure" ^
    https://upload-observability.browserstack.com/upload

Additional API Parameters

The sample cURL command provided above has additional parameters that you can use to add more metadata. This can be leveraged in filters and dashboards to get more granular insights. For a full explanation of these parameters, see the Upload Allure Reports API reference.

If you have a framework we support in the list of supported frameworks, the integration process is far simpler (no need for API calls) and this information is automatically captured.

Here’s the full sample cURL command with all the parameters:

Sample cURL Command
Copy icon Copy

Please note that the parsing of the uploaded Allure Reports happens asynchronously. It might take a few seconds for the results to be available on Test Observability after the API request is made.

Visit Test Observability

Voila! Your report will now be available in Test Observability. You can then visit the Test Observability Dashboard to analyze and gain insights from the imported test results.

Visit Test Observability


Troubleshooting & FAQs

Why am I getting `X tests could not be processed as test result files were invalid`?

While uploading your Allure Reports to Test Observability, you may see the following error:

X tests could not be processed as test result files were invalid

Allure Invalid Files that could not be processed

This error is rare and unlikely to be seen by most users. This happens when the data in the test results file (e.g. {uuid}-result.json) could be malformed or manually modified by users.

Please ensure that the test results file are uploaded as-generated by Allure and no additional modifications are made.

If you feel that this is an error still occuring despite no tampering of the original result files, please reach out to our support and we will investigate this.

Please attach the original zip file, and the link to your build to the support ticket to help expedite the investigation.

Why am I getting `Report parsing failed. No valid files were found within the uploaded zip file`?

While uploading your Allure Reports to Test Observability, you may see the following error:

Report parsing failed. No valid files were found within the uploaded zip file.

Allure Invalid Report Parsing zip files

This error occurs when no test results files are generated by Allure for your tests (e.g. {uuid}-result.json). Please ensure that your tests are running and Allure is generating the test results files. Even if your hooks run, but no test results files are generated, this error will occur.

If you feel that this is an error still occuring despite test result files being present, please reach out to our support and we will investigate this.

Please attach the original zip file, and the link to your build to the support ticket to help expedite the investigation.

Why am I getting `Report parsing failed Uploading pre-dated build runs is not supported currently. Upload the builds run later than X`?

While uploading your Allure Reports to Test Observability, you may see the following error:

Report parsing failed
Uploading pre-dated build runs is not supported currently. Upload the builds run later than 22 Jan 2025, 06:02:25

Allure Invalid Report - Pre-dated

This error occurs when the timestamp of the tests in your build precede the timestamp of the latest build of the same name in Test Observability. This is to ensure users don’t accidentally upload older builds and disrupt the test’s history and analytics in Test Observability.

Please ensure you upload only the latest build to Test Observability. A good practice is to wipe the allure-results directory between build runs to prevent old test results from being uploaded.

If you feel that this is an error still occuring despite test result files being present, please reach out to our support.

Please attach the original zip file, and the links to your different builds to the support ticket to help expedite the investigation.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle