PKG ?= ./cert/... ./lb/... ./eks/... ./ecs/... ./iam/... ./ecr/... ./bedrock/... ./multinode/... ./baremetal/... ./reboot/... ./tofu/... ARTIFACT_DIR ?= /tmp/spinifex-e2e-artifacts TIMEOUT ?= 30m MODE ?= single # RUN restricts the run to tests matching a regex, for packages holding several # independent long-running suites. Empty means every test in PKG, so this is a # no-op unless asked for. Needed where one package's tests are not # interchangeable: storagegrowth holds workloads that are each driven with their # own environment and whose assertions are deliberately hostile, so running a # sibling by accident reports a failure that says nothing about the run. RUN ?= # GOTESTSUM=1 emits JUnit XML + JSON streams for CI. Suite tag derives from the # first path component of PKG so per-suite targets get distinct artifact names. GOTESTSUM ?= SUITE_TAG ?= $(notdir $(patsubst %/...,%,$(firstword $(PKG)))) # Pre-built test binaries. `e2e-build` cross-compiles each named suite into # BIN_DIR/.test so CI can ship binaries (not source + go toolchain) to # the remote VM. BIN_DIR ?= $(CURDIR)/_bin SUITES_BUILD ?= cert lb eks ecs single iam ecr bedrock gpu natuplink multinode storagegrowth partialblock rds quota diskperf storagefault instancerecovery lbrecovery kvquorum .PHONY: e2e e2e-quota e2e-cert e2e-lb e2e-eks e2e-ecs e2e-single e2e-iam e2e-ecr e2e-bedrock e2e-multinode e2e-bm e2e-reboot e2e-tofu e2e-gpu e2e-natuplink e2e-storagegrowth e2e-partialblock e2e-diskperf e2e-rds e2e-storagefault e2e-instancerecovery e2e-lbrecovery e2e-kvquorum e2e-all clean e2e-build RUN_FLAG = $(if $(RUN),-run '$(RUN)',) ifeq ($(GOTESTSUM),1) E2E_CMD = gotestsum \ --junitfile $(ARTIFACT_DIR)/junit-$(SUITE_TAG).xml \ --jsonfile $(ARTIFACT_DIR)/gotest-$(SUITE_TAG).json \ --format=testname \ -- -tags=e2e -timeout=$(TIMEOUT) $(RUN_FLAG) $(PKG) else E2E_CMD = go test -tags=e2e -v -timeout=$(TIMEOUT) $(RUN_FLAG) $(PKG) endif e2e: @mkdir -p $(ARTIFACT_DIR) SPINIFEX_E2E=1 \ SPINIFEX_MODE=$(MODE) \ ARTIFACT_DIR=$(ARTIFACT_DIR) \ $(E2E_CMD) e2e-cert: ; $(MAKE) e2e PKG=./cert/... e2e-lb: ; $(MAKE) e2e PKG=./lb/... e2e-eks: ; $(MAKE) e2e PKG=./eks/... e2e-ecs: ; $(MAKE) e2e PKG=./ecs/... e2e-single: ; $(MAKE) e2e PKG=./single/... e2e-iam: ; $(MAKE) e2e PKG=./iam/... e2e-ecr: ; $(MAKE) e2e PKG=./ecr/... e2e-bedrock: ; $(MAKE) e2e PKG=./bedrock/... e2e-multinode: ; $(MAKE) e2e PKG=./multinode/... MODE=multinode e2e-bm: ; $(MAKE) e2e PKG=./baremetal/... MODE=baremetal e2e-reboot: ; $(MAKE) e2e PKG=./reboot/... e2e-tofu: ; $(MAKE) e2e PKG=./tofu/... e2e-gpu: ; $(MAKE) e2e PKG=./gpu/... e2e-natuplink: ; $(MAKE) e2e PKG=./natuplink/... e2e-storagegrowth: ; $(MAKE) e2e PKG=./storagegrowth/... e2e-partialblock: ; $(MAKE) e2e PKG=./partialblock/... # Two 16 GiB fio profiles per repetition, each on a freshly created volume, so # a pass is ~20 minutes on the bare-metal cell. CI resolves the same budget # from e2e_suite_timeout in .github/scripts/suite-sets.sh. e2e-diskperf: ; $(MAKE) e2e PKG=./diskperf/... TIMEOUT=180m # One instance's `available` wait is 23 minutes, so a single wedged create eats # most of a 30m package timeout before the tests still running get to report. e2e-rds: ; $(MAKE) e2e PKG=./rds/... TIMEOUT=45m e2e-quota: ; $(MAKE) e2e PKG=./quota/... # Freezes predastore, so its budget covers a deliberate outage plus the # recovery and re-verification that follow it, twice over for the two tests. e2e-storagefault: ; $(MAKE) e2e PKG=./storagefault/... TIMEOUT=45m # Takes a node away twice and freezes predastore once. Almost all of its budget # is waiting for staleness, a boot and a pause that is measured in minutes. e2e-instancerecovery: ; $(MAKE) e2e PKG=./instancerecovery/... TIMEOUT=60m # Stands a load balancer and its backends up before it breaks anything, then # takes the load balancer's node away and brings it back. e2e-lbrecovery: ; $(MAKE) e2e PKG=./lbrecovery/... TIMEOUT=75m # Audits every KV bucket, then takes a node away and brings it back. Most of its # budget is the node stopping and starting, not the assertions. e2e-kvquorum: ; $(MAKE) e2e PKG=./kvquorum/... MODE=multinode TIMEOUT=40m e2e-all: ; $(MAKE) e2e e2e-build: @mkdir -p $(BIN_DIR) @for s in $(SUITES_BUILD); do \ echo "==> building $$s.test"; \ go test -c -tags=e2e -o $(BIN_DIR)/$$s.test ./$$s/ || exit 1; \ done clean: rm -rf $(ARTIFACT_DIR) $(BIN_DIR)