Skip to content

Commit

Permalink
Merge pull request #72 from Kava-Labs/yevhenii/improve-ci
Browse files Browse the repository at this point in the history
Run kava e2e tests before check:data
  • Loading branch information
evgeniy-scherbina authored Aug 23, 2024
2 parents 8c780ad + f4fee76 commit fd240e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/scripts/kava-localnet-ci/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ end_idx=($(curl -s --location --request POST 'http://localhost:8000/network/stat
}
}' | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["current_block_identifier"]["index"])'))

latest_X_blocks=10
start_idx=$(($end_idx - $latest_X_blocks))
start_idx=1

echo "start check:data"
echo "start_idx: $start_idx"
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/ci-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
# and default branch will be used instead
ref: ${{ github.event.client_payload.ref }}
path: kava
submodules: 'true'

- name: Print rosetta version
run: |
Expand All @@ -51,12 +52,6 @@ jobs:
git rev-parse HEAD
working-directory: ./kava

- name: Checkout kvtool
uses: actions/checkout@v4
with:
repository: Kava-Labs/kvtool
path: kvtool

- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -76,7 +71,7 @@ jobs:

- name: Install kvtool
run: make install
working-directory: ./kvtool
working-directory: ./kava/tests/e2e/kvtool

- name: Run kava docker container
run: KAVA_TAG=local kvtool t bootstrap
Expand All @@ -88,6 +83,21 @@ jobs:
run: KAVA_RPC_URL=http://localhost:26657 NETWORK=kava-local PORT=4000 SKIP_LIVE_NODE_TESTS=true make test-integration
working-directory: ./rosetta-kava

# Run kava e2e tests to simulate load before running "rosetta-cli check:data"
# Tests are run against already running kava node, details: https://github.com/Kava-Labs/kava/blob/master/tests/e2e/.env.live-network-example
- name: Run kava e2e tests
run: make test-e2e
working-directory: ./kava
env:
# E2E_RUN_KVTOOL_NETWORKS must be false to trigger run on live network
E2E_RUN_KVTOOL_NETWORKS: false
# Configure the endpoints for connecting to the running network here.
E2E_KAVA_RPC_URL: "http://localhost:26657"
E2E_KAVA_GRPC_URL: "http://localhost:9090"
E2E_KAVA_EVM_RPC_URL: "http://localhost:8545"
# E2E_INCLUDE_IBC_TESTS is not currently supported for running tests against a live network.
E2E_INCLUDE_IBC_TESTS: false

- name: Download coinbase rosetta-cli
run: "curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s"
working-directory: ./rosetta-kava
Expand All @@ -109,7 +119,9 @@ jobs:

- name: Send slack notification if job failed
uses: slackapi/[email protected]
if: ${{ failure() }}
# send slack notification only if workflow was triggered by repository_dispatch event
# if it was triggered by commit to rosetta-kava repo - there is no point to alert, it's visible in rosetta-kava CI
if: ${{ failure() && github.event_name == 'repository_dispatch' }}
with:
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
slack-message: "Rosetta-kava CI failed, details: https://github.com/Kava-Labs/rosetta-kava/actions/runs/${{github.run_id}}"
Expand Down

0 comments on commit fd240e1

Please sign in to comment.