From f186fbf4665a33b2cf14e6755d3b629466bb957a Mon Sep 17 00:00:00 2001 From: ckoegel Date: Thu, 23 Mar 2023 10:15:25 -0400 Subject: [PATCH 1/2] SWI-2096 Fix Slack Notify in Tests --- .github/workflows/test-nightly.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index ff2c0aac..ee223aa7 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -62,6 +62,14 @@ jobs: pip install -r requirements_dev.txt python -m pytest --pyargs bandwidth + - name: Notify Slack of Failures + if: failure() + uses: Bandwidth/build-notify-slack-action@v1.0.0 + with: + job-status: failure + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + test_feature: name: Test Feature Branch Nightly runs-on: ${{ matrix.os }} @@ -100,12 +108,8 @@ jobs: echo "Log level: WARNING" pytest -v --log-cli-level=WARNING - notify_for_failures: - name: Notify for Failures - if: failure() - runs-on: ubuntu-latest - steps: - name: Notify Slack of Failures + if: failure() uses: Bandwidth/build-notify-slack-action@v1.0.0 with: job-status: failure From 0cb5af749c30d442924443f2c24e82ee91e7ff69 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Thu, 23 Mar 2023 14:00:13 -0400 Subject: [PATCH 2/2] do it the correct way --- .github/workflows/test-nightly.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index ee223aa7..5d27f2f9 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -62,14 +62,6 @@ jobs: pip install -r requirements_dev.txt python -m pytest --pyargs bandwidth - - name: Notify Slack of Failures - if: failure() - uses: Bandwidth/build-notify-slack-action@v1.0.0 - with: - job-status: failure - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} - slack-channel: ${{ secrets.SLACK_CHANNEL }} - test_feature: name: Test Feature Branch Nightly runs-on: ${{ matrix.os }} @@ -108,8 +100,13 @@ jobs: echo "Log level: WARNING" pytest -v --log-cli-level=WARNING + notify_for_failures: + name: Notify for Failures + needs: [test_main, test_feature] + if: failure() + runs-on: ubuntu-latest + steps: - name: Notify Slack of Failures - if: failure() uses: Bandwidth/build-notify-slack-action@v1.0.0 with: job-status: failure