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: configure e2e tests to run against staging before prod can deploy #1012

Merged
merged 7 commits into from
Jul 2, 2024
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
11 changes: 8 additions & 3 deletions .github/workflows/argus-stack-prod-upsert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
prod_stack_upsert:
runs-on: [ARM64, self-hosted, Linux]
permissions:
id-token: write
contents: read
id-token: write
issues: write
pull-requests: write

steps:
- name: Upsert Prod Stack
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.19.1
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0
Comment on lines +7 to +21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade, not related to e2e tests

with:
appName: single-cell-explorer
envName: prod
11 changes: 8 additions & 3 deletions .github/workflows/argus-stack-rdev-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ on:
pull_request:
types: [ labeled, synchronize ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
create-rdev-stack:
runs-on: [ARM64, self-hosted, Linux]
if: contains(github.event.pull_request.labels.*.name, 'stack')
permissions:
id-token: write
contents: read
id-token: write
issues: write
pull-requests: write

steps:
- name: Create Stack
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.19.1
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0
Comment on lines +7 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade, not related to e2e tests

with:
appName: single-cell-explorer
envName: rdev
7 changes: 4 additions & 3 deletions .github/workflows/argus-stack-rdev-delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
runs-on: [ARM64, self-hosted, Linux]
if: ${{ !contains(github.event.pull_request.labels.*.name, 'stack') || github.event.pull_request.state == 'closed' }}
permissions:
id-token: write
contents: read
id-token: write
issues: write
pull-requests: write

steps:
- name: Delete Stack
uses: chanzuckerberg/argus-artifacts/ci/packages/delete-stack@v0.19.1
uses: chanzuckerberg/argus-artifacts/ci/packages/delete-stack@v0.23.0
Comment on lines +12 to +18
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade, not related to e2e tests

with:
appName: single-cell-explorer
envName: rdev
24 changes: 15 additions & 9 deletions .github/workflows/argus-stack-staging-upsert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- '.infra/common.yaml'
- '.infra/staging/values.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run_if:
if: github.head_ref == 'release-please--branches--main'
Expand All @@ -17,19 +21,21 @@ jobs:
needs: run_if
runs-on: [ARM64, self-hosted, Linux]
permissions:
id-token: write
contents: read
id-token: write
issues: write
pull-requests: write

steps:
- name: Upsert Staging Stack
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.19.1
uses: chanzuckerberg/argus-artifacts/ci/packages/create-stack@v0.23.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade, not related to e2e tests

with:
appName: single-cell-explorer
envName: staging
waitForDeploymentSeconds: 300

- name: Wait for Stating Stack to become Healthy
id: wait
uses: chanzuckerberg/argus-artifacts/ci/packages/wait-for-deployment@v0.19.1
with:
appName: single-cell-explorer
envName: staging
staging_smoke_test:
uses: ./.github/workflows/workflow-smoke-test.yaml
needs: staging_stack_upsert
secrets: inherit
with:
env: stage
Comment on lines +34 to +41
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait for healthy staging deployment and then run smoke tests against it

61 changes: 61 additions & 0 deletions .github/workflows/workflow-smoke-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Smoke Test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from .github/workflows/deploy-happy-stack.yml and made into a reusable workflow so it can easily be invoked for staging and prod


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
2 changes: 1 addition & 1 deletion .infra/rdev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ stack:
services:
explorer:
image:
tag: sha-7764ea31
tag: sha-312771fe
replicaCount: 1
env:
# env vars common to all deployment stages
Expand Down
Loading