Lesstep
Bitbucket Cloud · Pipelines · Checked November 2, 2026

Bitbucket Pipelines: test results not showing

Pipelines does not run your tests for you or read their console output. It looks for JUnit-style XML files that your test run wrote, in a few folders under the build directory, and shows the failures it finds. When nothing shows up, either there was no file where it looks, or nothing failed.

Where Pipelines looks

Atlassian's page Get started with tests in Pipelines lists the places, searched from the build directory /opt/atlassian/pipelines/agent/build with a directory depth of 3 levels:

./**/surefire-reports/**/*.xml
./**/failsafe-reports/**/*.xml
./**/test-results/**/*.xml
./**/test-reports/**/*.xml
./**/TestResults/**/*.xml

The files have to be JUnit or Maven Surefire XML. The language does not matter. Maven's Surefire plugin writes to target/surefire-reports with no extra settings.

Jest and Mocha write somewhere else by default

Atlassian's Jest and Mocha examples add the reporter but do not say where the file goes. The reporters' own defaults are outside those folders:

Both take a path from an environment variable, so the step can put the file in a folder Pipelines scans:

script:
  - npm ci
  - JEST_JUNIT_OUTPUT_DIR=./test-results npm test
  # Mocha: MOCHA_FILE=./test-results/junit.xml npm test

Atlassian's other examples already write into a scanned folder: pytest --junit-xml=test-results/junit.xml, phpunit --log-junit ./test-reports/junit.xml, and Playwright's ['junit', { outputFile: 'test-results/junit.xml' }].

Reports written inside a container

When the tests run inside docker build, docker run or Docker Compose, the XML stays in that container, and the scanner, which starts from the build directory, does not see it. Copy the reports out, or mount a folder under the build directory ($BITBUCKET_CLONE_DIR); a volume outside it is refused ("authorization denied by plugin pipelines").

- docker run -v $BITBUCKET_CLONE_DIR/test-results:/app/test-results my-app npm test

Another folder

For reports somewhere else, Atlassian's page shows an artifact of type test-reports with the paths:

artifacts:
  upload:
    - name: "custom test reports"
      type: "test-reports"
      paths:
        - "custom_path/*.xml"
        - "**/custom_path2/*.xml"

Reports deeper than the 3 levels, as in some monorepos, can be listed the same way.

Nothing failed, or too much failed

The Tests page in the repository

The same page describes Tests in the repository's sidebar: an overview of flaky and quarantined tests, failure rates and each test's history. It is in open beta for Pipelines on the Standard and Premium plans. It collects results from the default branch and up to four other branches that a repository admin picks under Repository settings, Tests, Branch tracking; results from other branches do not show there.

Bitbucket Pipelines in IntelliJ IDEA

Pipeline Inbox for Bitbucket Pipelines, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of all your Bitbucket Cloud repositories in an IDE tool window, with their steps, the failed step and the command it stopped at, and the step's log as Bitbucket writes it. The list, steps and logs are free; running, re-running and stopping pipelines are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

Atlassian, Bitbucket and Bitbucket Pipelines are trademarks of Atlassian; Docker is a trademark of Docker, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian, Docker or JetBrains.

More: A variable is empty · "Host key verification failed" (SSH) · "Cannot connect to the Docker daemon" · "authorization denied by plugin pipelines" (Docker) · "Container 'docker' exceeded memory limit." · Pipelines did not run after a push · "Container 'Build' exceeded memory limit." · "Exceeded build time limit of 120 minutes" · The cache is not used · "unexpected system error" · "command not found" · Submodules not cloned · "We couldn't clone the repository" · "No online runner available" · "No space left on device" · "Step exceeded processing limits" · The artifact is missing in the next step · The build passed before and fails now · Build setup takes too long · "You've run out of build minutes" · "Permission denied to update branch" · "You have reached your pull rate limit" (Docker Hub) · "There is an error in your bitbucket-pipelines.yml" · "This pipeline was paused" (deployments) · "Not authorized to perform sts:AssumeRoleWithWebIdentity" (OIDC to AWS) · Bitbucket Pipelines plugins for IntelliJ IDEA, compared · 日本語