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: e2e add integ_auth_test_cypress_no_ui test #39

Merged
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
6 changes: 6 additions & 0 deletions .github/integ-config/integ-all-headless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tests:
# integ_auth_test_cypress_no_ui
- test_name: 'Token revocation'
category: 'auth'
spec: 'token-revocation'
is_headless: true
6 changes: 6 additions & 0 deletions .github/integ-config/integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ tests:
category: datastore
sample_name: [v2/basic-crud]
spec: vite-basic-crud
browser: *minimal_browser_list
timeout_minutes: 45
retry_count: 10

# Rollup
# integ_rollup_datastore_basic_crud
Expand All @@ -601,6 +604,9 @@ tests:
category: datastore
sample_name: [rollup-basic-crud]
spec: rollup-basic-crud
browser: *minimal_browser_list
timeout_minutes: 45
retry_count: 10

# React
# integ_react_geo
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/callable-e2e-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
id: load_config
run: |
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
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}}

e2e-test-runner:
Expand All @@ -42,6 +44,22 @@ jobs:
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 35 }}
retry_count: ${{ matrix.integ-config.retry_count || 3 }}

e2e-test-runner-headless:
name: e2e test runnner_headless
needs: e2e-prep
secrets: inherit
strategy:
matrix:
integ-config: ${{ fromJson(needs.e2e-prep.outputs.integ-config-headless) }}
fail-fast: false
uses: ./.github/workflows/callable-e2e-tests-headless.yml
with:
test_name: ${{ matrix.integ-config.test_name }}
category: ${{ matrix.integ-config.category }}
spec: ${{ matrix.integ-config.spec || '' }}
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 35 }}
retry_count: ${{ matrix.integ-config.retry_count || 3 }}

detox-e2e-test-runner:
name: e2e test runner
needs: e2e-prep
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/callable-e2e-tests-headless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'E2E Tests - Headless'

on:
workflow_call:
inputs:
test_name:
required: true
type: string
category:
required: true
type: string
spec:
required: true
type: string
timeout_minutes:
required: true
type: number
retry_count:
required: true
type: number

jobs:
e2e-test:
name: 'E2E-Headless: ${{ inputs.test_name }}'
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
# Minimal depth 2 so we can checkout the commit before possible merge commit.
fetch-depth: 2
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_ACTIONS_STAGING_READ: ${{ secrets.GH_ACTIONS_STAGING_READ }}

- name: 'Change directory into build and run link'
run: |
yarn link-all
working-directory: amplify-js

- name: 'Link packages into samples staging root'
run: |
yarn link amazon-cognito-identity-js @aws-amplify/core @aws-amplify/cache @aws-amplify/auth
working-directory: amplify-js-samples-staging

- name: Run cypress tests for ${{ inputs.test_name }}
run: |
../amplify-js/.circleci/retry-yarn-script.sh -s \
"cypress run \
--headless \
--spec ./cypress/integration/${{ inputs.category }}/${{ inputs.spec }}.spec.js \
--config baseUrl=https://aws.amazon.com/" \
-n ${{ inputs.retry_count }}
working-directory: amplify-js-samples-staging
shell: bash

- name: upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce
if: always()
with:
name: e2e-test-artifacts
if-no-files-found: ignore
path: |
amplify-js-samples-staging/cypress/videos
amplify-js-samples-staging/cypress/screenshots
Loading