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

chore(repo): add ssr two clients E2E #13482

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions .github/integ-config/integ-specialized.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests:
# SSR context isolation
- test_name: integ_ssr_context_isolation
desc: 'SSR Context Isolation'
framework: next
category: ssr-adapter
sample_name: ssr-context-isolation
spec: ssr-context-isolation
66 changes: 66 additions & 0 deletions .github/workflows/callable-e2e-test-specialized.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: E2E Test Specialized
run-name: e2e_specialized.${{ inputs.test_name }}

on:
workflow_call:
inputs:
test_name:
required: true
type: string
framework:
required: true
type: string
category:
required: true
type: string
sample_name:
required: true
type: string
timeout_minutes:
required: true
type: number

env:
AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js
CYPRESS_GOOGLE_CLIENTID: ${{ secrets.CYPRESS_GOOGLE_CLIENTID }}
CYPRESS_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_GOOGLE_CLIENT_SECRET }}
CYPRESS_GOOGLE_REFRESH_TOKEN: ${{ secrets.CYPRESS_GOOGLE_REFRESH_TOKEN }}
HuiSF marked this conversation as resolved.
Show resolved Hide resolved

jobs:
e2e-test:
name: E2E Specialized ${{ inputs.test_name }}
runs-on: ubuntu-latest
strategy:
matrix:
sample_name:
- ${{ fromJson(inputs.sample_name) }}
fail-fast: false
timeout-minutes: ${{ inputs.timeout_minutes }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: amplify-js
- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build
- name: Setup samples staging repository
uses: ./amplify-js/.github/actions/setup-samples-staging
with:
GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }}
- name: Load Verdaccio with AmplifyJs
uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
- name: Run sample & tests
shell: bash
working-directory: amplify-js-samples-staging
run: chmod +x scripts/test-ssr-context-isolation.sh && yarn ci:ssr-context-isolation
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce
if: failure()
with:
name: ${{ inputs.test_name }}
if-no-files-found: ignore
path: |
amplify-js-samples-staging/cypress/videos
amplify-js-samples-staging/cypress/screenshots
retention-days: 14
18 changes: 18 additions & 0 deletions .github/workflows/callable-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jobs:
echo "INTEG_CONFIG=$(cat .github/integ-config/integ-all.yml | yq '.tests' -o=json | jq -c .)" >> $GITHUB_OUTPUT
echo "INTEG_CONFIG_HEADLESS=$(cat .github/integ-config/integ-all-headless.yml | yq '.tests' -o=json | jq -c .)" >> $GITHUB_OUTPUT
echo "DETOX_INTEG_CONFIG=$(cat .github/integ-config/detox-integ-all.yml | yq -o=json | jq -c .)" >> $GITHUB_OUTPUT
echo "INTEG_CONFIG_SPECIALIZED=$(cat .github/integ-config/integ-specialized.yml | yq '.tests' -o=json | jq -c .)" >> $GITHUB_OUTPUT
working-directory: ./amplify-js
outputs:
integ-config: ${{ steps.load_config.outputs.INTEG_CONFIG }}
integ-config-headless: ${{ steps.load_config.outputs.INTEG_CONFIG_HEADLESS }}
detox-integ-config: ${{ steps.load_config.outputs.DETOX_INTEG_CONFIG }}
integ-specialized-config: ${{ steps.load_config.outputs.INTEG_CONFIG_SPECIALIZED }}

e2e-test-runner:
name: E2E test runnner
Expand Down Expand Up @@ -73,3 +75,19 @@ jobs:
test_name: ${{ matrix.integ-config.test_name }}
working_directory: ${{ matrix.integ-config.working_directory }}
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 45 }}

specialized-e2e-test-runner:
name: Specialized E2E test runner
needs: e2e-prep
strategy:
matrix:
integ-config: ${{ fromJson(needs.e2e-prep.outputs.integ-specialized-config) }}
fail-fast: false
secrets: inherit
uses: ./.github/workflows/callable-e2e-test-specialized.yml
with:
test_name: ${{ matrix.integ-config.test_name }}
framework: ${{ matrix.integ-config.framework }}
category: ${{ matrix.integ-config.category }}
sample_name: ${{ toJSON(matrix.integ-config.sample_name) || '[""]' }}
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 35 }}
Loading