Skip to content

Commit

Permalink
Run the new E2E test in the existing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed Jun 13, 2024
1 parent e9eb923 commit 84ddcaf
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 112 deletions.
10 changes: 10 additions & 0 deletions .github/integ-config/integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -846,3 +846,13 @@ tests:
# sample_name: duplicate-packages
# spec: duplicate-packages
# browser: *minimal_browser_list

# 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
yarn_script: ci:ssr-context-isolation
browser: [chrome]
8 changes: 0 additions & 8 deletions .github/integ-config/integ-specialized.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/callable-e2e-test-specialized.yml

This file was deleted.

60 changes: 37 additions & 23 deletions .github/workflows/callable-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ on:
retry_count:
required: true
type: number
yarn_script:
required: false
type: string

env:
AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js
Expand Down Expand Up @@ -80,19 +83,24 @@ jobs:
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
E2E_YARN_SCRIPT: ${{ inputs.yarn_script }}
run: |
../amplify-js/scripts/retry-yarn-script.sh -s \
"ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
dev \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
-n $E2E_RETRY_COUNT
if [ -z "$E2E_YARN_SCRIPT" ]; then
../amplify-js/scripts/retry-yarn-script.sh -s \
"ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
dev \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
$E2E_YARN_SCRIPT \
-n $E2E_RETRY_COUNT
else
echo "Skipping specialized yarn script execution in the dev environment."
fi
- name: Run cypress tests for ${{ inputs.test_name }} prod
shell: bash
working-directory: amplify-js-samples-staging
Expand All @@ -106,18 +114,24 @@ jobs:
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
E2E_YARN_SCRIPT: ${{ inputs.yarn_script }}
run: |
../amplify-js/scripts/retry-yarn-script.sh -s \
"ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
prod \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
-n $E2E_RETRY_COUNT
if [ -z "$E2E_YARN_SCRIPT" ]; then
../amplify-js/scripts/retry-yarn-script.sh -s \
"ci:test \
$E2E_FRAMEWORK \
$E2E_CATEGORY \
$E2E_SAMPLE_NAME \
$E2E_SPEC \
$E2E_BROWSER \
prod \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
$E2E_YARN_SCRIPT \
-n $E2E_RETRY_COUNT
else
yarn ${{ inputs.yarn_script }}
fi
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce
if: failure()
Expand Down
19 changes: 1 addition & 18 deletions .github/workflows/callable-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ 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 All @@ -45,6 +43,7 @@ jobs:
backend: ${{ matrix.integ-config.backend }}
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 35 }}
retry_count: ${{ matrix.integ-config.retry_count || 3 }}
yarn_script: ${{ matrix.integ-config.yarn_script || '' }}

# e2e-test-runner-headless:
# name: E2E test runnner_headless
Expand Down Expand Up @@ -75,19 +74,3 @@ 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 }}

0 comments on commit 84ddcaf

Please sign in to comment.