Skip to content

Commit

Permalink
chore: add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Oct 11, 2024
1 parent ab56ec1 commit 50171aa
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 283 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ jobs:
needs: checkout-install
uses: ./.github/workflows/e2e-router.yml
secrets: inherit

e2e-modern-ssr-data-loader:
needs: checkout-install
uses: ./.github/workflows/e2e-modern-ssr-data-loader.yml
secrets: inherit
54 changes: 54 additions & 0 deletions .github/workflows/e2e-modern-ssr-data-loader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: E2E Test for ModernJS SSR Data Loader

on:
workflow_call:

jobs:
e2e-modern:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=modernjs

- name: E2E Test for Modern.js SSR Data Loader
if: steps.check-ci.outcome == 'success'
run: |
lsof -ti tcp:3062,3061,3063,3064| xargs -r kill &&
pnpm run app:modern:dev &
sleep 1 &&
npx wait-on http://127.0.0.1:3062/ &&
npx wait-on http://127.0.0.1:3061/ &&
npx wait-on http://127.0.0.1:3063/ &&
npx wait-on http://127.0.0.1:3064/ &&
npx nx run modernjs-ssr-data-loader-host:e2e &&
lsof -ti tcp:3062,3061,3063,3064 | xargs kill
Loading

0 comments on commit 50171aa

Please sign in to comment.