Skip to content

feat(FR-001): implement Core Engine#1

Merged
andhijeannot merged 2 commits into
mainfrom
001-core-engine
Jun 20, 2026
Merged

feat(FR-001): implement Core Engine#1
andhijeannot merged 2 commits into
mainfrom
001-core-engine

Conversation

@andhijeannot

Copy link
Copy Markdown
Member

What

Implements Feature Requirement FR-001: Core Engine for the `htload` load-testing tool.

Includes

  • Engine types (`pkg/engine/types.go`): Scenario, Phase, Step, Result, StepContext, BodySource, RateProfile, Ramp, Assertion, Capture
  • Driver interface (`pkg/engine/driver.go`): Name, Execute, Close — protocol-agnostic contract
  • Reporter interface (`pkg/engine/reporter.go`): Full lifecycle event callbacks
  • HTTP driver (`pkg/http/driver.go`): GET/POST/PUT/DELETE/PATCH/HEAD/OPTIONS with status-code assertions, template interpolation for path/body/headers, file body support
  • Runner (`pkg/engine/runner.go`): Multi-phase VU orchestration, panic recovery, fail-fast loop termination, setup/teardown execution
  • ConsoleReporter (`pkg/reporter/console.go`): `log/slog`-based JSON output with ✓/✗ markers, phase/scenario summaries
  • Template funcmap (`internal/template/interpolate.go`): UUID, RandomString, Timestamp, VU.ID, VU.Iteration, Env, Vars
  • Metrics aggregation (`internal/metrics/metrics.go`): Percentile, Mean, Min, Max, Median

Quality Gates

Gate Result
Tests pass ✓ `go test ./...`
Race clean ✓ `go test -race ./...`
Lint clean ✓ `golangci-lint run ./...` — 0 issues
gofumpt ✓ formatted
Coverage engine 83.7%, http 95.7%, reporter 100%, template 84.6%, metrics 91.5%
Import boundary ✓ `pkg/engine` has zero `net/http` imports

Bug fixed

  • `resolveBody` now interpolates `Inline` and `File` sources (previously only `Template`)

@andhijeannot andhijeannot added the enhancement New feature or request label Jun 20, 2026
- Define engine types (Scenario, Phase, Step, Result, StepContext, etc.)
- Implement HTTP driver with template interpolation for path, body, headers
- Implement Runner with VU orchestration, panic recovery, fail-fast
- Implement ConsoleReporter with log/slog lifecycle events
- Add template funcmap (UUID, RandomString, Timestamp, VU vars, Env)
- Add metrics aggregation (Percentile, Mean, Min, Max, Median)
- Full test coverage: engine 83.7%, http 95.7%, reporter 100%
- Race-clean, lint-clean, gofumpt formatted
- Import boundary enforced: pkg/engine has zero net/http deps
@andhijeannot
andhijeannot merged commit 874744f into main Jun 20, 2026
4 checks passed
@andhijeannot
andhijeannot deleted the 001-core-engine branch June 20, 2026 04:35
@andhijeannot
andhijeannot restored the 001-core-engine branch June 20, 2026 04:37
@andhijeannot
andhijeannot deleted the 001-core-engine branch June 20, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant