integration-testing-http

matt-riley 的头像作者 matt-riley

运行并扩展mjr.wtf的端到端HTTP集成测试(SQLite内存版),涵盖认证、创建/列表/删除、重定向和分析。用于更改处理器、中间件或API合约时使用。

📖 中文导读:运行并扩展mjr.wtf的端到端HTTP集成测试(SQLite内存版),涵盖认证、创建/列表/删除、重定向和分析。用于更改处理器、中间件或API合约时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: integration-testing-http description: Run and extend the end-to-end HTTP integration tests (SQLite in-memory) for mjr.wtf, covering auth, create/list/delete, redirects, and analytics. Use when changing handlers, middleware, or API contracts. license: MIT compatibility: Requires Go, make, and generated code. metadata: repo: mjrwtf runner: github-copilot-cli version: 1.1 allowed-tools: Bash(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.

Run

make test-integration

Targeted runs:

go test -v -run TestE2E ./internal/infrastructure/http/server/
go test -v -run TestAPI ./internal/infrastructure/http/server/

What to update when adding/changing endpoints

  • Add/adjust OpenAPI (openapi.yaml) and validate it.
  • Update integration tests to assert:
    • status codes
    • auth requirements (missing/invalid token)
    • response JSON schema fields
    • redirect behavior and analytics side effects

Reference

See docs-site/src/content/docs/operations/integration-testing.md for the current suite structure and scenarios.