DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

How to Integrate Automated Tests with Bitbucket Pipelines

Learn how to run automated tests in Bitbucket Cloud, publish JUnit-style results, choose pipeline steps and environments, and fix missing reports.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run automated tests in Bitbucket Cloud, add a bitbucket-pipelines.yml file at the repository root and run your test command in a Pipelines step. To display results in Bitbucket, configure your test runner to produce JUnit-style or Maven Surefire XML, then save the report in a supported location or declare it as a test-report artifact.

What you need before configuring tests

  • A Bitbucket Cloud repository with Pipelines enabled.
  • The test command your team already uses, such as npm test or a framework-specific command.
  • A build image containing the required runtime, plus any dependencies or services the tests need.
  • If you want results in Bitbucket’s test view, a way to generate supported JUnit-style or Maven Surefire XML.

This guide is for Bitbucket Cloud and Bitbucket Pipelines, not Bitbucket Data Center. The commands and report configuration depend on your project’s language and test framework.

As an Amazon Associate I earn from qualifying purchases.

Add a pipeline that runs your tests

  1. Create the configuration. Add bitbucket-pipelines.yml at the repository root. The file describes which pipeline runs and the commands executed in each step. See Atlassian’s Pipelines getting-started documentation.
  2. Select a build image. Choose a container image with the runtime your project needs. Add commands to install dependencies or prepare services that are not already available in the image.
  3. Run the test command. Put it under a step’s script. The example below shows the structure, but it is schematic—not a tested configuration. Replace the image, setup, test command, and report path to match your repository.
image: node:latest

pipelines:
  default:
    - step:
        name: Test
        script:
          - npm ci
          - npm test
        artifacts:
          - name: Test reports
            type: test-reports
            paths:
              - test-results/*.xml

The pipeline command must actually generate XML in the configured report directory; declaring a path alone does not produce test results. See Atlassian’s configuration guidance for pipeline structure and framework examples.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make test results visible in Bitbucket

Generate a supported XML report

Bitbucket Pipelines’ built-in test reporting recognizes JUnit and Maven Surefire XML reports. The test framework and language may differ, but the runner must emit a compatible report for Bitbucket to display failures and related details.

Atlassian’s getting-started documentation shows framework-specific approaches such as PHPUnit’s --log-junit, pytest’s --junit-xml, Jest with jest-junit, and JUnit reporters for Playwright or Cypress. Package names, flags, and configuration can vary by framework version, so use the current documentation for the runner you have installed: Bitbucket Pipelines getting started.

Use a default report path or declare a custom one

Documented report-discovery patterns include ./**/surefire-reports/**/*.xml, ./**/failsafe-reports/**/*.xml, ./**/test-results/**/*.xml, ./**/test-reports/**/*.xml, and ./**/TestResults/**/*.xml. Discovery is subject to a directory-depth limit. If your XML is outside the supported defaults, declare its location under the step’s artifacts with type: test-reports, as in the schematic example. Consult Atlassian’s current report configuration guidance for exact syntax and behavior.

Verify a pipeline run

  1. Open the pipeline run and confirm the test command executed successfully or failed as expected.
  2. Check the build logs and workspace output to confirm the XML report was created.
  3. Open the test results view and confirm it shows the expected failures and details.

Choose a pipeline structure that fits the test suite

One step or several

A single step can be enough for a small suite. For clearer logs and failure ownership, use separate steps for tasks such as build, unit tests, integration tests, and linting. Independent work can run in parallel, provided the tests do not depend on shared mutable state and the pipeline’s runtime and resource constraints allow it. Refer to Atlassian’s parallel-step documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

One environment or a version matrix

Use one build image when you only need to validate one runtime or dependency version. For compatibility coverage, define separate steps with different images. Atlassian documents this cross-platform testing pattern and notes that xUnit-compatible results can appear in the log view; see testing across multiple platforms.

Test reports and other artifacts serve different purposes

Test-report artifacts make compatible XML available for Pipelines test reporting. Other artifacts can preserve failure evidence such as screenshots, videos, and logs. Artifact scope and retention have separate rules, so check Atlassian’s artifact documentation when deciding what to retain.

Troubleshoot missing or incomplete test results

The test results view does not appear

  • Confirm Pipelines is enabled. A YAML file alone does not run a pipeline; check the repository’s Pipelines configuration and the run status.
  • Confirm the test command ran. Review the step log for a skipped command, an earlier failure, or a different working directory.
  • Check the report format. Ensure the runner writes JUnit-style or Maven Surefire XML, rather than only human-readable console output.
  • Check the file path and depth. Place reports in a supported default location or declare the custom path under artifacts with type: test-reports.
  • Check that a report file exists. A configured reporter may write nothing when tests do not start or when its output directory differs from the one configured in YAML.

Tests pass but Bitbucket shows no failures or details

Inspect the generated XML itself and confirm it contains the test cases and failure information. Then verify that the XML is under the path pattern Bitbucket is collecting. If the runner’s output is not JUnit or Maven Surefire-compatible, configure an appropriate reporter for that framework.

A pipeline step fails before tests start

Use the first relevant error in the step log to distinguish setup problems from test failures. Check that the image has the expected runtime, dependency installation completed, and any required service or environment variables are configured. A pipeline that stops during setup cannot generate a test report.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Options beyond basic pipeline reporting

Richer test management

Atlassian describes Bitbucket Tests as an open beta with test summaries, flaky-test detection, and quarantine controls. Its documentation says availability is limited to Standard and Premium customers. Beta status and plan eligibility can change, so verify current availability before planning around it: Bitbucket Tests documentation.

Pull-request insights and external test services

Code Insights can surface reports and metrics in pull requests. Atlassian also lists third-party testing integrations, including Sauce Labs, for teams needing hosted browser or device coverage. These are separate from the basic Pipelines test-report workflow; see Code Insights and Atlassian’s testing integrations for current details.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If a test workflow needs a website screenshot—for example, to inspect a page state—ScreenshotNeo is a website screenshot API and MCP server for developers. It is separate from Bitbucket’s test reporting: use it when a test or AI agent needs a screenshot, not as a replacement for a JUnit report.

One GET request can return an image or PDF. For example, use cURL to save a WebP screenshot:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for parameters and response behavior. ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 screenshots per month without a card. Paid plans start at $5 for 3,000 shots; all features are available on every plan. Sign up for 1,000 free screenshots a month—no card required.

Frequently Asked Questions

Does Bitbucket Pipelines require a particular test framework?

No. The test command is project-specific; for built-in result display, the runner must produce a supported JUnit-style or Maven Surefire XML report.

Can Pipelines show a test report stored outside its default paths?

Yes. Declare the custom XML location as a test-report artifact using type: test-reports and the appropriate path pattern.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.