> ## Documentation Index
> Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Robot Framework

> A guide for generating Trunk-compatible test reports for Robot Framework

You can automatically [detect and manage flaky tests](../../detection/) in your projects running tests with Robot by integrating with Trunk. This document explains how to configure Robot to output JUnit XML reports that can be uploaded to Trunk for analysis.

## Setup steps

Work through the steps below in order. Once you've finished the last one, you'll be ready to move on to [configure uploads in CI](../ci-providers/).

<Steps>
  <Step title={<a href="#generating-reports">Generate a compatible test report</a>} />

  <Step title={<a href="#report-file-path">Configure the report file path or glob</a>} />

  <Step title={<a href="#disable-retries">Disable retries for better detection accuracy</a>} />

  <Step title={<a href="#try-it-locally">Test uploads locally</a>} />
</Steps>

## Generating Reports

Trunk detects flaky tests by analyzing test results automatically uploaded from your CI jobs. You can do this by generating Trunk-compatible XML reports from your test runs.

To output compatible reports, add the `--xunit` argument to your `robot` command:

```shell theme={null}
robot --xunit=junit.xml TestSuite.robot
```

### Report File Path

The JUnit report will be written to the location specified by the `--xunit` argument. In the example above, it would be at `./junit.xml`.

### Disable Retries

You need to disable automatic retries if you previously enabled them. Retries compromise the accurate detection of flaky tests. You should disable them and prefer using the [Quarantine](../../quarantining/) feature to mitigate the negative impact of Flaky Tests.

Omit the [`--rerunfailed`](https://docs.robotframework.org/docs/flaky_tests#re-execute-failed-tests-and-merge-results) flag and remove any [RetryFailed Listeners](https://docs.robotframework.org/docs/flaky_tests#retryfailed-listener) previously configured to run as part of your CI pipeline to disable retries.

## Try It Locally

### The Validate Command

You can validate your test reports using the [Trunk Analytics CLI](../../reference/cli-reference). If you don't have it installed already, you can install and run the `validate` command like this:

<CodeGroup>
  ```bash Linux (x64) theme={null}
  SKU="trunk-analytics-cli-x86_64-unknown-linux.tar.gz"
  curl -fL --retry 3 \
    "https://github.com/trunk-io/analytics-cli/releases/latest/download/${SKU}" \
    | tar -xz

  chmod +x trunk-analytics-cli
  ./trunk-analytics-cli validate --junit-paths "./junit.xml"
  ```

  ```bash Linux (arm64) theme={null}
  SKU="trunk-analytics-cli-aarch64-unknown-linux.tar.gz"
  curl -fL --retry 3 \
    "https://github.com/trunk-io/analytics-cli/releases/latest/download/${SKU}" \
    | tar -xz

  chmod +x trunk-analytics-cli
  ./trunk-analytics-cli validate --junit-paths "./junit.xml"
  ```

  ```bash macOS (arm64) theme={null}
  SKU="trunk-analytics-cli-aarch64-apple-darwin.tar.gz"
  curl -fL --retry 3 \
    "https://github.com/trunk-io/analytics-cli/releases/latest/download/${SKU}" \
    | tar -xz

  chmod +x trunk-analytics-cli
  ./trunk-analytics-cli validate --junit-paths "./junit.xml"
  ```

  ```bash macOS (x64) theme={null}
  SKU="trunk-analytics-cli-x86_64-apple-darwin.tar.gz"
  curl -fL --retry 3 \
    "https://github.com/trunk-io/analytics-cli/releases/latest/download/${SKU}" \
    | tar -xz

  chmod +x trunk-analytics-cli
  ./trunk-analytics-cli validate --junit-paths "./junit.xml"
  ```
</CodeGroup>

**This will not upload anything to Trunk**. To improve detection accuracy, you should **address all errors and warnings** before proceeding to the next steps.

### Test Upload

Before modifying your CI jobs to automatically upload test results to Trunk, try uploading a single test run manually.

You make an upload to Trunk using the following command:

```sh theme={null}
./trunk-analytics-cli upload --junit-paths "./junit.xml" \
    --org-url-slug <TRUNK_ORG_SLUG> \
    --token <TRUNK_ORG_TOKEN>
```

You can find your Trunk organization slug and token in the settings or by following these [instructions](/flaky-tests/get-started/ci-providers/otherci#id-1.-store-a-trunk_token-secret-in-your-ci-system). After your upload, you can verify that Trunk has received and processed it successfully in the **Uploads** tab. Warnings will be displayed if the report has issues.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/sFimNZJZkARSWl7b/assets/data-uploads-light.png?fit=max&auto=format&n=sFimNZJZkARSWl7b&q=85&s=8c4b3bc96a38633b296460b80d4c885b" alt="" width="2560" height="1800" data-path="assets/data-uploads-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/sFimNZJZkARSWl7b/assets/data-uploads-dark.png?fit=max&auto=format&n=sFimNZJZkARSWl7b&q=85&s=b4cb37941c1f5482eb4c6b238b155249" alt="" width="2560" height="1800" data-path="assets/data-uploads-dark.png" />
</Frame>

## Next Steps

Configure your CI to upload test runs to Trunk. Find the guides for your CI framework below:

<Columns cols={3}>
  <Card title="Atlassian Bamboo" href="/flaky-tests/get-started/ci-providers/atlassian-bamboo" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/vH22oYqJ2iVryN7Y/assets/atlassian-bamboo.png?fit=max&auto=format&n=vH22oYqJ2iVryN7Y&q=85&s=95ec903e2ced8dad8d8c07d739485c74" width="1600" height="1000" data-path="assets/atlassian-bamboo.png" />

  <Card title="Azure DevOps Pipelines" href="/flaky-tests/get-started/ci-providers/azure-devops-pipelines" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/vH22oYqJ2iVryN7Y/assets/azure.png?fit=max&auto=format&n=vH22oYqJ2iVryN7Y&q=85&s=95e4f3ec688ffeef513cb5b8b19f74a3" width="1600" height="1000" data-path="assets/azure.png" />

  <Card title="BitBucket Pipelines" href="/flaky-tests/get-started/ci-providers/bitbucket-pipelines" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/bitbucket.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=2bc3259942fdfae2139dcfc9db068866" width="1600" height="1000" data-path="assets/bitbucket.png" />

  <Card title="BuildKite" href="/flaky-tests/get-started/ci-providers/buildkite" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/buildkite.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=575695f248243b47a8d67f747a75e448" width="1600" height="1000" data-path="assets/buildkite.png" />

  <Card title="CircleCI" href="/flaky-tests/get-started/ci-providers/circleci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/circle-ci.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=f73d59bf4a72b5e68c280976ddc4066d" width="1600" height="1000" data-path="assets/circle-ci.png" />

  <Card title="Drone CI" href="/flaky-tests/get-started/ci-providers/droneci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/drone.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=3bbaa2518ba91b8246c50b6b1e36e1df" width="1600" height="1000" data-path="assets/drone.png" />

  <Card title="GitHub Actions" href="/flaky-tests/get-started/ci-providers/github-actions" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/github.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=6d2de56991fce0552885fdc75f2e1d6d" width="1600" height="1000" data-path="assets/github.png" />

  <Card title="GitLab" href="/flaky-tests/get-started/ci-providers/gitlab" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/gitlab.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=78573778bbb9a35bf5db1e73fdc92b58" width="1600" height="1000" data-path="assets/gitlab.png" />

  <Card title="Jenkins" href="/flaky-tests/get-started/ci-providers/jenkins" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/jenkins.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=4d0445ddaf9db7736ee1116532d31586" width="1600" height="1000" data-path="assets/jenkins.png" />

  <Card title="Semaphore" href="/flaky-tests/get-started/ci-providers/semaphoreci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/semaphore.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=c9bba6a88215d727086a9470b0bfe505" width="1600" height="1000" data-path="assets/semaphore.png" />

  <Card title="TeamCity" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/teamcity.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=de0f93576cbbb5283ffb161df5e94213" width="1600" height="1000" data-path="assets/teamcity.png" />

  <Card title="Travis CI" href="/flaky-tests/get-started/ci-providers/travisci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/travis.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=c2610eacfb7d51ab23d4113580273a30" width="1600" height="1000" data-path="assets/travis.png" />

  <Card title="Other CI Providers" href="/flaky-tests/get-started/ci-providers/otherci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/IOHMauT6NHRuLByD/assets/other.png?fit=max&auto=format&n=IOHMauT6NHRuLByD&q=85&s=09b8937282b423bd7c3dfccee6de50ba" width="1600" height="1000" data-path="assets/other.png" />
</Columns>

<Columns cols={3}>
  <Card title="Azure DevOps Pipelines" href="../ci-providers/azure-devops-pipelines" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/vH22oYqJ2iVryN7Y/assets/azure.png?fit=max&auto=format&n=vH22oYqJ2iVryN7Y&q=85&s=95e4f3ec688ffeef513cb5b8b19f74a3" width="1600" height="1000" data-path="assets/azure.png" />

  <Card title="BitBucket Pipelines" href="../ci-providers/bitbucket-pipelines" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/bitbucket.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=2bc3259942fdfae2139dcfc9db068866" width="1600" height="1000" data-path="assets/bitbucket.png" />

  <Card title="BuildKite" href="../ci-providers/buildkite" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/buildkite.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=575695f248243b47a8d67f747a75e448" width="1600" height="1000" data-path="assets/buildkite.png" />

  <Card title="CircleCI" href="../ci-providers/circleci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/o-qrLN5lILsrkOig/assets/circle-ci.png?fit=max&auto=format&n=o-qrLN5lILsrkOig&q=85&s=f73d59bf4a72b5e68c280976ddc4066d" width="1600" height="1000" data-path="assets/circle-ci.png" />

  <Card title="Drone CI" href="../ci-providers/droneci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/drone.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=3bbaa2518ba91b8246c50b6b1e36e1df" width="1600" height="1000" data-path="assets/drone.png" />

  <Card title="GitHub Actions" href="../ci-providers/github-actions" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/github.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=6d2de56991fce0552885fdc75f2e1d6d" width="1600" height="1000" data-path="assets/github.png" />

  <Card title="GitLab" href="../ci-providers/gitlab" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/gitlab.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=78573778bbb9a35bf5db1e73fdc92b58" width="1600" height="1000" data-path="assets/gitlab.png" />

  <Card title="Jenkins" href="../ci-providers/jenkins" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/olzoGwMhwlaPFZnw/assets/jenkins.png?fit=max&auto=format&n=olzoGwMhwlaPFZnw&q=85&s=4d0445ddaf9db7736ee1116532d31586" width="1600" height="1000" data-path="assets/jenkins.png" />

  <Card title="Semaphore" href="../ci-providers/semaphoreci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/semaphore.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=c9bba6a88215d727086a9470b0bfe505" width="1600" height="1000" data-path="assets/semaphore.png" />

  <Card title="TeamCity" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/teamcity.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=de0f93576cbbb5283ffb161df5e94213" width="1600" height="1000" data-path="assets/teamcity.png" />

  <Card title="Travis CI" href="../ci-providers/travisci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/oQBmNuRUJi49Tl6F/assets/travis.png?fit=max&auto=format&n=oQBmNuRUJi49Tl6F&q=85&s=c2610eacfb7d51ab23d4113580273a30" width="1600" height="1000" data-path="assets/travis.png" />

  <Card title="Other CI Providers" href="../ci-providers/otherci" img="https://mintcdn.com/trunk-4cab4936-sam-gutentag-changelog-merge-queue-failure-s/IOHMauT6NHRuLByD/assets/other.png?fit=max&auto=format&n=IOHMauT6NHRuLByD&q=85&s=09b8937282b423bd7c3dfccee6de50ba" width="1600" height="1000" data-path="assets/other.png" />
</Columns>
