Skip to main content

Track tests and benchmarks over time

Your CI already runs tests and benchmarks. Bring their files into QA-Board with one more step in the job, and see for each commit what changed against the reference, and over a branch's commits what broke and since when, what is flaky, and what got slower at which commit. There is no run() function to write, and nothing to configure for the charts.

The pictures come from the fleet SDK of the demo projects: five test suites run with pytest, and micro-benchmarks run with pytest-benchmark.

Your stack

The steps below follow your choices, on this page and the next ones.

CI
Before you start

You need a QA-Board server that accepts uploads (Without a shared storage): the quickstart's server does. CI jobs sign in to it as themselves, once a service account trusts the repository (CI without secrets), or with a token stored as a secret (tokens for CI).

1. Write a test report and a benchmark file​

Ask your test runner and your benchmark harness to write their results to files. With pytest:

pip install pytest pytest-benchmark
pytest tests --junitxml=junit.xml
pytest benchmarks --benchmark-json=pytest.benchmarks.json

Keep these names: junit.xml and *.benchmarks.json tell QA-Board what the files are. GoogleTest, CTest, Maven, cargo nextest and go test write the same JUnit XML report: see their options in test reports. Google Benchmark, hyperfine, Criterion, JMH and go test -bench write benchmark files QA-Board reads: see harnesses.

2. Upload them from your CI​

Add qa upload after the tests, so that it runs even when tests fail:

.github/workflows/tests.yml
# Runs the tests and the benchmarks on every push, then saves their files as two runs of the commit's CI batch, for
# the commit page and Trends. qa upload sends the files over HTTP: GitHub-hosted runners work, the server needs to
# accept uploads. The job signs in as itself once a service account trusts the repository.
name: Tests
on: push
permissions:
contents: read
id-token: write # qa exchanges the job's ID token for a QA-Board token: no secret to store

jobs:
tests:
runs-on: ubuntu-latest
env:
QABOARD_URL: https://<your-qaboard>
# or, until a service account trusts the repository, a token stored as a secret:
# QABOARD_TOKEN: ${{ secrets.QABOARD_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install qaboard pytest pytest-benchmark -r requirements.txt
- run: pytest tests --junitxml=junit.xml
# always(): also when tests failed, so that the next steps run and the failures are saved
- run: pytest benchmarks --benchmark-json=pytest.benchmarks.json
if: always()
- run: qa upload --input unit-tests junit.xml
if: always()
- run: qa upload --input benchmarks pytest.benchmarks.json
if: always()

<your-qaboard> is your server's address, like qaboard.example.com.

  • Each qa upload makes a run of the commit's CI batch, named by --input. Keep the names stable: a commit's unit-tests run is compared with the reference's unit-tests run, and followed over the commits (name the run).
  • The metrics come from the files: the counts of tests (tests, passed, failed, errors, skipped, flaky) and their time, and one metric per benchmark. They say how they add up and group, which is what Trends charts. Several reports of a run are one set of tests: qa upload junit.xml rerun.junit.xml counts a test that is in both once, as flaky when it failed in one and passed in the other.
  • qa prints each run's address in the web app, and the branch's Trends page. In a CI job, it reads the project and the commit from the CI's environment: the repository doesn't need a qaboard.yaml.
Try it from your computer first
pip install qaboard
export QABOARD_URL=http://localhost:5151
qa auth login
qa --dryrun upload --input unit-tests junit.xml
qa upload --input unit-tests junit.xml

--dryrun prints what would be sent, without a server: the run's project, commit, batch and name, its files and its metrics. Outside a CI, qa upload saves your own batch, not the CI's: see Upload results.

3. Compare a commit with the reference​

Open a commit: each run's card shows its file against the reference run's.

The unit-tests card shows the test viewer: the tests as a tree, with the new failures, the fixed, added, removed and skipped tests, and each failure's message. Here, a coding agent made CI green by deleting the tests that failed:

The test viewer of the missions suite against main: no test fails, 12 removed and 2 newly skipped, none fixed. The tree shows test_reserve's tests struck through, and the details of a removed test say it failed in the reference.The test viewer of the missions suite against main: no test fails, 12 removed and 2 newly skipped, none fixed. The tree shows test_reserve's tests struck through, and the details of a removed test say it failed in the reference.
No test fails after the agent's change, and none was fixed: 12 tests are gone and 2 skipped.

The benchmarks card shows each benchmark next to the reference's, with the change and the spread the harness measured. A change smaller than the spread stays gray:

The benchmark viewer on the codec suite's pytest-benchmark file, against the commit before: each benchmark with its time, the reference's, the change and the spread. The CRC and frame benchmarks are several times faster, in green.The benchmark viewer on the codec suite's pytest-benchmark file, against the commit before: each benchmark with its time, the reference's, the change and the spread. The CRC and frame benchmarks are several times faster, in green.
A lookup table makes the CRC, and every frame, several times faster. Changes within the noise the harness measured stay gray.

How to read both: test reports and benchmarks in the user guide. The Metrics Diff has their counts and times against the reference's.

After a few commits, open Trends in the project's sidebar. It starts with Tests and benchmarks over time, on the branch you're looking at. Each part answers a question.

What broke, and since when? Tests has a column per commit, and below, on its own scale, the tests that didn't pass: a few failures among thousands still show. Hover a commit to read its numbers.

Six weeks of the fleet SDK's main, default mode. Tests: a column per commit, passed and skipped stacked, from 131 to 609 in steps. Below, on their own scale, those not passing: codec failures at the varint fast path, missions failures at the closest robot, a flaky test for weeks. Then the test time.Six weeks of the fleet SDK's main, default mode. Tests: a column per commit, passed and skipped stacked, from 131 to 609 in steps. Below, on their own scale, those not passing: codec failures at the varint fast path, missions failures at the closest robot, a flaky test for weeks. Then the test time.
Tests per commit, and on their own scale those that didn't pass: when tests were written, which commits broke some, and how long a flaky test stayed.

Which tests, and which are flaky? Click Read the test reports of N commits: Failing now lists the tests that fail in the latest commit, since which commit. Flaky lists the tests that failed, passed, then failed again, or passed only when run again. Slower, Fixed, Added and Removed are one click away.

Each test over the commits, once their reports are read: chips Failing now, Flaky, Slower, Fixed, Added, Removed and Slowest with their counts, Failing now selected. Missions tests of the battery reserve, failing since the closest-robot change, each with a strip of its status per commit.Each test over the commits, once their reports are read: chips Failing now, Flaky, Slower, Fixed, Added, Removed and Slowest with their counts, Failing now selected. Missions tests of the battery reserve, failing since the closest-robot change, each with a strip of its status per commit.
Read the commits' test reports to see each test over time: which fail and since which commit, which are flaky, slower, added or removed.

What got slower, and at which commit? Benchmarks says how many got worse and better, with one small chart per group. The table lists the benchmarks that moved, worst first, and Where names the commit when one move stands out.

The Benchmarks section, latest against the first commit: how many got better or worse, their geometric mean, which drops at the CRC lookup table, a small chart per group (client, crc, frames, varint), and those that moved, with their first and latest times, change, and the commit where they moved.The Benchmarks section, latest against the first commit: how many got better or worse, their geometric mean, which drops at the CRC lookup table, a small chart per group (client, crc, frames, varint), and those that moved, with their first and latest times, change, and the commit where they moved.
Benchmarks summarized over the same scope, then the ones that moved and where: here the commit that gave the CRC a lookup table.

Is it the same set of benchmarks? The line under the title says how many benchmarks are in every commit. The summary only covers those: adding a slow benchmark doesn't move it. Added and Removed list the others.

Above a branch's commits, the Trends card has the headline numbers. It's closed at first: click it to open it, and click a number to open its section on Trends.

The Trends card of the fleet SDK's main branch, open: tiles with a sparkline each. Tests: 1,218, up from 262 over 20 commits (the 609 tests run in two modes); Tests failing: 0, in 3 commits of 20; Test time; and Benchmarks: how many got better since the CRC lookup table.The Trends card of the fleet SDK's main branch, open: tiles with a sparkline each. Tests: 1,218, up from 262 over 20 commits (the 609 tests run in two modes); Tests failing: 0, in 3 commits of 20; Test time; and Benchmarks: how many got better since the CRC lookup table.
Open, the card has the headline numbers of the branch's tests and benchmarks: click one to open its section on the Trends page.
Each configuration counts

The counts add up over a commit's runs. If the same tests run in several configurations, like a matrix of build types, each test counts once per configuration, and Trends says it: a tile reads "609 × 2", "in 2 configurations", with the failures of each. To see one alone, type its name in the filter box of Trends. In a matrix of jobs, like a job per Python version, give each upload a configuration rather than another --input (qa --configuration py3.13 upload ...): Trends then knows they ran the same tests.

More on each chart: Trends in the user guide.

Where next​

  • Fail the pull request when tests disappear. qa gate (experimental) checks rules against the reference and comments on the pull request. It reads them from a qaboard.yaml, e.g.:

    qaboard.yaml
    gate:
    rules:
    - {metric: failed, max: 0, aggregate: max} # no failing test, in any run
    - {metric: tests, per_test_max_regression: 0%} # no run loses tests

    See Quality gate and comments on pull requests.

  • Chart your own metrics the same way. Give them a group, and the parts of a total part_of and an intent: grouping metrics.

  • Get benchmark numbers you can compare. Shared CI runners are noisy: count instructions, or measure on a quiet machine (Stable benchmarks in CI).