From c01651ccd3cc64480b1c68e70a24362afd54ed32 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 4 Apr 2024 21:20:59 +0000 Subject: [PATCH 1/5] test: run enterprise and non-enterprise tests in parallel in ci --- .github/workflows/ci.yaml | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c3541a24937b2..c5c2cc58412f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -432,6 +432,14 @@ jobs: needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + - enterprise: false + name: test-e2e + - enterprise: true + name: test-e2e-enterprise + name: ${{ matrix.name }} steps: - name: Checkout uses: actions/checkout@v4 @@ -444,29 +452,9 @@ jobs: - name: Setup Go uses: ./.github/actions/setup-go - - name: Setup Terraform - uses: ./.github/actions/setup-tf - - - name: go install tools - run: | - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30 - go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33 - go install golang.org/x/tools/cmd/goimports@latest - go install github.com/mikefarah/yq/v4@v4.30.6 - go install go.uber.org/mock/mockgen@v0.4.0 - - - name: Install Protoc - run: | - mkdir -p /tmp/proto - pushd /tmp/proto - curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.3/protoc-23.3-linux-x86_64.zip - unzip protoc.zip - cp -r ./bin/* /usr/local/bin - cp -r ./include /usr/local/bin/include - popd - - name: Build run: | + make gen/mark-fresh # Assume that the checked-in versions are up-to-date make -B site/out/index.html - run: pnpm playwright:install @@ -474,15 +462,18 @@ jobs: # Run tests that don't require an enterprise license without an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 + if: !matrix.enterprise env: DEBUG: pw:api working-directory: site # Run all of the tests with an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 + if: matrix.enterprise env: DEBUG: pw:api CODER_E2E_ENTERPRISE_LICENSE: ${{ secrets.CODER_E2E_ENTERPRISE_LICENSE }} + CODER_E2E_REQUIRE_ENTERPRISE_TESTS: "1" working-directory: site - name: Upload Playwright Failed Tests From dc52b792441abff10d4bd3cdbc4125ddfcd542f0 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 4 Apr 2024 21:27:44 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A7=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c5c2cc58412f0..e29105a84d901 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -435,11 +435,12 @@ jobs: strategy: fail-fast: false matrix: - - enterprise: false - name: test-e2e - - enterprise: true - name: test-e2e-enterprise - name: ${{ matrix.name }} + variant: + - enterprise: false + name: test-e2e + - enterprise: true + name: test-e2e-enterprise + name: ${{ matrix.variant.name }} steps: - name: Checkout uses: actions/checkout@v4 @@ -462,14 +463,14 @@ jobs: # Run tests that don't require an enterprise license without an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 - if: !matrix.enterprise + if: !matrix.variant.enterprise env: DEBUG: pw:api working-directory: site # Run all of the tests with an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 - if: matrix.enterprise + if: matrix.variant.enterprise env: DEBUG: pw:api CODER_E2E_ENTERPRISE_LICENSE: ${{ secrets.CODER_E2E_ENTERPRISE_LICENSE }} From 4ba2302ca1adf5daa6cd82f9ef34ca2dd4eac4f0 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 4 Apr 2024 21:32:54 +0000 Subject: [PATCH 3/5] brackets aren't optional 4 me --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e29105a84d901..4d63dc82f3117 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -463,14 +463,14 @@ jobs: # Run tests that don't require an enterprise license without an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 - if: !matrix.variant.enterprise + if: ${{ !matrix.variant.enterprise }} env: DEBUG: pw:api working-directory: site # Run all of the tests with an enterprise license - run: pnpm playwright:test --forbid-only --workers 1 - if: matrix.variant.enterprise + if: ${{ matrix.variant.enterprise }} env: DEBUG: pw:api CODER_E2E_ENTERPRISE_LICENSE: ${{ secrets.CODER_E2E_ENTERPRISE_LICENSE }} From 4719d3d13f4343e4259c06908eddc2f2599c82f0 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 4 Apr 2024 21:42:35 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d63dc82f3117..a8cdeed7fa583 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -453,10 +453,15 @@ jobs: - name: Setup Go uses: ./.github/actions/setup-go - - name: Build - run: | - make gen/mark-fresh # Assume that the checked-in versions are up-to-date - make -B site/out/index.html + # Assume that the checked-in versions are up-to-date + - run: make gen/mark-fresh + name: make gen + + - run: ./scripts/pnpm_install.sh + name: pnpm install + + - run: pnpm build + working-directory: site - run: pnpm playwright:install working-directory: site From 6bd50ef2ceeca296d420c940b19c33fbba2f8cc4 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 4 Apr 2024 21:57:49 +0000 Subject: [PATCH 5/5] our setup action already does this! --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a8cdeed7fa583..8fc5f8f6ea7fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -457,9 +457,6 @@ jobs: - run: make gen/mark-fresh name: make gen - - run: ./scripts/pnpm_install.sh - name: pnpm install - - run: pnpm build working-directory: site