regression-test

Write and run red-to-green regression tests for bugs in Go Kubernetes operators.

4|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/simplyblock/simplyblock-operator --skill regression-test-simplyblock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regression-test
Source: https://github.com/simplyblock/simplyblock-operator/tree/main/.claude/skills/regression-test
Command: npx skills add https://github.com/simplyblock/simplyblock-operator --skill regression-test-simplyblock

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes without a failing-first test prove nothing: a test written after the fix may assert nothing, and an unmarked regression test gets deleted later as redundant. This Skill enforces a disciplined red-to-green workflow so every bug fix is pinned by a behavioral test that demonstrably fails before the fix and passes after. ## Core Features & Use Cases - Mandatory test-first workflow: Reproduce the bug, write the failing test with a Regression: marker, confirm it fails for the right reason on the unfixed tree, then write the fix and verify green. - Behavioral assertion rules: Assert observable behavior (status fields, phase transitions, events, endpoint call counts) rather than the shape of the fix, with explicit valid and invalid examples. - Test-level selection guidance: Choose between Go unit tests with fake clients and mock HTTP control planes, envtest suites, CSI e2e (ginkgo), or live-cluster verification, preferring the lowest level that can fail for the bug's reason. - Use Case: After fixing a volume-migration bug where NVMe paths leaked, write TestReleasePathsWhenMigrationNeverCutOver with a Regression: #444 marker, run it against the unfixed tree to confirm red, apply the fix, then add the row to the test plan matrix. ## Quick Start Ask the AI to write a regression test for the bug you are about to fix, following the red-to-green workflow before writing any fix code.

Frequently Asked Questions about regression-test

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

FAQPage Schema
How do I write a regression test for a bug fix in Go?

Write the failing test first with a Regression marker in its doc comment, run it against the unfixed tree to confirm it fails for the bug's reason, then write the fix and confirm it passes. Assert observable behavior like status fields or endpoint call counts, never the shape of the fix.

What test level should I use for a Kubernetes reconciler bug?

Use a Go unit test with a fake client and an httptest mock control plane for single-reconciler decisions like sub-phase advances or requeues. Use envtest for real API server interactions like webhooks and finalizers, and reserve live clusters for data-path bugs involving SPDK or real NVMe.

Why must a regression test fail before the fix is written?

A test written after the fix only proves the code passes its author's expectations and may assert nothing. Running it red first against the unfixed tree demonstrates the test can actually catch the bug and fails for the right reason, not a compile error or missing fake route.

How do I run operator tests with the race detector enabled?

Run go test -race ./internal/... explicitly, since the operator suite does not enable -race by default unlike atlas-lib and csi-driver. A concurrency regression test that never runs under -race is not a valid regression test.

What should I do when a bug cannot be reproduced outside a live cluster?

Test the nearest observable contract, such as counting freeze-inducing calls against a mock control plane, and document the live-cluster scenario as a numbered row in the test plan. State plainly in the commit message what was verified, how, and at what sample size.