# bazel-test-hygiene

> Claude/Codex skill by [@cloudflare](https://omgskills.com/library/cloudflare/index.md) · 8.7k stars · Updated 2026-09-11

Mandatory rules for running bazel tests during development. Load this skill before running any bazel test command, especially when validating fixes or verifying regression tests. Prevents false confidence from cached results, filter flags that silently match nothing, and partial test runs that miss breakage.

## Install

```sh
git clone https://github.com/cloudflare/workerd /tmp/workerd && ln -s /tmp/workerd/.opencode/skills/bazel-test-hygiene ~/.claude/skills/bazel-test-hygiene
```

## From README

Bazel Test Hygiene The Three Rules Always disable caching Why: Bazel's action cache can serve stale test binaries even after you edit source files. Without --nocachetestresults, you may be running the OLD binary and seeing OLD results. This is not hypothetical — it has caused real false-positive/false-negative confusion in this repo. Always include --nocachetestresults. No exceptions. Keep it simple — no filter flags Do NOT use --testarg='-f' or similar filter flags to run individual test cases. Why: KJ test's -f flag silently passes when zero tests match. If you typo the filter or the test name changes, bazel reports "PASSED" with zero tests actually run. This gives completely false confidence. Run the full test target. If you need to check a specific test, look for its name in the full output. If the full suite is too slow, run the specific test target (e.g., //src/workerd/api:streams/standard-test@), not a filtered subset within a target.

## Links

- HTML page: https://omgskills.com/skills/cloudflare/workerd/bazel-test-hygiene/
- GitHub: https://github.com/cloudflare/workerd
- Author: [@cloudflare](https://omgskills.com/library/cloudflare/index.md)

## More from this repo

- [commit-categories](https://omgskills.com/skills/cloudflare/workerd/commit-categories/index.md) — Commit categorization rules for changelogs and "what's new" summaries.
   - [@cloudflare](https://omgskills.com/library/cloudflare/index.md) · 8.7k stars
- [dad-jokes](https://omgskills.com/skills/cloudflare/workerd/dad-jokes/index.md) — After completing any task that took more than ~5 tool calls, or after long-running builds/tests finish, load this skill...
   - [@cloudflare](https://omgskills.com/library/cloudflare/index.md) · 8.7k stars
- [find-and-run-tests](https://omgskills.com/skills/cloudflare/workerd/find-and-run-tests/index.md) — How to find, build, and run tests in workerd.
   - [@cloudflare](https://omgskills.com/library/cloudflare/index.md) · 8.7k stars
