testing-workflows

matt-riley's avatarfrom matt-riley

Run, debug, and structure tests for this Go project (unit + integration), including generation prerequisites. Use when changing domain logic, repositories, HTTP handlers, or migrations.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 2, 2026

When & Why to Use This Skill

This Claude skill automates and structures testing workflows for Go (Golang) projects, streamlining the execution of unit and integration tests. It enhances developer productivity by managing test prerequisites, handling code generation, and providing standardized debugging paths for domain logic, database repositories, and HTTP handlers.

Use Cases

  • Continuous Integration Support: Automatically run full test suites using 'make test' to ensure code stability before merging changes to domain logic or repositories.
  • Efficient Debugging: Quickly isolate and resolve failing tests with verbose output and automated dependency generation (make generate) when encountering compilation errors.
  • API & Middleware Validation: Verify HTTP handler behavior, including status codes, authentication flows, and schema compliance, through structured integration testing.
  • Database Integrity Checks: Validate repository patterns and database migrations using in-memory SQLite tests to ensure data persistence logic is correct.
  • Refactoring Safety: Use table-driven unit tests to maintain domain validation logic integrity while restructuring core business code.
nametesting-workflows
descriptionRun, debug, and structure tests for this Go project (unit + integration), including generation prerequisites. Use when changing domain logic, repositories, HTTP handlers, or migrations.
licenseMIT
compatibilityRequires bash, git, Go, and make.
repomjrwtf
runnergithub-copilot-cli
version1.3
allowed-toolsBash(git:*) Bash(make:*) Bash(go:*) Read

Tooling assumptions

  • Use a terminal runner with bash and git available.
  • Prefer make targets when available; fall back to direct CLI commands when needed.

Fast paths

  • All tests (runs generation first):
make test
  • Unit tests only:
make test-unit
  • Integration tests only (HTTP server suite):
make test-integration

Debugging failures

  1. If you see compile errors for generated packages, run:
make generate
  1. Re-run the failing package with verbose output:
go test -v ./path/to/pkg
  1. If the failure is DB-related, confirm DATABASE_URL is correct and migrations are applied (for integration setups).

What to cover when adding features

  • Domain validation (table-driven tests).
  • Repository behavior (in-memory SQLite tests).
  • HTTP behavior (status codes + auth + schemas).