---
title: "Run the tests yourself and read 90 days of · Agent Wranglers"
url: https://agentwranglers.se/playbook/due-diligence/code-and-ownership/tests-and-ci-health
id: TDD-17
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1085
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Run the tests yourself and read 90 days of pipeline history

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Code and ownership](https://agentwranglers.se/playbook/due-diligence/code-and-ownership.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: TDD-17
- Level: Recommended
- Chapter: [Code and ownership](https://agentwranglers.se/playbook/due-diligence/code-and-ownership.md)
- Rule: Run the full test suite on a clean checkout and record the pass rate and line and branch coverage of the critical paths. From the last 90 days of pipeline runs, record the failure rate, the flaky rate and the median duration.
- Check: The report gives the test count, pass rate, skipped count, coverage per critical path, and the 90-day failure rate, flaky rate and median duration. Each number names the commit or the date range it came from.
- How: A green badge on the README says little. The suite may skip half its tests, or the team may rerun failures until they pass. Run the suite yourself, on the build from [Build the product from the company's own repository](https://agentwranglers.se/playbook/due-diligence/code-and-ownership/build-from-own-repository.md). Measure coverage per critical path, such as sign-in, payments and data export, not one number for the whole repository. Export the pipeline runs for the main branch. A flaky test is one that failed and then passed on the same commit. Compare what you find with [Treat coverage as a floor](https://agentwranglers.se/playbook/testing/test-quality/coverage-floor.md) and [Quarantine flaky tests with an owner](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/quarantine-flaky-tests.md). Record the count of skipped and disabled tests too.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Python example

```python
from statistics import median

def ci_health(runs: list[dict]) -> dict:
    by_commit: dict[str, set[str]] = {}
    for run in runs:
        by_commit.setdefault(run["commit"], set()).add(run["result"])
    flaky = sum(1 for results in by_commit.values() if {"failure", "success"} <= results)
    failed = sum(1 for run in runs if run["result"] == "failure")
    return {
        "failure_rate": failed / len(runs),
        "flaky_commit_rate": flaky / len(by_commit),
        "median_minutes": median(run["minutes"] for run in runs),
    }
```

### JavaScript example

```js
function ciHealth(runs) {
  const byCommit = new Map()
  for (const run of runs) byCommit.set(run.commit, (byCommit.get(run.commit) ?? new Set()).add(run.result))
  const flaky = [...byCommit.values()].filter(results => results.has('failure') && results.has('success')).length
  const minutes = runs.map(run => run.minutes).sort((a, b) => a - b)
  return {
    failureRate: runs.filter(run => run.result === 'failure').length / runs.length,
    flakyCommitRate: flaky / byCommit.size,
    medianMinutes: minutes[Math.floor(minutes.length / 2)],
  }
}
```

## Related rules

- TDD-4 [Build the product from the company's own repository](https://agentwranglers.se/playbook/due-diligence/code-and-ownership/build-from-own-repository.md) in Technical due diligence
- TST-32 [Treat coverage as a floor](https://agentwranglers.se/playbook/testing/test-quality/coverage-floor.md) in Testing
- TST-28 [Quarantine flaky tests with an owner](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/quarantine-flaky-tests.md) in Testing

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/due-diligence/code-and-ownership/tests-and-ci-health">Agent Wranglers technical due diligence playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Check how the team reviews AI-written code](https://agentwranglers.se/playbook/due-diligence/code-and-ownership/ai-review-practice.md)
- [Code and ownership](https://agentwranglers.se/playbook/due-diligence/code-and-ownership.md)
