Skip to content

Commit 0151407

Browse files
committed
feat: add TEST filter and separate CRUD/discovery test targets
Add support for filtering conformance tests by name pattern and running CRUD or discovery tests separately: - make conformance-test TEST=s3-bucket - make conformance-test-crud TEST=kms-key - make conformance-test-discovery
1 parent 3193efc commit 0151407

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed

Makefile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BINARY := $(PLUGIN_NAME)
2222
PLUGIN_BASE_DIR := $(HOME)/.pel/formae/plugins
2323
INSTALL_DIR := $(PLUGIN_BASE_DIR)/$(PLUGIN_NAMESPACE)/v$(PLUGIN_VERSION)
2424

25-
.PHONY: all build test test-unit test-integration lint clean install help setup-credentials clean-environment conformance-test
25+
.PHONY: all build test test-unit test-integration lint clean install help setup-credentials clean-environment conformance-test conformance-test-crud conformance-test-discovery
2626

2727
all: build
2828

@@ -82,16 +82,38 @@ setup-credentials:
8282
clean-environment:
8383
@./scripts/ci/clean-environment.sh
8484

85-
## conformance-test: Run conformance tests against formae
86-
## Usage: make conformance-test [VERSION=0.76.0]
85+
## conformance-test: Run all conformance tests (CRUD + discovery)
86+
## Usage: make conformance-test [VERSION=0.80.0] [TEST=s3-bucket]
8787
## Downloads the specified formae version (or latest) and runs conformance tests.
8888
## Calls setup-credentials and clean-environment automatically.
89-
conformance-test: install setup-credentials
89+
##
90+
## Parameters:
91+
## VERSION - Formae version to test against (default: latest)
92+
## TEST - Filter tests by name pattern (e.g., TEST=s3-bucket)
93+
conformance-test: conformance-test-crud conformance-test-discovery
94+
95+
## conformance-test-crud: Run only CRUD lifecycle tests
96+
## Usage: make conformance-test-crud [VERSION=0.80.0] [TEST=s3-bucket]
97+
conformance-test-crud: install setup-credentials
9098
@echo "Pre-test cleanup..."
9199
@./scripts/ci/clean-environment.sh || true
92100
@echo ""
93-
@echo "Running conformance tests..."
94-
@./scripts/run-conformance-tests.sh $(VERSION); \
101+
@echo "Running CRUD conformance tests..."
102+
@FORMAE_TEST_FILTER="$(TEST)" FORMAE_TEST_TYPE=crud ./scripts/run-conformance-tests.sh $(VERSION); \
103+
TEST_EXIT=$$?; \
104+
echo ""; \
105+
echo "Post-test cleanup..."; \
106+
./scripts/ci/clean-environment.sh || true; \
107+
exit $$TEST_EXIT
108+
109+
## conformance-test-discovery: Run only discovery tests
110+
## Usage: make conformance-test-discovery [VERSION=0.80.0] [TEST=s3-bucket]
111+
conformance-test-discovery: install setup-credentials
112+
@echo "Pre-test cleanup..."
113+
@./scripts/ci/clean-environment.sh || true
114+
@echo ""
115+
@echo "Running discovery conformance tests..."
116+
@FORMAE_TEST_FILTER="$(TEST)" FORMAE_TEST_TYPE=discovery ./scripts/run-conformance-tests.sh $(VERSION); \
95117
TEST_EXIT=$$?; \
96118
echo ""; \
97119
echo "Post-test cleanup..."; \

scripts/run-conformance-tests.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
# VERSION - Optional formae version (e.g., 0.76.0). Defaults to "latest".
1212
#
1313
# Environment variables:
14-
# FORMAE_BINARY - Path to formae binary (skips download if set)
14+
# FORMAE_BINARY - Path to formae binary (skips download if set)
1515
# FORMAE_INSTALL_PREFIX - Installation directory (default: temp directory)
16+
# FORMAE_TEST_FILTER - Filter tests by name pattern (e.g., "s3-bucket")
17+
# FORMAE_TEST_TYPE - Select test type: "all" (default), "crud", or "discovery"
1618

1719
set -euo pipefail
1820

@@ -102,11 +104,21 @@ echo ""
102104
echo "Using formae binary: ${FORMAE_BINARY}"
103105
"${FORMAE_BINARY}" --version
104106

105-
# Export FORMAE_BINARY and FORMAE_VERSION for the tests
107+
# Export environment variables for the tests
106108
# FORMAE_VERSION is required by the plugin SDK to resolve PKL schema paths
107109
export FORMAE_BINARY
108110
export FORMAE_VERSION="${VERSION}"
109111

112+
# Pass through test filter and type if set
113+
if [[ -n "${FORMAE_TEST_FILTER:-}" ]]; then
114+
export FORMAE_TEST_FILTER
115+
echo "Test filter: ${FORMAE_TEST_FILTER}"
116+
fi
117+
if [[ -n "${FORMAE_TEST_TYPE:-}" ]]; then
118+
export FORMAE_TEST_TYPE
119+
echo "Test type: ${FORMAE_TEST_TYPE}"
120+
fi
121+
110122
# =============================================================================
111123
# Update and Resolve PKL Dependencies
112124
# =============================================================================

0 commit comments

Comments
 (0)