Skip to content

🔧 Add spec_filter input to Playwright workflow#10782

Merged
clubanderson merged 1 commit intomainfrom
fix/playwright-spec-filter
Apr 28, 2026
Merged

🔧 Add spec_filter input to Playwright workflow#10782
clubanderson merged 1 commit intomainfrom
fix/playwright-spec-filter

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

Summary

  • Adds spec_filter input to the Playwright E2E workflow's workflow_dispatch trigger
  • When a spec file path is provided (e.g. e2e/Sidebar.spec.ts), only that file runs — no sharding
  • When empty (default), runs the full suite with 4 shards as before

Test plan

  • Trigger workflow_dispatch with spec_filter: e2e/Sidebar.spec.ts — verify only sidebar tests run
  • Trigger workflow_dispatch with empty spec_filter — verify full suite runs with shards

🤖 Generated with Claude Code

Allows running individual spec files via workflow_dispatch instead
of the full 4-shard test suite, enabling faster debugging of CI-only
test failures.

Signed-off-by: Andrew Anderson <[email protected]>
Copilot AI review requested due to automatic review settings April 28, 2026 21:35
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Apr 28, 2026
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 28, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 12c9bae
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69f1282091881b00087ff2f2
😎 Deploy Preview https://deploy-preview-10782.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a spec_filter input to the Playwright E2E workflow so a manually-triggered run can target a single spec file instead of the full sharded suite.

Changes:

  • Add workflow_dispatch.inputs.spec_filter to accept an optional spec path.
  • Update the Playwright test step to run either a single spec (when provided) or the existing 4-shard run (when empty).

Comment on lines +103 to +108
run: |
if [ -n "${{ inputs.spec_filter }}" ]; then
npx playwright test --project=chromium "${{ inputs.spec_filter }}"
else
npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
fi
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With spec_filter set, this step still runs in every matrix shard (4 jobs). That means the same spec file will execute 4 times and produce 4 blob reports, which can also distort the merged report. To match the stated behavior (“only that file runs — no sharding”), gate the job/strategy so only a single shard runs when spec_filter is non-empty (e.g., job-level if for matrix.shard == 1, or a dynamic matrix / separate non-matrix job).

Copilot uses AI. Check for mistakes.
Comment on lines +104 to 110
if [ -n "${{ inputs.spec_filter }}" ]; then
npx playwright test --project=chromium "${{ inputs.spec_filter }}"
else
npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
fi
env:
PLAYWRIGHT_BASE_URL: http://localhost:4173
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs.spec_filter is interpolated directly into a bash script/command. For workflow_dispatch inputs this enables shell injection via strings like $(...) or backticks, since the value is inserted into the script before the shell runs. Safer pattern: pass the input via env (e.g. SPEC_FILTER: ${{ inputs.spec_filter }}) and reference it as "$SPEC_FILTER", optionally validating it matches an expected path pattern (like ^e2e/.*\.spec\.(ts|js)$) before executing Playwright.

Suggested change
if [ -n "${{ inputs.spec_filter }}" ]; then
npx playwright test --project=chromium "${{ inputs.spec_filter }}"
else
npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
fi
env:
PLAYWRIGHT_BASE_URL: http://localhost:4173
if [ -n "$SPEC_FILTER" ]; then
if [[ ! "$SPEC_FILTER" =~ ^e2e/.*\.spec\.(ts|js)$ ]]; then
echo "Invalid spec_filter: must match e2e/*.spec.ts or e2e/*.spec.js"
exit 1
fi
npx playwright test --project=chromium "$SPEC_FILTER"
else
npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
fi
env:
PLAYWRIGHT_BASE_URL: http://localhost:4173
SPEC_FILTER: ${{ inputs.spec_filter }}

Copilot uses AI. Check for mistakes.
@clubanderson clubanderson merged commit 6a08595 into main Apr 28, 2026
22 of 23 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the fix/playwright-spec-filter branch April 28, 2026 21:42
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions
Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit 6a085959bf7307e43f26100700a0374e7b426797.

clubanderson pushed a commit that referenced this pull request Apr 28, 2026
- Issue #1 (FIXED): Cluster name strict-mode violation — added .first() to lines 91-93
- Issue #2 (INVESTIGATING): Filter tabs not rendering in webkit/firefox tests
- Issue #3 (INVESTIGATING): Multiple dashboard-page testid elements cause strict-mode
- Triggered targeted Clusters.spec.ts run to validate fix
- PR #10782 enabled spec_filter workflow capability

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Copilot <[email protected]>
lightyagami2109 pushed a commit to lightyagami2109/kubestellar_console_OJT that referenced this pull request May 3, 2026
Allows running individual spec files via workflow_dispatch instead
of the full 4-shard test suite, enabling faster debugging of CI-only
test failures.

Signed-off-by: Andrew Anderson <[email protected]>
Signed-off-by: lightyagami2109 <[email protected]>
lightyagami2109 pushed a commit to lightyagami2109/kubestellar_console_OJT that referenced this pull request May 3, 2026
- Issue kubestellar#1 (FIXED): Cluster name strict-mode violation — added .first() to lines 91-93
- Issue kubestellar#2 (INVESTIGATING): Filter tabs not rendering in webkit/firefox tests
- Issue kubestellar#3 (INVESTIGATING): Multiple dashboard-page testid elements cause strict-mode
- Triggered targeted Clusters.spec.ts run to validate fix
- PR kubestellar#10782 enabled spec_filter workflow capability

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Copilot <[email protected]>
Signed-off-by: lightyagami2109 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tier/3-restricted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants