Skip to content

Commit f3d542f

Browse files
feat: auto-derive skip tags from JOB_NAME in run-e2e.sh (#2281)
* feat: auto-derive skip tags from JOB_NAME in run-e2e.sh Derive Playwright skip tags from OpenShift CI JOB_NAME and inject --grep-invert so tests can opt out of specific CI jobs using standard Playwright tags (e.g., { tag: "@skip-ocp-helm-nightly" }). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use negative lookahead for exact skip tag matching Append (?!-) to the grep-invert pattern so @skip-ocp-helm only matches that exact tag, not @skip-ocp-helm-nightly. This lets tests skip in PR check without accidentally skipping in nightly, and vice versa. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: clarify skip tag comment in run-e2e.sh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: shorten skip tag comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 46a6869 commit f3d542f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

run-e2e.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ while [[ $# -gt 0 ]]; do
7979
esac
8080
done
8181

82+
# Auto-skip tests tagged @skip-<job-suffix> based on JOB_NAME.
83+
# (?!-) ensures exact match — @skip-ocp-helm won't match @skip-ocp-helm-nightly.
84+
if [[ -n "$JOB_NAME" ]]; then
85+
JOB_SUFFIX=$(echo "$JOB_NAME" | sed -n 's/.*-e2e-//p')
86+
if [[ -n "$JOB_SUFFIX" ]]; then
87+
E2E_SKIP_TAG="@skip-${JOB_SUFFIX}(?!-)"
88+
PLAYWRIGHT_ARGS=("--grep-invert" "$E2E_SKIP_TAG" "${PLAYWRIGHT_ARGS[@]}")
89+
echo "[INFO] Skip tag: $E2E_SKIP_TAG (derived from JOB_NAME)"
90+
fi
91+
fi
92+
8293
GENERATED_FILES=()
8394

8495
# ── Prerequisites ─────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)