diff --git a/Makefile b/Makefile index c7d0a29..b72bb19 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CHAINSAW ?= chainsaw TEST_DIR := tests -VALUES ?= infra/kind/values-basic-go.yaml +VALUES ?= ASSERT_TIMEOUT ?= 15m CHAINSAW_EXTRA_FLAGS ?= @@ -23,7 +23,7 @@ help: ## Show available targets @echo "test framework targets:" @echo "" @echo " tests:" - @echo " * values via VALUES (default infra/kind/values-basic-go.yaml)" + @echo " * values via VALUES (required; e.g. VALUES=../metal-lab/values-containerlab-node1.yaml)" @echo " * assert timeout via ASSERT_TIMEOUT (default 15m; e.g. ASSERT_TIMEOUT=5m)" @echo " * extra chainsaw flags via CHAINSAW_EXTRA_FLAGS (e.g. CHAINSAW_EXTRA_FLAGS=\"--skip-delete -v\")" @echo "" @@ -39,10 +39,19 @@ help: ## Show available targets @echo " test/09-persistent-boot-order (persistent boot order)" @echo "" +.PHONY: require-values +require-values: + @test -n "$(VALUES)" || { \ + echo "VALUES is not set. Pass a chainsaw values file, e.g."; \ + echo " make $(MAKECMDGOALS) VALUES=/path/to/values.yaml"; \ + echo "See README.md for the expected contents."; \ + exit 1; \ + } + .PHONY: test $(addprefix test/,$(TESTS)) -test: ## Run every test +test: require-values ## Run every test $(CHAINSAW_RUN) $(addprefix $(TEST_DIR)/,$(TESTS)) -$(addprefix test/,$(TESTS)): test/%: ## Run a single test +$(addprefix test/,$(TESTS)): test/%: require-values ## Run a single test $(CHAINSAW_RUN) $(TEST_DIR)/$* diff --git a/README.md b/README.md index 8e98f7c..26bc323 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ The `tests` directory contains a suite of tests based on [chainsaw](https://kyve * A metal-operator installation and BMC to run tests against. This repository usually uses the locally virtualised [metal-lab](https://github.com/simontesar/metal-lab) to develop or verify functionality of the actual tests. You can use the lab setup as a reference. ### Usage -The server to run a test against is configured by passing a values file to chainsaw. The default file is `infra/kind/values-basic-go.yaml` which points to a Redfish mock setup in the [`kind` environment](environments.md) and should be overridden via `VALUES`. +The server to run a test against is configured by passing a values file to chainsaw via `VALUES`. There is no default, tests fail unless `VALUES` is set. To just see the suite run, use `infra/kind/values-basic-go.yaml`, which points to a Redfish mock setup in the [`kind` environment](environments.md). ```bash # Examples -make test # Run all tests -make test/01-bmc-registration # Run a specific test +make test VALUES=infra/kind/values-basic-go.yaml # Run all tests +make test/01-bmc-registration VALUES=infra/kind/values-basic-go.yaml # Run a specific test make test/03-power-annotation VALUES=/path/to/metal-lab/values-containerlab-node1.yaml # Run against a specific BMC ```