Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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:-}"
Expand Down Expand Up @@ -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 <<CONFIGEOF
Expand Down Expand Up @@ -311,7 +311,7 @@ TEST_EXIT_CODE=0
npx playwright test "${PLAYWRIGHT_ARGS[@]+"${PLAYWRIGHT_ARGS[@]}"}" || TEST_EXIT_CODE=$?

# ── Merge coverage data ──────────────────────────────────────────────────
if [[ "${E2E_COLLECT_COVERAGE:-}" == "1" ]]; then
if [[ "${E2E_COLLECT_COVERAGE:-}" == "true" ]]; then
if [[ -d "node_modules/.cache/e2e-test-results/coverage" ]]; then
"$SCRIPT_DIR/scripts/report-coverage.sh" "${E2E_WORKSPACES[@]}"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/report-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# ./scripts/report-coverage.sh <workspace> [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:
Expand Down
4 changes: 2 additions & 2 deletions scripts/upload-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# ./scripts/upload-coverage.sh <workspace-name>
#
# 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,
Expand All @@ -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

Expand Down