Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-planets-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

This Pr is separating sources in testmo for playwright and cypress tests, and adding results for runs on PR to testmo
Copy link
Contributor

@andrzejewsky andrzejewsky Jan 13, 2025

Choose a reason for hiding this comment

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

In the future, please use more explicit language what is the result of your change and how that impacts others:

It could be something like:

Testmo results are no longer have fixed source name. This means the report names in testmo has separated run names depending on its source (cypress/playwright)

6 changes: 5 additions & 1 deletion .github/actions/testmo/testmo-init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
testmoRunName:
description: "Displayed name in testmo"
required: true
source:
description: "Source for tests"
required: true

outputs:
testmo-run-id:
Expand All @@ -34,10 +37,11 @@ runs:
--instance "$TESTMO_URL" \
--project-id 1 \
--name "$RUN_NAME" \
--source frontend-e2e-tests)
--source "$SOURCE")
echo "TESTMO_RUN_ID=$ID" >> $GITHUB_OUTPUT
env:
TESTMO_URL: ${{ inputs.testmoUrl }}
TESTMO_TOKEN: ${{ inputs.testmoToken }}
RUN_NAME: ${{inputs.testmoRunName}}
SOURCE: ${{inputs.source}}
id: run-tests
30 changes: 28 additions & 2 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
if: github.event.pull_request.head.repo.full_name == 'saleor/saleor-dashboard'
outputs:
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
TESTMO_RUN_ID: ${{ steps.init-testmo.outputs.testmo-run-id }}
runs-on: ubuntu-22.04
needs: initialize-cloud
permissions:
Expand Down Expand Up @@ -154,7 +155,17 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ needs.initialize-cloud.outputs.POOL_NAME }}

- uses: ./.github/actions/testmo/testmo-init
if: ${{ contains(github.event.pull_request.labels.*.name, 'run pw-e2e') }}
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunName: "Playwright run ${{github.ref_name}}"
source: "Playwright-tests"
id: init-testmo

- name: Prepare accounts
if: ${{ contains(github.event.pull_request.labels.*.name, 'run pw-e2e') }}
id: accounts
uses: ./.github/actions/prepare-accounts
with:
Expand Down Expand Up @@ -192,13 +203,28 @@ jobs:
ACCOUNTS: ${{ needs.deploy-dashboard.outputs.ACCOUNTS }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}

- name: submit-results-to-testmo
if: always()
uses: ./.github/actions/testmo/testmo-threads-submit-playwright
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunId: ${{ needs.deploy-dashboard.outputs.TESTMO_RUN_ID }}

merge-reports:
if: "!cancelled() && contains(github.event.pull_request.labels.*.name, 'run pw-e2e')"

needs: run-tests
needs: [run-tests, deploy-dashboard]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Merge playwright reports
uses: ./.github/actions/merge-pw-reports
uses: ./.github/actions/merge-pw-reports

- name: complete testmo report
uses: ./.github/actions/testmo/testmo-finish
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunId: ${{ needs.deploy-dashboard.outputs.TESTMO_RUN_ID }}
1 change: 1 addition & 0 deletions .github/workflows/run-test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunName: "Playwright run ${{github.ref_name}}"
source: "Playwright-tests"
id: init-testmo

run-tests:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/run-tests-on-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Run automation tests on release
on:

workflow_call:
inputs:
VERSION:
Expand Down Expand Up @@ -93,13 +94,14 @@ jobs:
env:
VERSION: "${{inputs.VERSION}}"
with:
result-encoding: string
script: |
const { VERSION } = process.env
const versionWithoutDot = VERSION.replaceAll(/\./g, "")
if(versionWithoutDot >= 319){
return "playwright"
return "Playwright-tests"
}else{
return "cypress"
return "Cypress-tests"
}

- name: Create check if release PR exists
Expand Down Expand Up @@ -137,6 +139,7 @@ jobs:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunName: "${{ steps.check-framework.outputs.result }} run ${{ env.CUSTOM_VERSION }}"
source: ${{ steps.check-framework.outputs.result }}
id: init-testmo

- name: get environment variables
Expand All @@ -163,7 +166,7 @@ jobs:
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}

run-cy-tests:
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == '"cypress"'
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == 'Cypress-tests'
needs: add-check-and-prepare-instance
runs-on: ubuntu-22.04
timeout-minutes: 30
Expand Down Expand Up @@ -227,7 +230,7 @@ jobs:
runs-on: ubuntu-22.04
needs: "add-check-and-prepare-instance"
timeout-minutes: 30
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == '"playwright"'
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == 'Playwright-tests'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -283,11 +286,11 @@ jobs:
run: npm ci

- name: Merge playwright reports
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == '"playwright"'
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == 'Playwright-tests'
uses: ./.github/actions/merge-pw-reports

- name: Merge cypress reports
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == '"cypress"'
if: needs.add-check-and-prepare-instance.outputs.FRAMEWORK == 'Cypress-tests'
uses: ./.github/actions/combineReportsFromE2E

- name: complete testmo report
Expand Down Expand Up @@ -336,7 +339,7 @@ jobs:
if: |
always() &&
(needs.tests-complete != 'success' && cancelled()) &&
needs.add-check-and-prepare-instance.outputs.FRAMEWORK == '"playwright"'
needs.add-check-and-prepare-instance.outputs.FRAMEWORK == 'Playwright-tests'

steps:
- uses: actions/checkout@v4
Expand Down
Loading