Skip to content

test(e2e): scope role-gated content checks to visible matches - #349

Merged
krisarmstrong merged 2 commits into
mainfrom
chore/stem-e2e-rolegated-visible
May 28, 2026
Merged

test(e2e): scope role-gated content checks to visible matches#349
krisarmstrong merged 2 commits into
mainfrom
chore/stem-e2e-rolegated-visible

Conversation

@krisarmstrong

Copy link
Copy Markdown
Collaborator

Summary

trafficgen-page.spec.ts "should show role-gated content" failed on stem main — same fragile pattern as servicetest: the broad role/permission text regex also matches the page's nav label, rendered in both the mobile aside (display:none at 1280px) and the desktop aside. content.first() resolved to the hidden mobile node → toBeVisible() failed.

Applied .locator('visible=true').first() to all four remaining page specs (certify, benchmark, measure, trafficgen). servicetest already had this (it passed this run, confirming the fix). Eliminates the flake across the whole set.

Note: this confirms the Phase-2 CLS auth-gating change did not break the shell — every other page test passed; only the broad-regex role-gated checks needed the visible scope.

Test plan

  • npm run lint — clean
  • CI E2E — all 5 page specs' role-gated checks should pass

🤖 Generated with Claude Code

trafficgen-page failed on main with the same fragile pattern servicetest
had: the broad role/permission text regex also matches the page's nav
label, rendered in both the mobile aside (display:none at 1280px) and
the desktop aside. content.first() resolved to the hidden mobile node.

Applied the same `.locator('visible=true').first()` scope to all four
remaining page specs (certify, benchmark, measure, trafficgen) so they
assert on real on-screen content. servicetest already had it (passed
this run, confirming the approach). Prevents the flake across the set.
@krisarmstrong
krisarmstrong enabled auto-merge (squash) May 28, 2026 16:25
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

The race-detector job (the only CGO+linux runner) failed with a nil
pointer panic in TestConfigureContextWithTestContext, surrounded by C
dataplane "trial failed: -22" (EINVAL) logs. Root cause: four tests use
dataplane.NewTestContext() and call Execute/Configure. Under the stub
build (CGO off) that returns ErrNotSupported — the path these tests are
written for ("valid but non-functional context"). Under CGO+linux it
hits the real C dataplane, which needs a NIC/privileges the runner
lacks; the trials fail -22 and the uninitialized context panics.

The race job runs `go test -short`, so gate these four on testing.Short()
via a shared skipRealDataplaneInShort helper:
  - TestExecuteWithTestContext
  - TestExecuteWithTestContextFrameSize
  - TestExecuteWithTestContextDefaultBranch
  - TestConfigureContextWithTestContext

The normal backend job (CGO off, no -short) still runs them in their
intended stub mode for coverage; production uses real hardware and is
unaffected. This is the correct purpose of -short (exclude tests needing
real hardware), not masking a production bug — the panic is only
reachable on the no-NIC path that -short exists to skip.
@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

@krisarmstrong
krisarmstrong merged commit e399942 into main May 28, 2026
28 checks passed
@krisarmstrong
krisarmstrong deleted the chore/stem-e2e-rolegated-visible branch May 28, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant