diff --git a/.github/integ-config/integ-all.yml b/.github/integ-config/integ-all.yml index 76976c98f42..91cf76b9a32 100644 --- a/.github/integ-config/integ-all.yml +++ b/.github/integ-config/integ-all.yml @@ -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] diff --git a/.github/integ-config/integ-specialized.yml b/.github/integ-config/integ-specialized.yml deleted file mode 100644 index 65a8906eab5..00000000000 --- a/.github/integ-config/integ-specialized.yml +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/.github/workflows/callable-e2e-test-specialized.yml b/.github/workflows/callable-e2e-test-specialized.yml deleted file mode 100644 index ac5d2ed216e..00000000000 --- a/.github/workflows/callable-e2e-test-specialized.yml +++ /dev/null @@ -1,63 +0,0 @@ -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 - -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 diff --git a/.github/workflows/callable-e2e-test.yml b/.github/workflows/callable-e2e-test.yml index 67b35106458..18697cf5dc5 100644 --- a/.github/workflows/callable-e2e-test.yml +++ b/.github/workflows/callable-e2e-test.yml @@ -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 @@ -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 @@ -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 "$E2E_YARN_SCRIPT" + fi - name: Upload artifact uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 https://github.com/actions/upload-artifact/commit/0b7f8abb1508181956e8e162db84b466c27e18ce if: failure() diff --git a/.github/workflows/callable-e2e-tests.yml b/.github/workflows/callable-e2e-tests.yml index e324d62687c..c27c51ce57f 100644 --- a/.github/workflows/callable-e2e-tests.yml +++ b/.github/workflows/callable-e2e-tests.yml @@ -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 @@ -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 @@ -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 }} diff --git a/scripts/test-github-actions.js b/scripts/test-github-actions.js index 8b6bbea9400..f819ec30b64 100755 --- a/scripts/test-github-actions.js +++ b/scripts/test-github-actions.js @@ -43,7 +43,7 @@ for (const file of [...workflowYmlFiles, ...actionYmlFiles]) { const runCommandValues = getKeyValuesFor('run', ymlContents); for (const val of runCommandValues) { if (val.match(variableTemplatePattern)) { - console.log(`There is an inline variabled used in ${file}`); + console.log(`There is an inline variable used in ${file}`); exitCode = 1; } }