diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c7433f85..2bd46125d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,9 +169,13 @@ jobs: name: spin-ubuntu-latest path: target/release/ - - name: Run e2e tests + - name: Build e2e tests image + run: | + export E2E_FETCH_SPIN=false + make build-test-spin-up + + - name: Run e2e tests image run: | chmod +x `pwd`/target/release/spin export E2E_VOLUME_MOUNT="-v `pwd`/target/release/spin:/usr/local/bin/spin" - export E2E_FETCH_SPIN=false - make test-spin-up + make run-test-spin-up \ No newline at end of file diff --git a/Makefile b/Makefile index 6fa3fd59a..62dccffcb 100644 --- a/Makefile +++ b/Makefile @@ -54,8 +54,14 @@ test-integration: test-kv RUST_LOG=$(LOG_LEVEL) cargo test --test integration --no-fail-fast -- --skip spinup_tests --skip cloud_tests --nocapture .PHONY: test-spin-up -test-spin-up: +test-spin-up: build-test-spin-up-docker run-test-spin-up-docker + +.PHONY: build-test-spin-up +build-test-spin-up: docker build -t spin-e2e-tests --build-arg FETCH_SPIN=$(E2E_FETCH_SPIN) --build-arg BUILD_SPIN=$(E2E_BUILD_SPIN) -f $(E2E_TESTS_DOCKERFILE) . + +.PHONY: run-test-spin-up +run-test-spin-up: REDIS_IMAGE=$(REDIS_IMAGE) MYSQL_IMAGE=$(MYSQL_IMAGE) POSTGRES_IMAGE=$(POSTGRES_IMAGE) \ docker compose -f e2e-tests-docker-compose.yml run $(E2E_VOLUME_MOUNT) e2e-tests