Skip to content

Commit

Permalink
fix(JSON-RPC): fix slack alert mechanism in integration test (#1286)
Browse files Browse the repository at this point in the history
  • Loading branch information
TzahiTaub authored Oct 18, 2023
1 parent c318b66 commit 7eccdf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/nightly-tests-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ jobs:
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- run: sudo apt update; sudo apt -y install libclang-dev
# Install libclang-dev that is not a part of the ubuntu vm in github actions.
if: runner.os == 'Linux'
- id: run_test
# Workflow steps exit upon failure of a subcommand (running `set -e` implicitly before the
# run. As we want to keep running this step after a test failure we can either start with
# run). As we want to keep running this step after a test failure we can either start with
# `set +e` to suppress all errors, or, as done below, append `|| retVal=$?` to the command
# which makes it successful while storing the potential erroneous code.
- id: run_test
run: >
sudo apt update; sudo apt -y install libclang-dev;
retVal=0;
INTEGRATION_TESTNET_NODE_URL=${{ secrets.INTEGRATION_TESTNET_NODE_URL }}
SENDER_PRIVATE_KEY=${{ secrets.INTEGRATION_TESTNET_SENDER_PRIVATE_KEY }}
cargo test --test gateway_integration_test -p papyrus_rpc test_gw_integration_testnet
Expand All @@ -42,7 +45,7 @@ jobs:
fi;
- name: In case of a failure - post to a Slack channel.
id: slack
if: ${{ steps.run_test.outputs.retVal }} != 0
if: ${{ steps.run_test.outputs.retVal != 0 }}
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_ALERT_CHANNEL }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: nightly-tests
# We run gateway_integration_test at different times, to avoid a nonce race between parallel runs.
on:
schedule:
- cron: '30 0 * * *' # Uses ubuntu runner.
- cron: '30 3 * * *' # Uses macos runner.
- cron: '30 22 * * *' # Uses ubuntu runner.
- cron: '30 0 * * *' # Uses macos runner.
workflow_dispatch: # Uses ubuntu runner.

jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
INTEGRATION_TESTNET_SENDER_PRIVATE_KEY: ${{ secrets.INTEGRATION_TESTNET_SENDER_PRIVATE_KEY }}
SLACK_ALERT_CHANNEL: ${{ secrets.SLACK_ALERT_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: github.event.schedule != '30 3 * * *'
if: github.event.schedule != '30 0 * * *'

GW-integration-test-macos:
uses: ./.github/workflows/nightly-tests-call.yml
Expand All @@ -27,6 +27,6 @@ jobs:
INTEGRATION_TESTNET_SENDER_PRIVATE_KEY: ${{ secrets.INTEGRATION_TESTNET_SENDER_PRIVATE_KEY }}
SLACK_ALERT_CHANNEL: ${{ secrets.SLACK_ALERT_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: github.event.schedule == '30 3 * * *'
if: github.event.schedule == '30 0 * * *'


0 comments on commit 7eccdf3

Please sign in to comment.