Skip to main content
Stout enables CI Metrics per organization, on request. To use CI Metrics, ask Stout to enable it for your organization.
CI Metrics shows what your hardware CI pipeline reports to Stout. It answers three questions: which merges ran on real hardware, which failures were real firmware bugs, and which tests are flaky. A repository can hold several products, and each product can have its own hardware test suite. CI Metrics shows the metrics for one product, or for all products together. Your CI sends two kinds of reports to Stout. It sends a merge announcement for each merge, and a run report for each hardware test run. Stout calculates the metrics from these reports. To tell real firmware bugs from bench problems, Stout also needs a description of the files in each product.

Set up reporting

Setup has four parts:
  1. Create a CI key.
  2. Send a merge announcement for each merge.
  3. Send a run report for each hardware test run.
  4. Describe the files of each product.
After parts 1 to 3, Stout shows merges, failures, and flaky tests. Part 4 lets Stout separate real firmware bugs from problems in the bench or the test harness.

Create a CI key

A CI key lets your CI send reports to Stout. It works only for the report endpoints, and it cannot reach a box. The dashboard has no page for CI keys. Use the HTTP API with the access token of an owner or admin. See HTTP API for authentication.
The response contains the key in apiKey. The key starts with stout_, followed by 64 hexadecimal characters.
Before you close the response, store apiKey in the secret store of your CI. Stout shows the key only in this response. Stout cannot show the key again.
The list shows the name of each key and the times when someone created it, last used it, and revoked it. The list never shows the key itself. A revoked key stops working immediately.

Send a merge announcement

Send one merge announcement for each merge to the branch that you test. Send it from a CI job that does not need the hardware. Then Stout counts each merge, also when your hardware runner is offline. If the repository holds several products, send one announcement for each product whose test suite the merge starts. A merge that changes code that two products share gets two announcements.
Stout returns HTTP 204. A second announcement with the same repo_key, suite, and sha changes nothing.

Send a run report

At the end of each attempt of a hardware test run, send one run report. Send it when the run passes and when it fails. If the run uses several bench boxes, send one report for each box.
Each item in tests has these fields: The changes object has these fields: Each item in commits has these fields: For a new attempt of the same run, send the same changes as for the first attempt.
The changes field sends the first line of each commit message and the paths of the changed files. It sends no source code. If a failed test has no verdict, or its run has no changes, Stout cannot decide whether the failure was a real firmware bug.
Stout returns HTTP 204. A second report with the same repo_key, run_id, run_attempt, and box_key replaces the first report. If a request body breaks these rules, Stout returns HTTP 400. If the X-API-Key header has no key, a wrong key, or a revoked key, Stout returns HTTP 401.

Describe the files of each product

Stout finds real firmware bugs from the files that each commit changed. To do this, Stout must know which files are the firmware of a product, and which files are its test harness. Send one description for each product. When the files of a product move to other directories, send the description again.
A path pattern is relative to the root of the repository. The patterns follow the paths filter of GitHub Actions, with fewer special characters:
  • * matches any characters in one directory level.
  • ** matches any characters across directory levels.
  • A ! at the start excludes the files that the rest of the pattern matches. Put every ! pattern after all the other patterns.
  • A pattern that contains ?, +, [, ], {, }, or \ is not valid.
Stout returns HTTP 204. A new description replaces the old one. The next time that you open the page, Stout applies it to all earlier failures.

Read the metrics

To change the period, use the date control at the top of the page. 7d, 30d, and 90d select the last 7, 30, or 90 days. The page starts with the last 30 days. To see one product, select it in the product list. The list shows All products until you select a product. In All products, a merge that your CI announced for two products counts two times. A merge that your CI announced without a product shows as Unassigned in All products. The view of a single product does not count it. Two merges can land in separate pushes a few seconds apart. Then the bench can test only the second push, and the first merge shows as not checked.

How Stout labels a failure

A failure is a test with the outcome fail in a run that reached the hardware. Stout gives each failure one of three labels. Stout looks at each bench box on its own, so a pass on one box does not change a failure on another box. Stout calculates the labels each time that you open the page. A new report can change the label of an older failure. A test can fail on several commits in a row, with no pass between the failures. Stout counts these failures as one resolved failure. A run report with hello_ok set to false does not count in any metric, except Infra runs. The flake rate is the number of failed attempts, divided by all attempts, as a percentage. A test that passed on its third attempt adds two failed attempts. Each metric uses its own date:
  • Merges use merged_at.
  • Resolved failures use the start time of the first run that failed.
  • Flake rates and infra runs use the start time of each run.

How Stout finds real firmware bugs

Stout checks each resolved failure against three conditions. Stout counts the failure as a real firmware bug only if all three conditions are true:
  1. The test harness blamed the device. The failed test has the verdict device.
  2. The commit under test changed firmware. The changes of the first run on the failing commit include a firmware file.
  3. The fix changed firmware, and not the test harness. Between the failure and the fix, a commit changed a firmware file. No commit in that range changed only test harness files.
Stout checks the conditions in this order, and the first condition that fails gives the reason. If Stout has too little data to decide, it marks the failure Ambiguous. Real FW bugs caught names the firmware commit that broke the test and the commit that fixed it. If more than one commit qualifies, it shows the range of commits. Resolved by a bench or harness change shows every other resolved failure, with one of these reasons:

Confirm or dismiss a failure

Organization owners and admins can correct the automatic label of a resolved failure. A review replaces the automatic label. Stout keeps the review when it calculates the labels again.
  • To count a failure from Resolved by a bench or harness change as a real firmware bug, click Confirm on its row.
  • To remove a failure from Real FW bugs caught, click Dismiss on its row. Stout moves the failure to the other list, with the reason Dismissed by an admin.
  • To go back to the automatic label, click Reset on the row.
The Status column shows Automatic, or the person who confirmed or dismissed the failure. The audit log records each review.