From 6c97f99f87848a0c1a7cb649a1798107d7814025 Mon Sep 17 00:00:00 2001 From: Yann Autissier Date: Thu, 3 Sep 2026 18:22:40 +0200 Subject: [PATCH] run the whole spec dir by default, gate docker-backed specs on a variable shellspec --tag ~integration filtered out untagged examples too, which silently emptied the suite. --- .shellspec | 2 +- Makefile | 2 +- spec/integration/.gitkeep | 0 spec/spec_helper.sh | 5 +++++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 spec/integration/.gitkeep diff --git a/.shellspec b/.shellspec index 005c6fd..d497364 100644 --- a/.shellspec +++ b/.shellspec @@ -1,4 +1,4 @@ --require spec_helper --shell bash ---default-path spec/unit:spec/golden +--default-path spec --pattern "*_spec.sh" diff --git a/Makefile b/Makefile index c551c58..ca5c067 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ test-unit: ## Run unit tests only 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 + MYOS_INTEGRATION=1 $(SHELLSPEC) spec/integration golden-record: ## Re-record golden expectations from the legacy engine spec/golden/record.sh $(CASES) lint: ## shellcheck all shell sources diff --git a/spec/integration/.gitkeep b/spec/integration/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spec/spec_helper.sh b/spec/spec_helper.sh index 80aaf2d..5d49579 100644 --- a/spec/spec_helper.sh +++ b/spec/spec_helper.sh @@ -4,3 +4,8 @@ MYOS_ROOT=${MYOS_ROOT:-$SHELLSPEC_PROJECT_ROOT} SPEC_DIR=$MYOS_ROOT/spec export MYOS_ROOT SPEC_DIR . "$SPEC_DIR/support/run.sh" + +# Specs under spec/integration and spec/e2e drive a real docker daemon. +# They are skipped unless MYOS_INTEGRATION=1 / MYOS_E2E=1 (make test-integration). +myos_needs_docker() { [ -n "${MYOS_INTEGRATION:-}" ]; } +myos_needs_swarm() { [ -n "${MYOS_E2E:-}" ]; }