From c571c9fbfea67cf3e8114429c6753da3fb6bd176 Mon Sep 17 00:00:00 2001 From: Jack Lu Date: Fri, 3 Jan 2025 16:05:37 -0800 Subject: [PATCH] Test dev + prod --- .github/workflows/callable-local-e2e-test.yml | 58 +++++++++---------- scripts/test.js | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/callable-local-e2e-test.yml b/.github/workflows/callable-local-e2e-test.yml index f830f3f5..51503e61 100644 --- a/.github/workflows/callable-local-e2e-test.yml +++ b/.github/workflows/callable-local-e2e-test.yml @@ -62,35 +62,35 @@ jobs: uses: ./amplify-data/.github/actions/load-verdaccio-with-amplify-data - name: Make script executable run: chmod +x ./amplify-data/scripts/retry-npm-script.sh - # - name: Run cypress tests for webpack e2e test dev - # shell: bash - # working-directory: ./amplify-data - # env: - # E2E_FRAMEWORK: ${{ inputs.framework }} - # E2E_SAMPLE_NAME: ${{ matrix.sample_name }} - # E2E_SPEC: ${{ inputs.spec }} - # E2E_BROWSER: ${{ matrix.browser }} - # E2E_BACKEND: ${{ inputs.backend }} - # E2E_RETRY_COUNT: ${{ inputs.retry_count }} - # E2E_TEST_NAME: ${{ inputs.test_name }} - # E2E_NPM_SCRIPT: ${{ inputs.npm_script }} - # E2E_ENV: ${{ inputs.env }} - # run: | - # if [ -z "$E2E_NPM_SCRIPT" ]; then - # ../amplify-data/scripts/retry-npm-script.sh -s \ - # "ci:test \ - # $E2E_FRAMEWORK \ - # $E2E_SAMPLE_NAME \ - # $E2E_SPEC \ - # $E2E_BROWSER \ - # dev \ - # $E2E_BACKEND \ - # --env $(echo $E2E_ENV | jq -r 'tostring')" \ - # $E2E_NPM_SCRIPT \ - # -n $E2E_RETRY_COUNT - # else - # echo "Skipping specialized yarn script execution in the dev environment." - # fi + - name: Run cypress tests for webpack e2e test dev + shell: bash + working-directory: ./amplify-data + env: + E2E_FRAMEWORK: ${{ inputs.framework }} + E2E_SAMPLE_NAME: ${{ matrix.sample_name }} + E2E_SPEC: ${{ inputs.spec }} + E2E_BROWSER: ${{ matrix.browser }} + E2E_BACKEND: ${{ inputs.backend }} + E2E_RETRY_COUNT: ${{ inputs.retry_count }} + E2E_TEST_NAME: ${{ inputs.test_name }} + E2E_NPM_SCRIPT: ${{ inputs.npm_script }} + E2E_ENV: ${{ inputs.env }} + run: | + if [ -z "$E2E_NPM_SCRIPT" ]; then + ../amplify-data/scripts/retry-npm-script.sh -s \ + "ci:test \ + $E2E_FRAMEWORK \ + $E2E_SAMPLE_NAME \ + $E2E_SPEC \ + $E2E_BROWSER \ + dev \ + $E2E_BACKEND \ + --env $(echo $E2E_ENV | jq -r 'tostring')" \ + $E2E_NPM_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-data diff --git a/scripts/test.js b/scripts/test.js index 0a9305ff..c78bdadb 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -140,7 +140,7 @@ const runAppOnProd = ({ framework, sample, backend, env }) => { const command = [ envVars && `export ${envVars}`, install, - `npm run ${buildCommand} --prefix ${sampleDir}`, + `npm --prefix ${sampleDir} run ${buildCommand}`, serveCommand, ] .filter(Boolean)