Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-17682173 Fix E2E Tests To Pass Github Actions #2236

Merged
merged 20 commits into from
Feb 7, 2025
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
2 changes: 1 addition & 1 deletion .github/actions/changelog-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history to access all commits

Expand Down
82 changes: 50 additions & 32 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ jobs:
fail-fast: false
matrix:
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [16, 18, 20, 22]
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
exclude: # node 18 with npm 11 is not compatible
- node: 18
npm: 11
runs-on: ubuntu-latest
Expand All @@ -26,7 +22,7 @@ jobs:
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,6 +43,14 @@ jobs:
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci

- name: Check Playwright Versions
run: |-
# Check the installed version of playwright
echo "Playwright version: $(npm list playwright --depth=0)"

# Check the installed version of @playwright/test
echo "@playwright/test version: $(npm list @playwright/test --depth=0)"

- name: Generate Retail App Demo
uses: ./.github/actions/e2e_generate_app
with:
Expand All @@ -62,13 +66,10 @@ jobs:
# Run one matrix env at a time because we need to deploy each app to MRT and run e2e tests there
max-parallel: 1
matrix:
node: [16, 18, 20, 22]
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
exclude: # node 18 with npm 11 is not compatible
- node: 18
npm: 11
runs-on: ubuntu-latest
Expand All @@ -77,7 +78,7 @@ jobs:
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -98,6 +99,14 @@ jobs:
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci

- name: Check Playwright Versions
run: |-
# Check the installed version of playwright
echo "Playwright version: $(npm list playwright --depth=0)"

# Check the installed version of @playwright/test
echo "@playwright/test version: $(npm list @playwright/test --depth=0)"

- name: Generate Retail App Without Extensibility
uses: ./.github/actions/e2e_generate_app
with:
Expand Down Expand Up @@ -163,13 +172,10 @@ jobs:
# Run one matrix env at a time because we need to deploy each app to MRT and run e2e tests there
max-parallel: 1
matrix:
node: [16, 18, 20, 22]
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
exclude: # node 18 with npm 11 is not compatible
- node: 18
npm: 11
runs-on: ubuntu-latest
Expand All @@ -178,7 +184,7 @@ jobs:
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -199,6 +205,14 @@ jobs:
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci

- name: Check Playwright Versions
run: |-
# Check the installed version of playwright
echo "Playwright version: $(npm list playwright --depth=0)"

# Check the installed version of @playwright/test
echo "@playwright/test version: $(npm list @playwright/test --depth=0)"

- name: Generate Retail App With Extensibility
uses: ./.github/actions/e2e_generate_app
with:
Expand Down Expand Up @@ -262,23 +276,19 @@ jobs:
# Run one matrix env at a time because we need to deploy each app to MRT and run e2e tests there
max-parallel: 1
matrix:
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 18 with npm 11 is not compatible
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -298,6 +308,14 @@ jobs:
# Install node dependencies
node ./scripts/gtime.js monorepo_install npm ci

- name: Check Playwright Versions
run: |-
# Check the installed version of playwright
echo "Playwright version: $(npm list playwright --depth=0)"

# Check the installed version of @playwright/test
echo "@playwright/test version: $(npm list @playwright/test --depth=0)"

- name: Generate Retail App Private Client
uses: ./.github/actions/e2e_generate_app
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -42,9 +42,9 @@ jobs:
echo "commerce_sdk_react_version_base=$version" >> "$GITHUB_ENV"

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: npm

- name: Install Monorepo Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/setup_pwa_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:

- name: Checkout
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"

- name: Setup PWA dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:

- name: Checkout
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"

- name: Setup PWA dependencies
Expand Down
42 changes: 17 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Changelog Check
uses: ./.github/actions/changelog-check
Expand All @@ -44,30 +44,26 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 22]
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
exclude: # node 18 with npm 11 are not compatible
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
# The current recommended version for Managed Runtime:
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
Expand Down Expand Up @@ -144,13 +140,9 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 22]
node: [18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
exclude: # node 18 with npm 11 is not compatible
- node: 18
npm: 11
runs-on: windows-latest
Expand All @@ -159,16 +151,16 @@ jobs:
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
# The current recommended version for Managed Runtime:
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
Expand Down Expand Up @@ -198,10 +190,10 @@ jobs:
PROJECT_DIR: generated-${{ matrix.template }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 22

Expand Down Expand Up @@ -297,10 +289,10 @@ jobs:
PROJECT_DIR: generated-${{ matrix.template }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 22

Expand Down Expand Up @@ -350,10 +342,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
docs
coverage
scripts/generator/assets
app/static
7 changes: 7 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
printWidth: 100
singleQuote: true
semi: false
bracketSpacing: false
tabWidth: 4
arrowParens: 'always'
trailingComma: 'none'
Loading
Loading