test-discipline

Update tests in sync with API changes to prevent CI failures.

619|188|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/CommunityToolkit/Aspire --skill test-discipline-communitytoolkit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/CommunityToolkit/Aspire/tree/main/examples/squad/CommunityToolkit.Aspire.Hosting.Squad.AppHost/dev-squad/.copilot/skills/test-discipline
Command: npx skills add https://github.com/CommunityToolkit/Aspire --skill test-discipline-communitytoolkit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures that tests are updated in sync with API changes, preventing CI breaks and maintaining test integrity.

Core Features & Use Cases

  • API Change Tracking: Updates tests when APIs or public interfaces change.
  • Test Assertion Synchronization: Ensures test assertions match the actual files on disk.
  • CI Break Prevention: Avoids CI failures due to stale tests.
  • Use Case: When a public API is updated, this Skill automatically updates the corresponding tests to reflect the changes, ensuring that the tests remain accurate and CI runs smoothly.

Quick Start

Run the test-discipline skill to update tests when changing APIs.

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 to prevent CI failures?

To prevent CI failures, you can keep tests in sync with API changes by running the test-discipline skill. It monitors API modifications and automatically updates corresponding test assertions to match the actual files on disk.

Why do stale tests cause CI breaks after public interface updates?

Stale tests cause CI breaks because test assertions no longer match the updated public API or file system state. Synchronizing test assertions ensures they accurately reflect new API modifications and prevents unexpected pipeline failures.

When do I need to update test assertions to match the file system state?

You need to update test assertions to match the file system state whenever a public API is modified. This ensures that your software development workflow maintains test integrity and avoids running outdated assertions.

Does this approach work for tracking API changes without external dependencies?

Yes, tracking API changes works without external dependencies. The skill operates independently using scripts to monitor public interface modifications and synchronize test updates directly within your existing software engineering workflow.

What's the best way to automatically update tests when APIs change?

The best way to automatically update tests when APIs change is to run the test-discipline skill. It tracks public interface modifications and directly updates corresponding test files to ensure test integrity and prevent CI breaks.

What are the limitations of using scripts for test synchronization?

Using scripts for test synchronization is limited to tracking API changes and updating test assertions on disk. It does not generate new test cases from scratch but ensures existing tests remain accurate when public interfaces are modified.