From bc8b73330858f8409024d7c8cee3526d06662c9f Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 13 Nov 2024 00:30:11 +0100 Subject: [PATCH 1/5] chore(ci): add homebrew smoke test MONGOSH-1895 --- .github/workflows/homebrew.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/homebrew.yml diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml new file mode 100644 index 0000000000..05b7b46ba7 --- /dev/null +++ b/.github/workflows/homebrew.yml @@ -0,0 +1,39 @@ +name: "Smoke Test Homebrew install" + +on: + schedule: + - cron: "0 0 * * *" + pull_request: # TODO: remove pull_request trigger + +jobs: + smoke-test-homebrew: + name: Test on ${{ matrix.runner }} + runs-on: ${{ matrix.runner}} + strategy: + matrix: + runner: [macos-13, macos-14, macos-15] + fail-fast: false + steps: + - run: brew install mongosh + - run: mongosh --smokeTests + - name: Report failure + # TODO: replace with failure() + if: ${{ success() }} + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MONGOSH_DEVEL_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + uses: slackapi/slack-github-action@v1.27.0 + with: + payload: | + { + "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}" + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Failed run: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + } + } + ] + } From 400712feefd0bceee2c364abc33af8c3ad1f758c Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 13 Nov 2024 11:22:16 +0100 Subject: [PATCH 2/5] Run mongodb tests as well --- .github/workflows/homebrew.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index 05b7b46ba7..441d17a7bb 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -14,8 +14,12 @@ jobs: runner: [macos-13, macos-14, macos-15] fail-fast: false steps: - - run: brew install mongosh - - run: mongosh --smokeTests + - name: Install mongosh + run: brew install mongosh + + - name: Run smoke tests + run: npx --yes mongodb-runner exec -- sh -c 'env MONGOSH_SMOKE_TEST_SERVER=$MONGODB_URI mongosh --smokeTests' + - name: Report failure # TODO: replace with failure() if: ${{ success() }} From cdee42b1c957c33189f1c19a1d1ccf6f59907f18 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 13 Nov 2024 11:47:50 +0100 Subject: [PATCH 3/5] Fix json --- .github/workflows/homebrew.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index 441d17a7bb..ace1df6e51 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -30,7 +30,7 @@ jobs: with: payload: | { - "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}" + "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}", "blocks": [ { "type": "section", From 89359c13e24ce5bd28fd382cb1f2b13594924c94 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 13 Nov 2024 11:54:35 +0100 Subject: [PATCH 4/5] Try and fix slack link --- .github/workflows/homebrew.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index ace1df6e51..ed193a9b3a 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -22,7 +22,7 @@ jobs: - name: Report failure # TODO: replace with failure() - if: ${{ success() }} + if: ${{ matrix.runner == 'macos-15' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MONGOSH_DEVEL_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK @@ -36,7 +36,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "Failed run: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }})|${{ github.run_id }}>" } } ] From 8b5f11eb9a3737e49ecae9217cec84307ca782c8 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 13 Nov 2024 12:00:34 +0100 Subject: [PATCH 5/5] Tweaks to the workflow --- .github/workflows/homebrew.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index ed193a9b3a..c26a7777cd 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -3,7 +3,6 @@ name: "Smoke Test Homebrew install" on: schedule: - cron: "0 0 * * *" - pull_request: # TODO: remove pull_request trigger jobs: smoke-test-homebrew: @@ -21,8 +20,7 @@ jobs: run: npx --yes mongodb-runner exec -- sh -c 'env MONGOSH_SMOKE_TEST_SERVER=$MONGODB_URI mongosh --smokeTests' - name: Report failure - # TODO: replace with failure() - if: ${{ matrix.runner == 'macos-15' }} + if: ${{ failure() }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MONGOSH_DEVEL_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK @@ -30,13 +28,13 @@ jobs: with: payload: | { - "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}", + "text": "Homebrew smoke test failed on ${{ matrix.runner }}", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }})|${{ github.run_id }}>" + "text": "Homebrew smoke test failed on ${{ matrix.runner }}: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>" } } ]