Skip to content

Commit 8a4b017

Browse files
authored
fix: use 'true' instead of '1' for E2E_COLLECT_COVERAGE (#2564)
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.
1 parent 9c54dfa commit 8a4b017

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

run-e2e.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ set -euo pipefail
3333
# # Coverage collection is ENABLED BY DEFAULT
3434
# # Requires e2e-test-utils >= 1.x.x for automatic -coverage image swap
3535
# # To disable for faster local development:
36-
# E2E_COLLECT_COVERAGE=0 ./run-e2e.sh -w tech-radar
36+
# E2E_COLLECT_COVERAGE=false ./run-e2e.sh -w tech-radar
3737
# =============================================================================
3838

3939
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -69,11 +69,11 @@ E2E_NIGHTLY_MODE="${E2E_NIGHTLY_MODE:-false}"
6969
# images (plugin:tag__coverage) that e2e-test-utils will load when available.
7070
#
7171
# For nightly/local: Depends on e2e-test-utils automatic image swap logic
72-
# (PR #95, not yet released). Until that lands, coverage collection will be
72+
# (PR #95, merged 2026-06-04). Until that lands, coverage collection will be
7373
# skipped silently (no -coverage images exist).
7474
#
75-
# To disable (faster local dev): E2E_COLLECT_COVERAGE=0
76-
export E2E_COLLECT_COVERAGE="${E2E_COLLECT_COVERAGE:-1}"
75+
# To disable (faster local dev): E2E_COLLECT_COVERAGE=false
76+
export E2E_COLLECT_COVERAGE="${E2E_COLLECT_COVERAGE:-true}"
7777

7878
# Local e2e-test-utils: absolute path to use a local build instead of npm
7979
E2E_TEST_UTILS_PATH="${E2E_TEST_UTILS_PATH:-}"
@@ -264,8 +264,8 @@ for ws in "${E2E_WORKSPACES[@]}"; do
264264
done <<< "$PROJECTS_BLOCK"
265265
done
266266

267-
if [[ "${E2E_COLLECT_COVERAGE:-}" == "1" ]]; then
268-
echo "[INFO] Coverage collection enabled (E2E_COLLECT_COVERAGE=1)"
267+
if [[ "${E2E_COLLECT_COVERAGE:-}" == "true" ]]; then
268+
echo "[INFO] Coverage collection enabled (E2E_COLLECT_COVERAGE=true)"
269269
fi
270270

271271
cat > playwright.config.ts <<CONFIGEOF
@@ -311,7 +311,7 @@ TEST_EXIT_CODE=0
311311
npx playwright test "${PLAYWRIGHT_ARGS[@]+"${PLAYWRIGHT_ARGS[@]}"}" || TEST_EXIT_CODE=$?
312312

313313
# ── Merge coverage data ──────────────────────────────────────────────────
314-
if [[ "${E2E_COLLECT_COVERAGE:-}" == "1" ]]; then
314+
if [[ "${E2E_COLLECT_COVERAGE:-}" == "true" ]]; then
315315
if [[ -d "node_modules/.cache/e2e-test-results/coverage" ]]; then
316316
"$SCRIPT_DIR/scripts/report-coverage.sh" "${E2E_WORKSPACES[@]}"
317317
else

scripts/report-coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ./scripts/report-coverage.sh <workspace> [workspace...]
77
#
88
# Example:
9-
# E2E_COLLECT_COVERAGE=1 ./run-e2e.sh -w tech-radar
9+
# E2E_COLLECT_COVERAGE=true ./run-e2e.sh -w tech-radar
1010
# ./scripts/report-coverage.sh tech-radar
1111
#
1212
# The script:

scripts/upload-coverage.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ./scripts/upload-coverage.sh <workspace-name>
77
#
88
# Example:
9-
# E2E_COLLECT_COVERAGE=1 ./run-e2e.sh -w tech-radar
9+
# E2E_COLLECT_COVERAGE=true ./run-e2e.sh -w tech-radar
1010
# ./scripts/upload-coverage.sh tech-radar
1111
#
1212
# The script reads source.json to determine the upstream repo and SHA,
@@ -28,7 +28,7 @@ LCOV_FILE="$COVERAGE_DIR/lcov.info"
2828

2929
if [[ ! -f "$LCOV_FILE" ]]; then
3030
echo "ERROR: No lcov file found at $LCOV_FILE" >&2
31-
echo "Run tests with E2E_COLLECT_COVERAGE=1 first" >&2
31+
echo "Run tests with E2E_COLLECT_COVERAGE=true first" >&2
3232
exit 1
3333
fi
3434

0 commit comments

Comments
 (0)