Select SSO nightly specs by tag so every job reports clean counts - #31034
Select SSO nightly specs by tag so every job reports clean counts#31034siddhant1 wants to merge 2 commits into
Conversation
The sso-auth project collects all 11 SSO specs in every matrix job and relies on test.skip() to drop the inapplicable ones, so each nightly job reports a skipped count alongside its passes (3/2/5). A skipped line that is always present carries no signal, and it hid the fact that the two guards disagreed with each other: OktaSelfSignupClaims compared providerType !== 'okta' while SSORenewal strict-compared a single 'keycloak-azure-saml' string, so the -crosssite variant fell out of the renewal suite incidentally rather than by decision. Tag the provider-specific describes instead and let each matrix entry exclude what its fixture cannot serve via --grep-invert. Excluded specs are now dropped at collection time, so their beforeAll hooks - which do an admin login and patch global security config - no longer run at all. Renewal is tagged @tokenRenewal rather than by provider because that is the real constraint: the suite shortens the global access-token TTL, which is unsafe to point at the live Okta tenant. The -crosssite job excludes it too, deliberately this time: all three renewal tests act on the OM origin (they await AUTH_REFRESH_PATH and clear OM_SESSION) and never touch the IdP after login, while -crosssite only relocates the IdP to 127.0.0.1 to make the SAML callback POST cross-site. Post-login refresh is therefore same-origin and identical in both keycloak jobs, so running it twice adds cost without signal. Coverage is unchanged - 8/9/6 collected, matching the passing counts of run 30973822261 spec-for-spec - with no skips. The credential half of each guard stays, so a rotated secret still skips rather than fails; that shows up on Slack as a visible 0-passed/N-skipped summary. An entry omitting excluded_tags collects everything, so a future provider added without one fails loudly instead of silently not running. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 548 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 56m 58s ⏱️ Max setup 3m 1s · max shard execution 18m 33s · max shard-job elapsed before upload 22m 39s · reporting 4s 🌐 203.51 requests/attempt · 2.83 app boots/UI scenario · 10.06% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
There was a problem hiding this comment.
Pull request overview
This PR updates the nightly SSO Playwright matrix to exclude provider/capability-specific specs at collection time (via tags + --grep-invert), eliminating “always skipped” noise and ensuring each job reports clean pass/fail counts.
Changes:
- Add Playwright tags for provider/capability-specific suites (
@okta,@tokenRenewal) so the workflow can filter them per matrix provider. - Remove provider-type-based
test.skip()guards in the tagged specs, keeping only credential-based skipping. - Extend the nightly workflow matrix with
excluded_tagsand pass it to Playwright via--grep-invert.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Auth/SSORenewal.spec.ts | Tags renewal suite with @tokenRenewal and removes provider-specific skip guard. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Auth/OktaSelfSignupClaims.spec.ts | Tags Okta-only suite with @okta and removes provider-specific skip guard. |
| .github/workflows/playwright-sso-login-nightly.yml | Adds excluded_tags to provider matrix and filters suites using --grep-invert to prevent permanent skips. |
Code Review ✅ ApprovedUpdates Playwright SSO nightly specs to be selected by tag using OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
.github/workflows/playwright-sso-login-nightly.yml:135
--grep-invert "${{ matrix.provider.excluded_tags }}"is always passed. If a future matrix entry omitsexcluded_tags(as the onboarding comment suggests is allowed), this expands to an empty regex, which matches everything and inverts to exclude all tests. That contradicts the comment (“collects every spec”) and can lead to a confusing ‘no tests’ run.
Make the flag conditional so missing excluded_tags runs the full suite.
# failure that the localhost-only job cannot, guarding the SAML RelayState fix.
KEYCLOAK_SAML_BASE_URL: ${{ matrix.provider.name == 'keycloak-azure-saml-crosssite' && 'http://127.0.0.1:8080' || 'http://localhost:8080' }}
PLAYWRIGHT_IS_OSS: true
run: npx playwright test --project=sso-auth --workers=1 --grep-invert "${{ matrix.provider.excluded_tags }}"
openmetadata-ui/src/main/resources/ui/playwright/e2e/Auth/SSORenewal.spec.ts:48
- This spec mutates global security config to enforce an aggressively short access-token TTL (
withShortSamlTokenValidity). Removing the provider-type guard means that ifSSO_USERNAME/SSO_PASSWORDare set, the renewal suite can run against any configured provider (including the live Okta tenant) when executed outside this nightly workflow’s--grep-invert.
Reintroduce the provider guard so the TTL override cannot be applied against unsupported providers, and keep the lint-disable rationale inline (it’s useful context for why this file is allowed to skip).
const SESSION_RENEWAL_TAGS = ['@sso', '@Platform', '@tokenRenewal'];
test.describe.configure({ mode: 'serial' });
test.describe('SSO Session Renewal', { tag: SESSION_RENEWAL_TAGS }, () => {
test.slow();
// eslint-disable-next-line playwright/no-skipped-test
test.skip(
!username || !password,
`${SSO_ENV.USERNAME} + ${SSO_ENV.PASSWORD} must be set`
);
openmetadata-ui/src/main/resources/ui/playwright/e2e/Auth/OktaSelfSignupClaims.spec.ts:54
- This spec still derives the provider helper from
SSO_PROVIDER_TYPE, but the provider guard was removed fromtest.skip. If someone runs the SSO project/specs without the nightly workflow’s--grep-invert(or adds a provider without the rightexcluded_tags), this describe can run against a non-Okta provider, applying the wrong SSO config and producing misleading failures.
Restore the provider-type guard (it won’t affect nightly counts because @okta specs are excluded at collection time for non-Okta jobs).
// eslint-disable-next-line playwright/no-skipped-test
test.skip(
!username || !password,
`Requires ${SSO_ENV.USERNAME}/${SSO_ENV.PASSWORD}`
);
Change
Tag the provider-specific describes and let each matrix entry exclude what its fixture cannot serve via
--grep-invert.SSOLoginOktaSelfSignupClaims@oktaSSORenewal@tokenRenewalexcluded_tagsokta@tokenRenewalkeycloak-azure-saml@oktakeycloak-azure-saml-crosssite@okta|@tokenRenewalRenewal is tagged by capability, not by provider, because the TTL override — not Keycloak-ness — is what makes it unsafe against the live Okta tenant.
The
-crosssitejob excludes renewal too, deliberately this time. All three renewal tests act on the OM origin (they awaitAUTH_REFRESH_PATHand clearOM_SESSION) and never touch the IdP after login, whereas-crosssiteonly relocates the IdP to127.0.0.1so the SAML callback POST is cross-site. Post-login refresh is same-origin and identical in both keycloak jobs, so running it twice costs ~1.5 min for no added signal.A side benefit: excluded specs are dropped at collection time, so their
beforeAll— which performs an admin login and patches global security config — no longer runs at all.Verification
Counts and composition both confirmed via
--list, no server required:Spec-for-spec identical to run 30973822261's passing tests, with zero skips. If a passed count moves, the retag is wrong — that's the review heuristic here.
On Slack
The nightly posts one message per matrix job. Only the last number changes:
oktakeycloak-azure-samlcrosssite⏩becomes a real signal: 0 in every healthy run, so any non-zero value is worth clicking.Deliberately unchanged
✅ 0 | ⏩ N, which at least reads as wrong now that healthy runs are always⏩ 0. Turning that into a hard failure is a separate call.playwright.config.tsstill hardcodes the 3-spectestMatch, so a new SSO spec must be registered there or it never runs. Pre-existing; out of scope.Notes for reviewers
SESSION_RENEWAL_TAGSis extracted to a const only to keep thetest.describeline under Prettier's 80-char width — inlining the array reflows the call and reindents the whole ~200-line describe body, burying the real change.excluded_tagscollects every spec, so a future provider added without one fails loudly instead of silently not running. The onboarding comment at the top of the workflow documents this as step 4.🤖 Generated with Claude Code