Skip to content

Tests

Tests keeps the results of every job and run that reports JUnit XML: each test’s file, name, duration and outcome, for 30 days.

In a run, pass --junit:

Terminal window
bareci run --junit junit.xml -- bun test --reporter=junit --reporter-outfile=junit.xml

In a CI job, report the file after the tests:

Terminal window
bareci report test-results/junit.xml

Flows write JUnit too, so end-to-end results sit beside unit tests.

A test is flaky when it both failed and passed on the same commit, or passed on retry. tests_flaky lists flaky tests with their counts and last failure message.

The Gate uses this: a failed check whose failing tests are all known to be flaky is re-run before it counts, and new flaky tests in a pull request are named in the verdict.

tests_slowest lists the slowest files and tests, so an agent can see, for example, which few files take most of the suite’s time.

Terminal window
bareci shard --total 4 --index 1 tests/**/*.test.ts

shard prints this shard’s files, balanced by recorded duration: longest first onto the least-loaded shard. Files with no history count as the median. With bareci run --shards N, each machine has BARECI_SHARD_INDEX and BARECI_SHARD_TOTAL set.

See the Tests API.