Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,36 @@ RUN_LOCAL := bash scripts/with-local-server.sh
artillery-local:
@echo "Load-testing $(EXAMPLE) on :8080..."
@$(RUN_LOCAL) $(EXAMPLE) 8080 \
env TEST_ENVIRONMENT=local npx artillery run --target http://localhost:8080 \
--config $(TEST_KIT)/configs/load-test.yml $(TEST_KIT)/scenarios/core/load-test.yml
npx artillery run --target http://localhost:8080 \
--config $(TEST_KIT)/configs/load-test.yml \
-o artillery-report-$(basename $(notdir $(EXAMPLE))).json \
$(TEST_KIT)/scenarios/core/load-test.yml

# Opt-in A/B load comparison of two framework examples, diffed by the kit's
# perf-compare over Artillery's own `-o` reports (test-kit >= 0.4.0). Manual
# only — deliberately NOT in `all`/`functional-tests`: two full load runs are
# ~2 GB of S3 egress.
# make perf-compare BASELINE=examples/express-basic.ts CANDIDATE=examples/hono-basic.ts
BASELINE ?= examples/express-basic.ts
CANDIDATE ?= examples/hono-basic.ts

.PHONY: perf-compare
perf-compare:
@echo "Baseline: $(BASELINE) on :8080"
@$(RUN_LOCAL) $(BASELINE) 8080 \
npx artillery run --target http://localhost:8080 \
--config $(TEST_KIT)/configs/load-test.yml \
-o artillery-report-baseline.json \
$(TEST_KIT)/scenarios/core/load-test.yml
@echo "Candidate: $(CANDIDATE) on :8081"
@$(RUN_LOCAL) $(CANDIDATE) 8081 \
npx artillery run --target http://localhost:8081 \
--config $(TEST_KIT)/configs/load-test.yml \
-o artillery-report-candidate.json \
$(TEST_KIT)/scenarios/core/load-test.yml
@npx s3-website-perf-compare compare \
--baseline artillery-report-baseline.json --baseline-label $(basename $(notdir $(BASELINE))) \
--candidate artillery-report-candidate.json --candidate-label $(basename $(notdir $(CANDIDATE)))

# Conformance gate: assert the HTTP contract (status, content-type,
# content-length) with the test kit's `expect`-enabled config. Unlike the load
Expand Down
9 changes: 8 additions & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,17 @@ Run the kit against a `tsx` example server on your local `src/` (no build, no
Docker image):

```bash
make artillery-local # load test
make artillery-local # load test (writes artillery-report-<example>.json)
make conformance-local # HTTP-contract gate
```

A/B load comparison between two framework examples (opt-in; two load runs are
~2 GB of S3 egress, so it is not part of `make all`):

```bash
make perf-compare BASELINE=examples/express-basic.ts CANDIDATE=examples/hono-basic.ts
```

### Container image testing

The published container image is built and load/conformance-tested in
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@aws-sdk/client-s3": "^3.832.0",
"@biomejs/biome": "^2.0.4",
"@forkzero/s3-website-test-kit": "^0.2.1",
"@forkzero/s3-website-test-kit": "^0.4.0",
"@hono/node-server": "^2.0.0",
"@types/debug": "^4.1.12",
"@types/express": "^5.0.3",
Expand Down
Loading