forked from mtusi2026/mtusi2026lab5
49 lines
1.7 KiB
Makefile
49 lines
1.7 KiB
Makefile
LOAD_ARGS = $(if $(LOAD_WORKERS),-workers=$(LOAD_WORKERS),) \
|
|
$(if $(LOAD_DURATION),-duration=$(LOAD_DURATION),) \
|
|
$(if $(LOAD_RATE),-rate=$(LOAD_RATE),) \
|
|
$(if $(LOAD_CSV),-csv=$(LOAD_CSV),) \
|
|
$(if $(LOAD_LABEL),-label=$(LOAD_LABEL),)
|
|
REPLICA ?= 1
|
|
ACTION ?= stop-one.sh
|
|
ACTION_AT ?= 10s
|
|
DRY_RUN ?= true
|
|
|
|
.PHONY: help-go contract-go race-go load-go failure-go load-action-go reconcile reconcile-test-go worker-go
|
|
|
|
help-go:
|
|
@echo "contract-go: contract tests"
|
|
@echo "worker-go: worker persistence, duplicate and bounded retry (stops shared services)"
|
|
@echo "race-go: concurrency tests (-race)"
|
|
@echo "load-go: load test"
|
|
@echo "failure-go: dependency failure tests (stops redis/postgres/s3 containers)"
|
|
@echo "reconcile: attachment audit; DRY_RUN=false to repair"
|
|
|
|
contract-go:
|
|
go test -tags=contract ./student-tests/... -v -args -base-url=$(BASE_URL)
|
|
|
|
race-go:
|
|
go test -tags=race ./student-tests/... -race -v -args -base-url=$(BASE_URL)
|
|
|
|
load-go:
|
|
go test -count=1 -tags=load ./student-tests/... -v -args -base-url=$(BASE_URL) $(LOAD_ARGS)
|
|
|
|
failure-go:
|
|
go test -tags=failure ./student-tests/... -v -args -base-url=$(BASE_URL)
|
|
|
|
load-action-go:
|
|
go test -tags=load,action ./student-tests/... -run TestLoadWithAction -v -args \
|
|
-base-url=$(BASE_URL) $(LOAD_ARGS) \
|
|
-replica=$(REPLICA) \
|
|
-action=$(CURDIR)/scripts/$(ACTION) \
|
|
-action-at=$(ACTION_AT)
|
|
|
|
reconcile:
|
|
docker compose --env-file .env run --rm --no-deps reconcile -dry-run=$(DRY_RUN)
|
|
|
|
reconcile-test-go:
|
|
docker compose --env-file .env build reconcile
|
|
go test -count=1 -tags=reconcile ./student-tests/... -v -args -base-url=$(BASE_URL)
|
|
|
|
worker-go:
|
|
go test -count=1 -tags=worker ./student-tests/... -v -args -base-url=$(BASE_URL)
|