cmd/httprunner: CLI to execute .http scenarios and produce reports.cmd/harparser: HAR →.httpextractor tool.src/parser,src/runner,src/reporting,src/metrics,src/http,src/template,src/converter: Core Go packages.tests: All.httptest files organized intoe2e/,unit/, andexamples/subdirectories.testapi,docker-compose.yml: Local test services (API + toxiproxy).build/,results/orreports/: Build artifacts and test outputs.
make deps— download/tidy Go modules.make build— buildhttprunnerandharparserintobuild/.make dev— fast local build without version ldflags.make test/make test-coverage— run Go unit tests (all packages).make fmt/make lint/make check— format, lint (if installed), run tests.- E2E:
./run-tests.sh— spins up Docker services and runstests/e2e/comprehensive-test.httpwith reports inreports/. - Docker:
docker compose up --profile runner httprunnerruns the comprehensive suite defined in compose.
- Language: Go 1.x; format with
go fmt(tabs, standard imports). Optional:golangci-lint run. - Packages: short, lowercase (
parser,runner). Files: lowercase with underscores if needed. - Exported identifiers:
CamelCase; unexported:camelCase. Constants:CamelCaseorALL_CAPSonly for true constants. - CLI flags: prefer short
-fplus long forms where applicable; keep help text concise.
- Unit tests:
_test.go, functionsTestXxx(*testing.T). Run withgo test ./.... - E2E: author
.httpfiles undertests/e2e/ortests/unit/. Usetests/examples/for documentation. Prefer environment placeholders (e.g.,{{.token}}) and.envfiles. - Coverage: keep critical packages (parser, runner, reporting) well covered; run
make test-coveragelocally.
- Commits: follow Conventional Commits (
feat:,fix:,test:,chore:, etc.). Keep messages imperative and scoped. - PRs: include purpose, linked issue, usage notes, and sample output. For E2E changes, attach or reference
reports/test-results.htmland logs. - CI/readiness: ensure
make checkpasses andmake buildsucceeds; avoid committing generated artifacts inbuild/orresults/.
- Run
httprunner -f tests/e2e/comprehensive-test.http -u 5 -i 10 -d 50 -report html -output resultslocally. - Convert recordings:
harparser -f recording.har -filter api/v1 -o requests.http.