Test ownership
Test ownership is critical in adopting a healthy testing culture at your organization. Defining one or more teams as test owners allows these teams to become accountable for maintaining a fast and reliable test suite, ensuring confidence when you deploy your code.
Customers on the Pro and Enterprise plans can assign test ownership to teams.
Test ownership is managed via team assignments in a TESTOWNERS file. The team that is the default owner of a test will be automatically assigned flaky tests to triage.
Buildkite test ownership is currently in private beta
Please reach out to our support team to register for early access.
TESTOWNERS file format
A TESTOWNERS file uses Buildkite team slugs instead of user names. Your team slug will be your team name in kebab-case. You can view your teams in your organization settings, or fetch them from our API:
# Example team name to slug
Pipelines => pipelines
Test Analytics => test-analytics
📦 Packages => packages
The following example TESTOWNERS file, which you can copy as a starting point, explains the syntax of this file and how it works:
Permission requirements
The teams listed in your TESTOWNERS file must have permission to access the test suite before ownership records are created.
Setting test ownership
You can upload a TESTOWNERS file via this API endpoint:
curl --location 'https://analytics-api.buildkite.com/v1/test-ownerships' \
--header "Authorization: Bearer <your-suite-api-token>" \
-F 'file=@<your-TESTOWNERS-file-location>'
You can upload the same TESTOWNERS file to multiple test suites. However, a test suite can only have one active TESTOWNERS file.
You can also create a new pipeline to automatically upload your TESTOWNERS file when changes are detected.
Viewing test ownership
You can view the current test ownership rules for a test suite in your Test Suite > Test Ownership page.
Troubleshooting
A TESTOWNERS file follows the same rules as a .gitignore
or CODEOWNERS
file, with the exception of the .gitignore
rule that allows a file path to have no corresponding team.
# In a regular `.gitignore` or `CODEOWNER` file, the following
# block would set the `test-analytics` team as the owner of any
# file in the `/specs` directory at the root of your test location
# except for the `/specs/features` subdirectory, as its owners are
# left empty.
# This functionality is not supported in a Buildkite `TESTOWNERS`
# file, where `/spec/features` would be also be owned by the
# `test-analytics` team.
/specs/ test-analytics
/specs/features