stack-testing
/stack-testing
Podpowiada dyscyplinę testów na prawdziwym systemie dla pytest, Go, C++, Django, Spring Boot i FastAPI, także przy e2e w przeglądarce.
- Autor
- krzemienski ↗
- Repozytorium
- proofpunk ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 14.09.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 19
- Skrypty
- 7
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 14.09.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 7 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: examples/condition_based_waiting.ts, examples/console_logging.py, examples/element_discovery.py, examples/static_html_automation.py, scripts/playwright/lib/helpers.js, scripts/playwright/run.js, scripts/with_server.py
Co robi i kiedy
Podpowiada dyscyplinę testów na prawdziwym systemie dla pytest, Go, C++, Django, Spring Boot i FastAPI, także przy e2e w przeglądarce.
Oryginalny opis (EN)
Real-system test discipline per stack — pytest/Go/C++/Django/Spring Boot gotchas that cause flaky CI, FastAPI HTTP/SSE testing with curl Playwright browser automation with server lifecycle management, and condition-based waiting to kill timing flakes. Use when writing debugging, or deflaking test suites in Python, Go, C++, Django, Spring Boot, or FastAPI projects; when tests pass locally but fail in CI; when browser e2e needs a dev server managed; or when any test uses sleep()/arbitrary timeouts. Iron Rule: mocks chapters in references are for understanding existing suites only; new tests run
Jak działa
- Run checklist
- Operating Rules
- Reference Routing
- Browser E2E Quickstart
- Anti-Patterns
- Bundled resources
- Example
- Skill calls
Podgląd SKILL.md
---
name: stack-testing
description: >
Real-system test discipline per stack — pytest/Go/C++/Django/Spring Boot
gotchas that cause flaky CI, FastAPI HTTP/SSE testing with curl
Playwright browser automation with server lifecycle management, and
condition-based waiting to kill timing flakes. Use when writing
debugging, or deflaking test suites in Python, Go, C++, Django, Spring
Boot, or FastAPI projects; when tests pass locally but fail in CI; when
browser e2e needs a dev server managed; or when any test uses
sleep()/arbitrary timeouts. Iron Rule: mocks chapters in references are
for understanding existing suites only; new tests run against the real
system. Not for end-user proof of a finished feature (use
end-user-testing) or single-bug root causes (use root-cause-debugging).
---
# Stack Testing
## Run checklist
Copy this checklist and track your progress:
- [ ] Identify the stack and read its chapter in references
- [ ] Write the test against the REAL system (no new mocks)
- [ ] Start required services with lifecycle management
- [ ] Replace sleeps with condition-based waiting
- [ ] Run repeatedly to confirm no flakes (CI parity)
Test against the REAL system, per stack. This skill bundles the field-tested
"what goes wrong" knowledge for each major test stack and the browser-e2e
helpers, under one discipline: no mocks for new tests, no arbitrary sleeps
evidence for every green claim.
## Operating Rules
1. **Iron Rule applies to tests too** — per `../../references/end-user-actor.md`
and the evidence contract at `../../references/evidence-contract.md`: a green
test run you did not personally execute is UNVERIFIED. Never claim "tests
pass" from reading code.
2. **No new mocks/stubs/test doubles.** Several references below document mock
frameworks (GoogleMock, MockMvc, factory patterns) — those chapters exist to
help you READ and FIX existing suites. New tests you write hit the real
database, real server, real browser. Testcontainers-style real services in
Docker are the gold pattern (see `references/springboot-testing-gotchas.md`).
3. **No `sleep()` in tests.** Replace every arbitrary timeout with condition
polling — `references/condition-based-waiting.md` is the canonical pattern
with `examples/condition_based_waiting.ts`.
4. **Flaky = bug.** A test that "sometimes passes" is a defect in the test or
the system, never a reason to re-run CI until green. Diagnose per stack
below; escalate to the `root-cause-debugging` skill when the cause is unclear.
5. **Test output is REGRESSION evidence, never VALIDATION evidence.** Pipe the
final run to a file and seal it with the `end-user-testing` skill's
`fresh_evidence.py` — labeled REGRESSION ("the suite is green"). The
feature-level verdict comes only from driving the live system as the end
user (the shared runbooks (`../../references/*-validation.md`): `curl` for JSON backends, browser for UI
simulator for mobile). A green suite cited as proof a feature works is a
doctrine violation — see `../../references/end-user-actor.md`.
## Reference Routing
| Situation | Read |
|---|---|
| pytest fixture/parametrize/async/coverage weirdness | `references/pytest-gotchas.md` |
| Go `t.Parallel()` races, TestMain, benchmarks, test cache | `references/go-testing-gotchas.md` |
| C++ GoogleTest/CTest, sanitizers, coverage, fuzzing | `references/cpp-testing-gtest.md` |
| Django TestCase vs TransactionTestCase, factory_boy, DRF | `references/django-testing-gotchas.md` |
| Spring Boot Testcontainers, context cache, @Transactional | `references/springboot-testing-gotchas.md` |
| FastAPI/OpenAI-compatible HTTP + SSE endpoints via curl | `references/fastapi-backend-testing.md` |
| Local web app e2e with dev-server lifecycle (Python Playwright) | `references/webapp-testing.md` + run `scripts/with_server.py` |
| Full browser automation (multi-viewport, forms, link checks) | `references/playwright-browser-automation.md` + import/read `scripts/playwright/` helpers |
| Any timing flake, race, "works on my machine" | `references/condition-based-waiting.md` |
## Browser E2E Quickstart
```bash
# single dev server + Playwright script, lifecycle managed
python3 scripts/with_server.py --server "npm run dev" --port 5173 \
-- python3 your_check.py
# richer automation: universal Playwright runner (requires npm i playwright)
cd scripts/playwright && npm install && node run.js --help
```
`examples/` holds reconnaissance-then-action, console-logging, and static-HTML
patterns from the source skills.
## Anti-Patterns
- Writing a mock to "unblock" a failing real dependency → fix the real system.
- Re-running CI to make a flake disappear → diagnose with the stack reference.
- Asserting "tests pass" from a stale terminal scrollback → fresh evidence run.
- Copying fixture patterns between stacks → scoping rules differ per framework;
read the matching gotchas file FIRST.
## Bundled resources
- `scripts/playwright/lib/helpers.js` — server lifecycle + condition-based waiting helpers; read as reference or import from Playwright specs.
- `scripts/playwright/package.json` — dependency manifest for the helpers.
- `references/playwright-api-reference.md` — full Playwright API reference; grep it when a specific API is needed, do not read end-to-end.
## Example
**Input:** User: 'This FastAPI SSE test flakes in CI.'
**Output:** The mock-based test is rewritten to run against the real server with curl, sleep(2) replaced by a condition-based wait on the stream, 20 consecutive CI-parity runs pass.
## Skill calls
| Calls | When | What it hands over |
|-------|------|--------------------|
| `root-cause-debugging` | flakes that survive condition-based waiting | root cause, never a retry |
Called by: `production-readiness`, `proofpunk`.
Pliki w paczce (19)
- SKILL.md 6 KB
- examples/condition_based_waiting.ts 5 KB
- examples/console_logging.py 1 KB
- examples/element_discovery.py 1 KB
- examples/static_html_automation.py 1 KB
- references/condition-based-waiting.md 5 KB
- references/cpp-testing-gtest.md 11 KB
- references/django-testing-gotchas.md 7 KB
- references/fastapi-backend-testing.md 4 KB
- references/go-testing-gotchas.md 6 KB
- references/playwright-api-reference.md 16 KB
- references/playwright-browser-automation.md 15 KB
- references/pytest-gotchas.md 5 KB
- references/springboot-testing-gotchas.md 7 KB
- references/webapp-testing.md 5 KB
- scripts/with_server.py 4 KB
- scripts/playwright/package.json 1 KB
- scripts/playwright/run.js 6 KB
- scripts/playwright/lib/helpers.js 12 KB
Wersje
W bazie nie ma innych skilli o nazwie stack-testing.
Migawka bazy z 13.11.2026 · wersja paczki 7749ecdabc1b (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100generating-tests-from-code
Analizuje istniejący kod API (Express, NestJS, Spring Boot, FastAPI, Django) i na podstawie tras, kontrolerów i middleware generuje skrypty testów obciążeniowych k6. - 100django-dev-test
Pomaga pisać testy aplikacji Django w pytest-django z factory_boy do generowania danych testowych, w tym fixtures i pokrycie testami. - 100spring-boot-testing
Pisze testy jednostkowe, integracyjne i slice dla aplikacji Spring Boot 3. - 100spring-testing-browser
Testuje interfejsy webowe Spring Boot w przeglądarce: HtmlUnit, Selenium, formularze, kliknięcia i logowanie. - 95django-tdd
Prowadzi testy Django przez pytest-django, TDD, factory_boy, mocki i pokrycie, także dla API w DRF. - 95pytest-django
Obsługuje testy integracyjne Django w pytest-django: fixtures db, client i settings, DRF APIClient, factory_boy, widoki async, sygnały, komendy zarządzania i testy wielu baz.