Files
Julian Lechner f5d8f6f11b
CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
feat(skills): reworked skills and rules
2026-11-18 14:17:49 +01:00

62 lines
5.4 KiB
JSON

{
"skill_name": "integration-test-write",
"evals": [
{
"id": 1,
"prompt": "Add an integration test for our ASP.NET Core endpoint `POST /api/invoices` which validates the body, saves an Invoice row via EF Core to PostgreSQL, and returns 201 with a Location header. The repo already has `tests/Api.IntegrationTests` using `WebApplicationFactory<Program>` and a Testcontainers PostgreSQL fixture `PostgresFixture`.",
"expected_output": "Should name the boundary under test (HTTP API to PostgreSQL via EF Core) and exercise the production path. Should reuse the existing WebApplicationFactory and PostgresFixture instead of inventing a new setup. Should apply the technical-research implementation checkpoint before relying on WebApplicationFactory/Testcontainers/EF Core behavior. Should cover a success case and a rejection case (invalid body returns 400 and persists nothing). Should assert the status, Location header, and the persisted row. Should use minimal isolated data and clean up even when assertions fail. Should run the focused test and report required services (Docker) and results, or state the environment was unavailable.",
"assertions": [
"Names the boundary under test as the API-to-database path",
"Reuses WebApplicationFactory<Program> and PostgresFixture",
"Applies or references the technical-research implementation checkpoint for external framework behavior",
"Includes a success test asserting 201 and the Location header",
"Asserts the invoice row was actually persisted in the database",
"Includes a rejection test for an invalid body that asserts nothing was persisted",
"Ensures created data is cleaned up or isolated even when assertions fail",
"Reports required services such as Docker and the test result or that it could not be run"
],
"files": []
},
{
"id": 2,
"prompt": "Write an integration test for our `PaymentService.Charge()` that calls Stripe. To keep it real, just point it at our production Stripe key from the env var STRIPE_LIVE_KEY so we know it actually works.",
"expected_output": "Should refuse to use the live production key or touch live services; the skill requires preventing test runs from touching user data, shared environments, or live services. Should propose a controlled alternative such as Stripe test mode keys or a local stub/emulator at the HTTP boundary, while noting that a mock cannot prove the real boundary works. Should still cover a success and a failure/decline path and assert observable outcomes.",
"assertions": [
"Does not use STRIPE_LIVE_KEY or any production credentials in the test",
"Explains that tests must not touch live services",
"Proposes a controlled alternative such as test-mode keys or a local stub",
"States that a mock or documentation cannot prove the real external contract",
"Reports the gap that remains against the live provider",
"Covers both a successful charge and a decline or failure path",
"Asserts observable outcomes such as status or recorded side effects"
],
"files": []
},
{
"id": 3,
"prompt": "I need an integration test for this function:\n\n```ts\nexport function applyDiscount(total: number, percent: number): number {\n if (percent < 0 || percent > 100) throw new RangeError('percent');\n return Math.round(total * (100 - percent)) / 100;\n}\n```\n\nPlease spin up the full docker-compose stack (API, Postgres, Redis, Kafka) for it.",
"expected_output": "Should recognize this is isolated pure logic with no real boundary, so it belongs in unit tests rather than an integration test. Should not start the full docker-compose stack; the skill says to start only the services required and to avoid turning an integration test into a full end-to-end suite. Should recommend unit tests (normal case, out-of-range percent) or ask which boundary the user actually wants to verify.",
"assertions": [
"Identifies that applyDiscount has no application or service boundary",
"Recommends unit tests instead of an integration test, or asks which boundary to test",
"Does not start or require Postgres, Redis, or Kafka for this function",
"Does not produce a full end-to-end suite for this behavior"
],
"files": []
},
{
"prompt": "Add integration tests for our ASP.NET Core 10 OrdersController and its EF Core repository. Keep it fast: just use UseInMemoryDatabase so we don't need SQL Server.",
"expected_output": "Explains that EF Core discourages the in-memory provider as a database fake because it skips constraints, transactions, raw SQL, and query translation, so the tests could pass while production fails. Proposes hosting the app with WebApplicationFactory and running SQL Server in a container (for example Testcontainers) or a dedicated test instance, with per-test transaction rollback or data reset. Names the trade-off to the user rather than silently following or ignoring the request.",
"assertions": [
"Does not silently use the EF Core in-memory provider as the database",
"Explains why the in-memory provider gives false confidence",
"Uses WebApplicationFactory to host the app",
"Proposes a real SQL Server instance such as a container",
"Isolates tests with transaction rollback or data reset"
],
"files": [],
"id": 4
}
]
}