From 231ad5667e2256975a6a7c0ab218985752cfaedc Mon Sep 17 00:00:00 2001 From: Hayden Spitzley <105455169+hspitzley-czi@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:33:12 -0600 Subject: [PATCH] chore: tune smoke test invocation (#1017) --- .github/actions/smoke-test/action.yaml | 56 +++++++++++++++++ .../workflows/argus-stack-prod-upsert.yaml | 2 +- .../workflows/argus-stack-rdev-create.yaml | 2 +- .../workflows/argus-stack-rdev-delete.yaml | 2 +- .../workflows/argus-stack-staging-upsert.yaml | 20 ++++-- .github/workflows/workflow-smoke-test.yaml | 61 ------------------- .infra/rdev/values.yaml | 2 +- 7 files changed, 75 insertions(+), 70 deletions(-) create mode 100644 .github/actions/smoke-test/action.yaml delete mode 100644 .github/workflows/workflow-smoke-test.yaml diff --git a/.github/actions/smoke-test/action.yaml b/.github/actions/smoke-test/action.yaml new file mode 100644 index 000000000..d7ca092b2 --- /dev/null +++ b/.github/actions/smoke-test/action.yaml @@ -0,0 +1,56 @@ +name: Smoke Test +description: End-to-end smoke tests + +inputs: + env: + description: 'Env name' + required: true + projectToken: + description: 'Chromatic project token' + required: true + +runs: + using: composite + steps: + - uses: actions/setup-node@v4 + with: + node-version-file: "client/.nvmrc" + cache: "npm" + cache-dependency-path: "client/package-lock.json" + - name: Install dependencies + shell: bash + working-directory: ./client + run: | + npm ci + npx playwright install --with-deps + + # Run e2e tests + - name: Run e2e tests + shell: bash + working-directory: ./client + run: | + npm run e2e-${{ inputs.env }} + + - name: Publish to Chromatic + uses: chromaui/action@latest + with: + projectToken: ${{ inputs.projectToken }} + workingDir: ./client + # This is `npm run build-archive-storybook` + buildScriptName: "build-archive-storybook" + + - name: Upload FE test results as an artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: playwright-report + path: ~/**/playwright-report/* + retention-days: 14 + + - name: Upload blob report to GitHub Actions Artifacts + if: always() + uses: actions/upload-artifact@v3 + with: + name: all-blob-reports + path: ~/**/blob-report/* + retention-days: 1 diff --git a/.github/workflows/argus-stack-prod-upsert.yaml b/.github/workflows/argus-stack-prod-upsert.yaml index c42dd923a..974d9e960 100644 --- a/.github/workflows/argus-stack-prod-upsert.yaml +++ b/.github/workflows/argus-stack-prod-upsert.yaml @@ -18,7 +18,7 @@ jobs: steps: - name: Upsert Prod Stack - uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0 + uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.24.0 with: appName: single-cell-explorer envName: prod diff --git a/.github/workflows/argus-stack-rdev-create.yaml b/.github/workflows/argus-stack-rdev-create.yaml index d0bde8abc..f838a9ef0 100644 --- a/.github/workflows/argus-stack-rdev-create.yaml +++ b/.github/workflows/argus-stack-rdev-create.yaml @@ -19,7 +19,7 @@ jobs: steps: - name: Create Stack - uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0 + uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.24.0 with: appName: single-cell-explorer envName: rdev diff --git a/.github/workflows/argus-stack-rdev-delete.yaml b/.github/workflows/argus-stack-rdev-delete.yaml index fd96c2cb5..a2de02537 100644 --- a/.github/workflows/argus-stack-rdev-delete.yaml +++ b/.github/workflows/argus-stack-rdev-delete.yaml @@ -15,7 +15,7 @@ jobs: steps: - name: Delete Stack - uses: chanzuckerberg/argus-artifacts/ci/packages/delete-stack@v0.23.0 + uses: chanzuckerberg/argus-artifacts/ci/packages/delete-stack@v0.24.0 with: appName: single-cell-explorer envName: rdev diff --git a/.github/workflows/argus-stack-staging-upsert.yaml b/.github/workflows/argus-stack-staging-upsert.yaml index c1884ae2b..b9d165525 100644 --- a/.github/workflows/argus-stack-staging-upsert.yaml +++ b/.github/workflows/argus-stack-staging-upsert.yaml @@ -34,15 +34,25 @@ jobs: steps: - name: Upsert Staging Stack - uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0 + uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.24.0 with: appName: single-cell-explorer envName: staging waitForDeploymentSeconds: 300 + postStackDetails: false staging_smoke_test: - uses: ./.github/workflows/workflow-smoke-test.yaml needs: staging_stack_upsert - secrets: inherit - with: - env: stage + # (thuang): We now run the smoke tests against 2 datasets sequentially, so need longer timeout + timeout-minutes: 60 + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Staging Smoke Tests + uses: ./.github/actions/smoke-test + with: + env: stage + # ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} diff --git a/.github/workflows/workflow-smoke-test.yaml b/.github/workflows/workflow-smoke-test.yaml deleted file mode 100644 index b2ecc3fde..000000000 --- a/.github/workflows/workflow-smoke-test.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Smoke Test - -on: - workflow_call: - inputs: - env: - description: 'Env name' - required: true - type: string - -jobs: - smoke-test: - # (thuang): We now run the smoke tests against 2 datasets sequentially, so need longer timeout - timeout-minutes: 60 - runs-on: ubuntu-22.04 - defaults: - run: - working-directory: ./client - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version-file: "client/.nvmrc" - cache: "npm" - cache-dependency-path: "client/package-lock.json" - - name: Install dependencies - run: | - npm ci - npx playwright install --with-deps - - # Run e2e tests - - name: Run e2e tests - run: | - npm run e2e-${{ inputs.env }} - - - name: Publish to Chromatic - uses: chromaui/action@latest - with: - # ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - workingDir: ./client - # This is `npm run build-archive-storybook` - buildScriptName: "build-archive-storybook" - - - name: Upload FE test results as an artifact - if: always() - uses: actions/upload-artifact@v3 - with: - name: playwright-report - path: ~/**/playwright-report/* - retention-days: 14 - - - name: Upload blob report to GitHub Actions Artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: all-blob-reports - path: ~/**/blob-report/* - retention-days: 1 diff --git a/.infra/rdev/values.yaml b/.infra/rdev/values.yaml index 2879c5fd6..912d83b81 100644 --- a/.infra/rdev/values.yaml +++ b/.infra/rdev/values.yaml @@ -2,7 +2,7 @@ stack: services: explorer: image: - tag: sha-ac8da63f + tag: sha-1cad3591 replicaCount: 1 env: # env vars common to all deployment stages