add shellspec golden harness for the legacy make engine

- spec/golden/cases.txt: 69 black-box cases (CLI wrapper mode and make
  include mode) run in a hermetic sandbox with a mocked docker
- spec/golden/expected/*.txt recorded from this engine (baseline)
- make test / test-golden / golden-record / lint dev targets
This commit is contained in:
Yann Autissier
2026-09-03 14:35:58 +02:00
parent e2e34d813e
commit 1d44a2ff32
102 changed files with 632 additions and 0 deletions
+22
View File
@@ -1 +1,23 @@
DEV_TARGETS := test test-unit test-golden test-integration lint golden-record
ifneq ($(filter $(DEV_TARGETS),$(MAKECMDGOALS)),)
SHELLSPEC ?= shellspec
SHELLCHECK ?= shellcheck
.PHONY: $(DEV_TARGETS)
test: ## Run unit + golden tests
$(SHELLSPEC)
test-unit: ## Run unit tests only
$(SHELLSPEC) spec/unit
test-golden: ## Run golden tests only (MYOS_ENGINE=legacy|cli)
$(SHELLSPEC) spec/golden
test-integration: ## Run tests needing a real docker daemon
$(SHELLSPEC) --tag integration
golden-record: ## Re-record golden expectations from the legacy engine
spec/golden/record.sh $(CASES)
lint: ## shellcheck all shell sources
$(SHELLCHECK) -s bash myos spec/golden/record.sh spec/support/run.sh spec/support/bin/* $(wildcard bin/* lib/*.sh lib/cmd/*.sh install.sh)
else
include make/include.mk
endif