From f278680a791b7cd9aabd54ed807d17bae987691a Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 7 Mar 2024 13:15:27 +0100 Subject: [PATCH 1/4] Compile-time E2E checks --- .github/workflows/e2e-tests.yaml | 60 ++++++++++++++++++++++++++++++++ .github/workflows/ship.yaml | 32 ----------------- 2 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/e2e-tests.yaml diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml new file mode 100644 index 000000000..ab7135c61 --- /dev/null +++ b/.github/workflows/e2e-tests.yaml @@ -0,0 +1,60 @@ +name: run E2Es + +on: + merge_group: + push: + pull_request: + +jobs: + run_postgres_e2es: + name: Run Postgres E2Es + runs-on: ubuntu-latest + + steps: + - name: Install `just` + uses: extractions/setup-just@v1 + + - name: Log in to GitHub Container Registry 📦 + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check out ndc-postgres + uses: actions/checkout@v3 + with: + repository: hasura/ndc-postgres + path: ndc-postgres + token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} + + - name: Build ndc-postgres + run: cargo build + working-directory: ndc-postgres + + - name: Check out v3-engine + uses: actions/checkout@v3 + with: + repository: hasura/v3-engine + path: v3-engine + token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} + + - name: Build v3-engine + run: cargo build + working-directory: v3-engine + + - name: Check out v3-e2e-testing + uses: actions/checkout@v3 + with: + path: v3-e2e-testing + + - name: Run the tests + run: just test-postgres + working-directory: v3-e2e-testing + + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: logs + path: v3-e2e-testing/crates/postgres/static/logs diff --git a/.github/workflows/ship.yaml b/.github/workflows/ship.yaml index 4f9e1ffbc..ac6257619 100644 --- a/.github/workflows/ship.yaml +++ b/.github/workflows/ship.yaml @@ -237,35 +237,3 @@ jobs: draft: true bodyFile: release/notes.md artifacts: release/artifacts/* - - e2e-testing: - name: check against end-to-end tests - needs: - - push-docker-images - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Create docker tag - id: create-tag - run: echo "docker_tag=$(git rev-parse --short=9 ${{ github.sha }})" >> $GITHUB_OUTPUT - - - name: Dispatch Postgres E2E tests - uses: aurelien-baudet/workflow-dispatch@v2 - with: - inputs: '{ "connector": "${{ steps.create-tag.outputs.docker_tag }}" }' - repo: hasura/v3-e2e-testing - ref: main - token: ${{ secrets.E2E_WORKFLOW_PAT }} - workflow: "cargo test postgres" - - - name: Report failures - if: always() && github.ref == 'refs/heads/main' - uses: ravsamhq/notify-slack-action@v2 - with: - status: ${{ job.status }} - notify_when: failure - notification_title: "${{ github.actor }}, *nap time is over*! The following commit to <{repo_url}|{repo}> broke the end-to-end tests:" - message_format: "${{ github.event.head_commit.message }}" - env: - SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_E2E_SLACK_WEBHOOK_URL }} From fc9489c87b3a95984243fc9ee9b9c0421644cf3f Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 7 Mar 2024 13:16:48 +0100 Subject: [PATCH 2/4] ndc-postgres is no longer a remote repository for this test --- .github/workflows/e2e-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index ab7135c61..f71ff6263 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -24,9 +24,7 @@ jobs: - name: Check out ndc-postgres uses: actions/checkout@v3 with: - repository: hasura/ndc-postgres path: ndc-postgres - token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} - name: Build ndc-postgres run: cargo build @@ -46,7 +44,9 @@ jobs: - name: Check out v3-e2e-testing uses: actions/checkout@v3 with: + repository: hasura/v3-e2e-testing path: v3-e2e-testing + token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} - name: Run the tests run: just test-postgres From fb5b7239292d47301214ee29ff50c3e575114d5a Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 7 Mar 2024 13:30:34 +0100 Subject: [PATCH 3/4] Update token name --- .github/workflows/e2e-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index f71ff6263..8c803341f 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -35,7 +35,7 @@ jobs: with: repository: hasura/v3-engine path: v3-engine - token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.E2E_WORKFLOW_PAT }} - name: Build v3-engine run: cargo build @@ -46,7 +46,7 @@ jobs: with: repository: hasura/v3-e2e-testing path: v3-e2e-testing - token: ${{ secrets.CI_PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.E2E_WORKFLOW_PAT }} - name: Run the tests run: just test-postgres From e58b93a64b9be16279468a0966bbd97c3c1c9406 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 7 Mar 2024 14:30:55 +0100 Subject: [PATCH 4/4] Rename job --- .github/workflows/e2e-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 8c803341f..096786891 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -1,4 +1,4 @@ -name: run E2Es +name: Postgres E2E tests on: merge_group: