Skip to content

feat: add Playwright last-run composites for failed-only re-runs - #58

Merged
Ntnelbaba merged 4 commits into
mainfrom
feat/playwright-last-run-1bc0
Sep 28, 2026
Merged

Ntnelbaba merged 4 commits into
mainfrom
feat/playwright-last-run-1bc0

Conversation

@Ntnelbaba

@Ntnelbaba Ntnelbaba commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds lean composite actions under actions/playwright-last-run/ so Elementor Core and Pro can share Playwright failed-only on Actions re-run logic instead of duplicating inline workflow steps.

  • restore: when github.run_attempt > 1, downloads the tiny prior artifact, restores .last-run.json, sets extra_args / PLAYWRIGHT_EXTRA_ARGS to --last-failed only when failedTests is non-empty (jq).
  • save: when failures exist, uploads only .last-run.json with retention-days: 1, include-hidden-files: true, and if-no-files-found: ignore.
  • First attempt / new commits: restore is a no-op (full shard). No test-results trees, traces, videos, or WP bootstrap in this action.

Jira

https://elementor.atlassian.net/browse/ED-25653

Inputs / outputs

See actions/playwright-last-run/README.md. Summary:

Action Key inputs Outputs
restore artifact-name, last-run-paths, optional github-token, download-path extra_args ("" or --last-failed)
save artifact-name, last-run-paths, optional staging-dir uploaded (true / false)

Example uses: (Core)

- name: Restore Playwright last-run
  uses: elementor/elementor-editor-github-actions/actions/playwright-last-run/restore@2fcc90f64bb91129cca56c0b80f4ae51fab2e0ba
  id: pw_last_run
  with:
    artifact-name: playwright-last-run-${{ matrix.shardIndex }}-${{ matrix.browser }}
    last-run-paths: |
      tests/playwright/test-results/.last-run.json

- name: Run Playwright
  run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} ${{ steps.pw_last_run.outputs.extra_args }}

- name: Save Playwright last-run
  if: always()
  uses: elementor/elementor-editor-github-actions/actions/playwright-last-run/save@2fcc90f64bb91129cca56c0b80f4ae51fab2e0ba
  with:
    artifact-name: playwright-last-run-${{ matrix.shardIndex }}-${{ matrix.browser }}
    last-run-paths: |
      tests/playwright/test-results/.last-run.json

Elements regression path: tests/elements-regression/test-results/.last-run.json.

Example uses: (Pro)

- uses: elementor/elementor-editor-github-actions/actions/playwright-last-run/restore@2fcc90f64bb91129cca56c0b80f4ae51fab2e0ba
  id: pw_last_run
  with:
    artifact-name: playwright-last-run-${{ matrix.shardIndex }}
    last-run-paths: |
      tests/playwright/test-results/.last-run.json

- uses: elementor/elementor-editor-github-actions/actions/playwright-last-run/save@2fcc90f64bb91129cca56c0b80f4ae51fab2e0ba
  if: always()
  with:
    artifact-name: playwright-last-run-${{ matrix.shardIndex }}
    last-run-paths: |
      tests/playwright/test-results/.last-run.json
    staging-dir: playwright-last-run-ci

After merge, pin workflows to the merge commit SHA instead of @main.

QA

  • Bash syntax check on restore.sh / save.sh
  • CI (Lint, PR Name Linter, tests)
  • save sets include-hidden-files: true for .last-run.json (Pro #7675 validation)
  • Consumer wiring in Core/Pro (re-pin to latest head SHA before merge)
Open in Web Open in Cursor 

✨ PR Description

1. Problem & Context

Implements optimized Playwright re-runs by persisting only the .last-run.json state between GitHub Action attempts, avoiding full shard execution on failures.

2. What Changed (Where)

  • actions/playwright-last-run/restore/: New composite action and script to restore failure state.
  • actions/playwright-last-run/save/: New composite action and script to stage failure state.
  • actions/playwright-last-run/README.md: Documentation for implementation and inputs.

3. How It Works

save.sh uses jq to detect failed tests and uploads .last-run.json as a 1-day artifact. On re-runs (run_attempt > 1), restore.sh downloads this artifact, restores it to specified paths, and outputs --last-failed to trigger Playwright's targeted re-run mode.

4. Risks

Dependency on jq availability on the runner; mitigated by targeting ubuntu-latest where it is pre-installed.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

Add lean composite actions for failed-only Playwright runs on
GitHub Actions re-runs. Upload and restore only .last-run.json.

Ref: ED-25653

Co-authored-by: Netanel Baba <Ntnelbaba@users.noreply.github.com>
@cursor cursor Bot changed the title [ED-25653] Add Playwright last-run composites for failed-only re-runs feat: add Playwright last-run composites for failed-only re-runs Sep 27, 2026
Ref: ED-25653

Co-authored-by: Netanel Baba <Ntnelbaba@users.noreply.github.com>
@Ntnelbaba
Ntnelbaba marked this pull request as ready for review September 27, 2026 17:10
…pload

upload-artifact@v4 excludes dotfiles by default; set
include-hidden-files so save uploads staged .last-run.json.

Ref: ED-25653

Co-authored-by: Netanel Baba <Ntnelbaba@users.noreply.github.com>
@Ntnelbaba
Ntnelbaba merged commit 44f852e into main Sep 28, 2026
17 checks passed
@Ntnelbaba
Ntnelbaba deleted the feat/playwright-last-run-1bc0 branch September 28, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants