Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Deleting 500 tests made the suite stronger

说明与用途

删除500个测试使测试套件更强大,变得更集中、更快,并引入并行执行和安全钩子来标记无意义的测试。

问题

A large number of tests in the workkit project were failing for reasons that did not reflect real behaviour, creating noise and slowing down the test suite.

结果

The test suite was trimmed from ~500 tests to a smaller, more focused set, improving reliability and reducing execution time. Parallel execution and safety hooks further enhanced test quality.

工作流

  • 1. Run npm test to execute all suites sequentially.
  • 2. Introduce parallel runner in version 0.81 to run each suite in its own worker process.
  • 3. Audit each test to determine if a failure indicates real behaviour change.
  • 4. Remove or rewrite tests that fail for mock or implementation details.
  • 5. Add safety:test-bar hook to flag padding tests at write time.
  • 6. Update commit gate to run npm test on staged files only.
  • 7. Verify suite runs with reduced test count and parallel execution.

证据

About 450 cases said no. They asserted that a mock was called, that a file existed after a write, that a framework did what its docs promise.

来源

The kit's npm test used to run every suite in one process, one after another. Version 0.81 gave it a parallel runner: each suite runs in its own worker process, with cores minus one running at once.

来源

The safety:test-bar hook fires when a test file is written. It names each line that misses the bar: an assertion on an implementation detail, a mock of something the test could run for real, a test with no failure condition.

来源

  • 记录日期: 2026-11-02T06:58:56.711Z