Triage
Find out why a run failed, and tell a real bug from a flaky test, a test problem or a setup problem.
When a suite fails, Cofactor writes up the cause. You get a verdict, the failures grouped by cause, and a diagnosis for each failed test, so you start from the causes.
Read the triage of a suite run
-
Open the suite run. In Suites, open Test Runs, then the run that failed. Cofactor triages a suite run when any test in it did not pass, once the diagnoses are ready. This can take up to about 20 minutes. The triage summary only reads results.
-
Read the verdict. The triage panel shows a verdict and a headline.
Verdict Meaning All clear Every test ran, and at most some suite maintenance is left. Needs attention A real bug or lost coverage needs work. Urgent Something is broken badly. -
Read the findings. Findings are ranked, most important first, and sit in three groups. Grouped failures are failures with one shared cause. Real bugs are defects in your app. Suite maintenance covers tests that need updating. Each finding lists the failed tests behind it and the issues already filed. Failures that started failing in this run are marked as newly failing. Partial diagnostics means some diagnoses were not ready in time.
-
Get the same view from the CLI.
bashcofactor triage wait latest cofactor triage get latest cofactor triage failures latest --new-only
latestis your most recent suite run.waitstops after 1200 seconds unless you pass--timeout <seconds>. With an API key,triagecommands need a key with the*scope.
Read the diagnosis of one failed run
-
Open the failed run and select Diagnose root cause. When a diagnosis exists, the button reads Jump to root cause, and View analysis while one is running. Cofactor diagnoses a test automatically when it newly fails after passing and when it keeps failing. A test's very first failure is not diagnosed until you ask.
-
Read the category. The diagnosis names a category, with the evidence and a recommendation. To read it from a terminal:
bashcofactor test-suite diagnostics <workflow id> <run id>
-
Decide. Use the category to find who fixes it.
Category What it means Who fixes it Software Bug A clear defect, such as an error page or a failed request. Your app. Work the issue. App Changed The app now behaves differently than the test expects. You decide. If the change was intended, update the test. If not, it is a regression. Agent Confusion The test agent misread the page or took a path no user would. When the run failed only on assertions, the diagnosis corrects the run to a pass. The test. Make its steps clearer. Test Underspecified The test does not say enough about what success looks like. The test. Add assertions. Data Collision Test data clashed with other data. The test data. Dependency Issue Something the test relies on let it down. The dependency, or its data. Platform Error A problem on the Cofactor side. Run it again, and contact us if it repeats. Test Bug The code of your own test is wrong. Your test code. Agent Confusion and Test Underspecified apply to tests written in Cofactor. Test Bug applies only to your own suites.
Tell a flaky test from a real failure
When a diagnosis is unsure, it can add one confirming rerun of the failed test to the suite. Otherwise flakiness shows up across runs. A test is Flaky when its latest run passed, one of its last ten runs failed, and it has not passed five times in a row since.
- A test that passes when you run it again points to a flaky test or a timing problem. To make the test steadier, see End-to-end tests.
- A missing seed, an expired login or the wrong environment is a setup problem. Fix the setup and run again. Do not file an issue.
- A change from green to red is a strong sign of a regression only when the test passed steadily before.
- A test in a suite that has passed before and then fails five runs in a row is Degraded. Suites skip it until you edit it, or select Re-enable degraded flows when you start a suite run.
Check it worked
For each failed test, you can say its category, the evidence for it and the fix. For a real bug, the issue exists and holds the evidence. See Issues. For a false alarm, you closed the issue as not a bug and gave a reason.
cofactor issues list --status open
Go deeper
- Issues covers what Cofactor files and how to close it.
- Reports covers getting the verdict in Slack or email.
- Release gates covers blocking a merge.
- Reference: Runs, Test runs
Let your coding agent dig in, and the CLI debug commands.
Install the debugging skill, then give your coding agent a run id or a run URL.
cofactor skill install cofactor-debug-run
The debug commands each read one part of what a run recorded. --slow sorts the steps slowest first, --grep filters the agent's thoughts by text, and --misses-only shows only the cache misses.
cofactor workflow debug overview <run id> cofactor workflow debug steps <run id> --slow cofactor workflow debug thoughts <run id> --grep "delete" cofactor workflow debug cache <run id> --misses-only
If a diagnosis could not finish, the issue's Diagnostics tab shows Re-run Analysis.