Skip to content

Commit

Permalink
wip: use composites in smoke
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Jan 16, 2024
1 parent b9c21e3 commit bd0c6b1
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions .github/workflows/backstop-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,34 @@ jobs:
name: 💨 Puppeteer
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout actions
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha || github.ref }}
ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref_name || github.ref }}
sparse-checkout: |
.github/actions
path: actions

- name: "Setup Node, npm Cache, and Install"
uses: ./.github/actions/setup-base
- uses: ./actions/.github/actions/setup-base
id: base

- uses: ./actions/.github/actions/setup-node
id: node
with:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}

- name: "𓋏 Run `npm run smoke-test`"
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
npm run smoke-test
- name: "Validate Puppeteer Report"
id: validate
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
set +e
PUPPETEER_TEST_RESULT=$(diff -c <(jq 'walk(if type == "object" then with_entries(.value |= if type == "object" or type == "array" then . else "" end) else . end) | del(.tests[].pair.diff, .tests[].pair.diffImage)' test/__fixtures__/smoke-test.json) \
Expand All @@ -51,6 +62,8 @@ jobs:
- name: "Full Smoke Test Diff"
id: diff
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
set +e
FULL_TEST_DIFF=$(diff <(jq -S '.tests[]' test/__fixtures__/sanity-test-playwright.json) <(jq -S '.tests[]' test/configs/backstop_data/bitmaps_test/**/report.json))
Expand All @@ -76,23 +89,35 @@ jobs:
name: 💨 Playwright
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout actions
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: "Setup Node, npm Cache, and Install"
uses: ./.github/actions/setup-base
ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref_name || github.ref }}
sparse-checkout: |
.github/actions
path: actions

- uses: ./actions/.github/actions/setup-base
id: base

- uses: ./actions/.github/actions/setup-node
id: node
with:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}

- name: "🎭 Run `npm run smoke-test-playwright`"
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
npx playwright install --with-deps
npm run smoke-test-playwright
- name: "Validate Playwright Report"
id: validate
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
set +e
PLAYWRIGHT_TEST_RESULT=$(diff -c <(jq -S 'walk(if type == "object" then with_entries(.value |= if type == "object" or type == "array" then . else "" end) else . end)' | del(.tests[].pair.diff, .tests[].pair.diffImage)' test/__fixtures__/smoke-test-playwright.json) \
Expand All @@ -110,6 +135,8 @@ jobs:
- name: "Full Smoke Test Diff"
id: diff
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
set +e
FULL_TEST_DIFF=$(diff <(jq -S '.tests[]' test/__fixtures__/sanity-test-playwright.json) <(jq -S '.tests[]' test/configs/backstop_data/bitmaps_test/**/report.json))
Expand Down

0 comments on commit bd0c6b1

Please sign in to comment.