Emit an artifact
Capture the state first, then emit it:
Keep files small: video is the kind most likely to hit the size cap. The caps and every flag rule are in
outerlayer emit artifact.
Where it lands
Inside a recorded session, the file is queued, and the nextouterlayer sync uploads it with the session. A session not launched with OUTERLAYER_WORK refuses the emit, because nothing it produces may leave the machine.
Outside a session, it uploads at once. It attaches to the first of these that exists:
- The pull request
--prnames. - In GitHub Actions, the pull request the run is for.
- The current git checkout.
--pr.
Bind it to a criterion
First record the item’s criteria withouterlayer emit criteria. Then pass one of their ids to --for, and the Criteria tab shows the artifact on that row:
Prove a criterion with test results
A criterion can declare"proof": "test". Bind JUnit XML results to it with --for. Vitest, Jest, pytest, Go (through gotestsum), JUnit and RSpec can all write that format.
--test. Add =<path>:<line> to say where a test is written:
--test, and for which XML files are accepted, are in outerlayer emit artifact.
A test’s location comes from the testcase’s own file and line attributes first, then from --test. A test with neither shows by name, with no link. Vitest and jest-junit write file only with their addFileAttribute option. pytest writes it only under junit_family=xunit1.
The criterion is proven when every bound test passed, at least one passed, and no test you named with --test was skipped. A failed or errored test leaves it unproven. A skipped test you did not name neither proves nor fails it. When you emit again after a fix, retire the old results with --replaces, or the old failure still counts.
Results prove a criterion only at the head commit of a pull request linked to the item. In GitHub Actions, the command records the pull request’s head commit, not the merge commit the checkout holds. On other CI, check out the pull request’s head commit before you run the tests. Results from an earlier commit show as out of date on the Criteria tab and prove nothing until you emit again at the head.
To require that results came from CI, set criteria.test_proof: ci in the policy file.
On the Criteria tab, each bound test links to its file and line at the commit that ran it. A failed test is marked as failed.
Replace an earlier artifact
The command prints an id. Pass it to--replaces to correct that artifact:
--replaces.
Find the artifact afterwards
Once it uploads, the artifact appears on the work item’s page:- on its criterion’s row on Criteria, when it is bound to one;
- beside the check that names it on Checks;
- otherwise under Other artifacts on Checks.