Skip to main content

Upload Allure Reports API

This API helps users import Allure test reports into Test Observability. You can include this API in the CI workflow as a step, for a seamless integration with Test Observability.

Why use an API when you can use our CLI?: Instead of using this API to upload your Allure Reports we recommend you use our CLI tool. This provides a quicker integration and allows us to provide more features.

Note: 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.

Preparing Allure Reports

  • Prepare your Allure Reports for upload by zipping the allure-results directory.
  • Ensure allure-results is at the root of the zip file, and none of the files are tampered with prior to zipping.
  • To prevent errors, ensure that the allure-results directory is cleaned between different build runs.

API details

POST https://upload-observability.browserstack.com/upload

Request parameters

Request (Basic)

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

Request (Advanced)

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" \
    -F "tags=p0, p1" \
    -F "format=allure" \
    -F "buildIdentifier=Your Build Identifier" \
    -F "frameworkVersion=mocha, 10.0.0" \
    -F "ci=http://localhost:8080/" \
    -F 'versionControl={"name": "git","sha":"6a1f6ff49a7f10afc8332b0ac659faf0d0bf8460","short_sha":"95e576b780","tag":"null","branch":"something","committer":"GitHub <noreply@github.com>","author":"Author <92428053+Author@users.noreply.github.com>","commit_message":"downgrade zip.js","root":"/Users/TestUser/Documents/Observability/test-observability-samples","common_git_dir":"/Users/TestUser/Documents/Observability/test-observability-samples/.git","worktree_git_dir":"/Users/TestUser/Documents/Observability/test-observability-samples/.git","last_tag":"null","remotes":[{"name":"origin","url":"git@github.com:browserstack/test-observability-samples.git"},{"name":"origin","url":"git@github.com:browserstack/test-samples.git", "remote_name": "remote_destination"}]}' \
    -F 'hostInfo={"hostName": "host-001"}' \
    https://upload-observability.browserstack.com/upload
  • data* File

    Junit reports to be uploaded. A single XML file or a zip archive containing multiple xml files and screenshots if available

  • projectName* String

    Name of the project to which the build details should be added to.

  • buildName* String

    Name of the build whose run/execution being uploaded

  • format String

    Type of the test reports being uploaded. Set to junit by default.

  • buildIdentifier String

    Unique build identifier of the build run, used to differentiate between multiple build runs. When not passed, the upload is treated as a new run. Use same identifier across multiple split-run or re-run uploads to map them under the same build run.

  • tags String

    Comma-separated strings users can pass to tag the build run appropriately (can be used for tagging the type of testing, release, etc.)

  • ci String

    CI link to the job if the CI system is integrated.

  • frameworkVersion String

    Framework name and version (e.g., “mocha, 10.0.0”). Both framework name and version need to be passed comma separated.

Response attributes 200 OK JSON

Response

{
    "status": "success",
    "message": "Request to import Allure Reports received. Visit https://observability.browserstack.com/builds/egx8vyi2sytcwdonwpecyi61ogmewffarud76oes for more details."
}
  • status String

    Status of your upload request.

  • message String

    More details on the upload request.

Limitations

  • You have to upload Allure Reports chronologically. Test Observability considers the timestamp of the first test in the allure-results folder as the build start time. If you upload a build of the same name with a test that has an earlier timestamp, Test Observability will reject the build. This is to prevent data from previous runs from corrupting test result history metrics that are critical for analysis.
  • The buildIdentifier expires after six hours. Hence, new test results cannot be appended to an existing build run after six hours from the first API call.

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

Download Copy Check Circle