test-discipline

Enforce test updates in the same commit as API changes.

7|Updated Oct 24, 2020
One-click install
npx skills add https://github.com/snow-jallen/HomeSpeaker --skill test-discipline-snow-jallen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/snow-jallen/HomeSpeaker/tree/main/.copilot/skills/test-discipline
Command: npx skills add https://github.com/snow-jallen/HomeSpeaker --skill test-discipline-snow-jallen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When APIs or public interfaces change, tests must be updated in the same commit. Stale tests block CI for other contributors.

Core Features & Use Cases

  • API changes → test updates (same commit): If you change a function signature, public interface, or exported API, update the corresponding tests before committing
  • Test assertions → disk reality: When test files contain expected counts (e.g., EXPECTED_FEATURES, EXPECTED_SCENARIOS), they must match the actual files on disk
  • Add files → update assertions: When adding docs pages, features, or any counted resource, update the test assertion array in the same commit
  • CI failures → check assertions first: Before debugging complex failures, verify test assertion arrays match filesystem state

Quick Start

Update tests in the same commit whenever APIs change to keep CI green.

Frequently Asked Questions about test-discipline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep tests in sync with API changes in the same commit?

To keep tests in sync with API changes, you must update corresponding test assertions within the same commit as the code changes. This prevents stale tests from blocking CI pipelines for other contributors.

Why do CI checks fail when test assertion counts don't match the filesystem state?

CI checks fail on assertion mismatches because expected counts in test files, such as EXPECTED_FEATURES, must exactly match the actual files on disk. Verifying test assertion arrays against the filesystem state resolves these failures.

What's the best way to manage test assertions when adding new files to a repository?

When adding new files like docs pages or features, you must update the test assertion array in the same commit. This ensures test assertions reflect disk reality and keeps CI pipelines green for all contributors.

Can I use CI pipeline checks to enforce updating tests alongside public interface changes?

Yes, CI pipeline checks can enforce updating tests alongside public interface changes by failing commits where test files are not updated. This ensures test assertions stay synchronized with the repository state.

Do I need to update test assertions before debugging unexpected CI failures?

Yes, before debugging complex CI failures, you should verify that test assertion arrays match the filesystem state. Mismatches between expected counts and actual files on disk are a common cause of test failures.