From d38a217993bbf2961b1dc7258e69439ca9eafe98 Mon Sep 17 00:00:00 2001 From: Gustavo Lira Date: Thu, 4 Jun 2026 14:50:56 -0300 Subject: [PATCH] fix: use "true" instead of "1" for E2E_COLLECT_COVERAGE Aligns with e2e-test-utils PR #95 (merged 2026-06-04) which changed from checking E2E_COLLECT_COVERAGE === "1" to === "true" for consistency with other boolean env vars (E2E_NIGHTLY_MODE, USE_NEW_FRONTEND_SYSTEM). Changes: - run-e2e.sh: default from "1" to "true", update all checks - scripts/upload-coverage.sh: update example and error message - scripts/report-coverage.sh: update example This fixes coverage collection which was broken because the overlay repo was setting E2E_COLLECT_COVERAGE=1 but test-utils now expects E2E_COLLECT_COVERAGE=true. --- run-e2e.sh | 14 +++++++------- scripts/report-coverage.sh | 2 +- scripts/upload-coverage.sh | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/run-e2e.sh b/run-e2e.sh index 4ece5da22..1e61d96d1 100755 --- a/run-e2e.sh +++ b/run-e2e.sh @@ -33,7 +33,7 @@ set -euo pipefail # # Coverage collection is ENABLED BY DEFAULT # # Requires e2e-test-utils >= 1.x.x for automatic -coverage image swap # # To disable for faster local development: -# E2E_COLLECT_COVERAGE=0 ./run-e2e.sh -w tech-radar +# E2E_COLLECT_COVERAGE=false ./run-e2e.sh -w tech-radar # ============================================================================= SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -69,11 +69,11 @@ E2E_NIGHTLY_MODE="${E2E_NIGHTLY_MODE:-false}" # images (plugin:tag__coverage) that e2e-test-utils will load when available. # # For nightly/local: Depends on e2e-test-utils automatic image swap logic -# (PR #95, not yet released). Until that lands, coverage collection will be +# (PR #95, merged 2026-06-04). Until that lands, coverage collection will be # skipped silently (no -coverage images exist). # -# To disable (faster local dev): E2E_COLLECT_COVERAGE=0 -export E2E_COLLECT_COVERAGE="${E2E_COLLECT_COVERAGE:-1}" +# To disable (faster local dev): E2E_COLLECT_COVERAGE=false +export E2E_COLLECT_COVERAGE="${E2E_COLLECT_COVERAGE:-true}" # Local e2e-test-utils: absolute path to use a local build instead of npm E2E_TEST_UTILS_PATH="${E2E_TEST_UTILS_PATH:-}" @@ -264,8 +264,8 @@ for ws in "${E2E_WORKSPACES[@]}"; do done <<< "$PROJECTS_BLOCK" done -if [[ "${E2E_COLLECT_COVERAGE:-}" == "1" ]]; then - echo "[INFO] Coverage collection enabled (E2E_COLLECT_COVERAGE=1)" +if [[ "${E2E_COLLECT_COVERAGE:-}" == "true" ]]; then + echo "[INFO] Coverage collection enabled (E2E_COLLECT_COVERAGE=true)" fi cat > playwright.config.ts < [workspace...] # # Example: -# E2E_COLLECT_COVERAGE=1 ./run-e2e.sh -w tech-radar +# E2E_COLLECT_COVERAGE=true ./run-e2e.sh -w tech-radar # ./scripts/report-coverage.sh tech-radar # # The script: diff --git a/scripts/upload-coverage.sh b/scripts/upload-coverage.sh index cc0e92471..f012de667 100755 --- a/scripts/upload-coverage.sh +++ b/scripts/upload-coverage.sh @@ -6,7 +6,7 @@ # ./scripts/upload-coverage.sh # # Example: -# E2E_COLLECT_COVERAGE=1 ./run-e2e.sh -w tech-radar +# E2E_COLLECT_COVERAGE=true ./run-e2e.sh -w tech-radar # ./scripts/upload-coverage.sh tech-radar # # The script reads source.json to determine the upstream repo and SHA, @@ -28,7 +28,7 @@ LCOV_FILE="$COVERAGE_DIR/lcov.info" if [[ ! -f "$LCOV_FILE" ]]; then echo "ERROR: No lcov file found at $LCOV_FILE" >&2 - echo "Run tests with E2E_COLLECT_COVERAGE=1 first" >&2 + echo "Run tests with E2E_COLLECT_COVERAGE=true first" >&2 exit 1 fi