goga-tool-pybuggy¶
pybuggy is a goga(https://github.com/qarium/goga) tool for testing: API —
it turns OpenAPI/Swagger specifications into ready-made pytest fixtures — HTTP client,
endpoint fixtures, response schemas, per-endpoint meta.json input contracts (query
parameters, request body, URL variables) — and wires everything into the consumer's test
suite; Sandbox — session-scoped isolated service testing driven by a sandbox document
at .goga/tools/pybuggy/sandbox.yml and the product sandbox pytest fixture; Web —
browser UI tests written as plain step sentences, turned into Playwright code by an LLM
once and replayed from a committed cache LLM-free, driven by a web document at
.goga/tools/pybuggy/web.yml and the web pytest fixture. The
package contains a pytest plugin and a CLI.
What you get¶
- CLI
goga tool pybuggy— initialize the environment (goga tool pybuggy init), pull specs from git (goga tool pybuggy endpoint pull), inspect endpoints (list,info), scaffold fixtures (goga tool pybuggy endpoint generate— response schemas, a per-endpointmeta.jsoninput contract, andapi.pyfixtures) and report drift between the specs and those artifacts (goga tool pybuggy endpoint diff— read-only, one JSON document per endpoint,{}when they match). - pytest plugin — a function-scoped
apifixture (an HTTP client built from configuration), automatic recursive loading of the generated endpoint fixtures, CLI options for the test run, and flaky-rerun wiring. - Assert layer —
Expect(response-level dispatcher) andAssertField(field-level asserts) on top of the matchcrest matcher library. - Test lifecycle pipelines — staged goga pipelines that automate the suite end to
end:
api.automate(requirements → testcases → test cells → design → plan → acceptance) creates the tests,api.patchchanges existing tests on request, andapi.fixrepairs them when they break; theweb.automate,web.fix, andweb.patchpipelines carry the same lifecycle for browser UI tests. - Topic statuses — the automate, fix, and patch chains mark
pybuggy.*statuses on the goga topic status scale, one status per artifact and only where no builtin already marks the artifact (the fix line is one pipeline-neutral line shared byapi.fixandweb.fix):goga history statusshows the latest reached stage of each line. - Sandbox — session-scoped isolated service testing: a sandbox document at
.goga/tools/pybuggy/sandbox.ymlprovides the productsandboxpytest fixture; the first test that uses it starts the instance under test plus mocked dependencies (postgresql, kafka, vault, http, redis) in containers and wires them into the service env; a test binds its api to the sandbox explicitly viaendpoint.bind(sandbox); the DB schema is declared as goose-format SQL migrations applied once per session and kept across per-test resets; per-test resets and data presets are product-owned, keeping tests order-independent. Requires a docker-compatible container runtime (see Sandbox). - Web — browser UI tests as step sentences: a web document at
.goga/tools/pybuggy/web.ymlprovides thewebpytest fixture; eachweb.step("Open https://…")sentence becomes Playwright code through an LLM once, is cached next to the test, and replays LLM-free (--strict-modefor CI);web.expect(...)polls assertions,web.group(...)frames mini-scenarios, and Allure reports steps, groups, and failure screenshots (see Web).
Quickstart¶
Three commands in the target project root — the last one selects the test kind:
goga install pybuggy # 1. install pybuggy into the goga environment
goga tool pybuggy init # 2. onboarding session + bootstrap: goga project, tool config, conftest.py
goga pipeline pybuggy:api.automate # 3. run the automated API-test lifecycle
goga pipeline pybuggy:web.automate # … or the web (browser UI) test lifecycle
The pipeline asks for the testing subject (the topic is the current git branch) and
drives the whole chain — requirements,
test cases, test code — until accepted test_*.py suites land in tests/ (see
the api.automate lifecycle and
the web.automate lifecycle; Pipelines
holds the whole picture). The CLI and the manual workflow remain available for
fine-grained control: CLI Reference.
Where to go next¶
- Getting Started — end-to-end walkthrough: the API lifecycle, then its web counterpart.
- Pipelines — the staged automate, fix, and patch pipelines for API and web tests.
- CLI Reference — every command with options and behavior.
- Configuration —
.goga/tools/pybuggy/api.yml. - Sandbox —
.goga/tools/pybuggy/sandbox.ymland the productsandboxfixture for session-scoped service testing. - Web —
.goga/tools/pybuggy/web.ymland thewebfixture for browser UI tests as step sentences. - Matchers — assertions and the matcher catalog.
- Pytest Plugins — enabling, fixtures, options.