diff --git a/Makefile b/Makefile index 04996788d9..ebfd8590d8 100644 --- a/Makefile +++ b/Makefile @@ -785,21 +785,21 @@ test: install test-external: install @INFINITO_TEST_TYPE="external" \ INFINITO_COMPILE=0 \ - bash scripts/tests/code/wrapper.sh + bash scripts/tests/code/wrapper.sh scripts/tests/code/run.sh .PHONY: test-integration # Run the integration test suite. test-integration: install @INFINITO_TEST_TYPE="integration" \ INFINITO_COMPILE=0 \ - bash scripts/tests/code/wrapper.sh + bash scripts/tests/code/wrapper.sh scripts/tests/code/run.sh .PHONY: test-lint # Run the lint test suite. test-lint: install @INFINITO_TEST_TYPE="lint" \ INFINITO_COMPILE=0 \ - bash scripts/tests/code/wrapper.sh + bash scripts/tests/code/wrapper.sh scripts/tests/code/run.sh .PHONY: test-main-merged # Verify upstream main is fully merged into HEAD (pre-push gate); fetches and fails if the branch lags main. @@ -816,7 +816,7 @@ test-merge-signed: test-performance: install @INFINITO_TEST_TYPE="performance" \ INFINITO_COMPILE=0 \ - bash scripts/tests/code/wrapper.sh + bash scripts/tests/code/wrapper.sh scripts/tests/code/run.sh .PHONY: test-signed # Verify HEAD is signed. @@ -835,25 +835,28 @@ test-unit: test-unit-python test-unit-javascript test-unit-php test-unit-ruby .PHONY: test-unit-javascript # Run the JavaScript unit test suite (node:test, no npm dependency). -test-unit-javascript: install-node - @bash scripts/tests/unit/javascript.sh +test-unit-javascript: + @INFINITO_TEST_TYPE="unit-javascript" \ + bash scripts/tests/code/wrapper.sh scripts/tests/unit/javascript.sh .PHONY: test-unit-php # Run the PHP unit test suite (PHPUnit). -test-unit-php: install-php - @bash scripts/tests/unit/php.sh +test-unit-php: + @INFINITO_TEST_TYPE="unit-php" \ + bash scripts/tests/code/wrapper.sh scripts/tests/unit/php.sh .PHONY: test-unit-python # Run the Python unit test suite. test-unit-python: install @INFINITO_TEST_TYPE="unit" \ INFINITO_COMPILE=0 \ - bash scripts/tests/code/wrapper.sh + bash scripts/tests/code/wrapper.sh scripts/tests/code/run.sh .PHONY: test-unit-ruby # Run the Ruby unit test suite (minitest, stdlib). -test-unit-ruby: install-ruby - @bash scripts/tests/unit/ruby.sh +test-unit-ruby: + @INFINITO_TEST_TYPE="unit-ruby" \ + bash scripts/tests/code/wrapper.sh scripts/tests/unit/ruby.sh .PHONY: worktree-down # Stop a branch worktree's stack, release the checkout and free its slot. diff --git a/scripts/tests/code/wrapper.sh b/scripts/tests/code/wrapper.sh index 577d05423a..8c35486ed8 100755 --- a/scripts/tests/code/wrapper.sh +++ b/scripts/tests/code/wrapper.sh @@ -1,14 +1,16 @@ #!/usr/bin/env bash -# Chooses where to execute scripts/tests/code/run.sh based on -# INFINITO_TEST_RUNNER: +# Chooses where to execute a test runner based on INFINITO_TEST_RUNNER: # docker (default) -- inside the already-running infinito compose # container (requires `make compose-up`). # host -- directly against the host shell/Python. +# +# Param $1: repo-relative path of the runner script to execute. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)" -RUN_SCRIPT="${SCRIPT_DIR}/run.sh" +RUNNER_REL="${1:?usage: wrapper.sh }" +RUN_SCRIPT="${REPO_ROOT}/${RUNNER_REL}" cd "${REPO_ROOT}" # shellcheck source=scripts/meta/env/load.sh @@ -18,7 +20,7 @@ source scripts/meta/env/load.sh : "${INFINITO_TEST_RUNNER:?INFINITO_TEST_RUNNER must be set}" : "${INFINITO_TEST_TYPE:?INFINITO_TEST_TYPE must be set}" # nocheck: makefile-supplied -RUN_SCRIPT_IN_CONTAINER="${INFINITO_SRC_DIR}/scripts/tests/code/run.sh" +RUN_SCRIPT_IN_CONTAINER="${INFINITO_SRC_DIR}/${RUNNER_REL}" case "${INFINITO_TEST_RUNNER}" in docker)