From 724cd43760cacae7cfc9c4fae55f1f8b81ff869c Mon Sep 17 00:00:00 2001 From: Oleg Nikonychev Date: Wed, 6 Nov 2024 17:12:56 +0400 Subject: [PATCH 1/3] chore: scheduled basic e2e tests for evm testnet endpoint --- .github/workflows/e2e-evm-basic-testnet.yml | 33 +++++++++++++++++++++ evm-e2e/justfile | 4 +++ evm-e2e/test/tx_receipt.test.ts | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e-evm-basic-testnet.yml diff --git a/.github/workflows/e2e-evm-basic-testnet.yml b/.github/workflows/e2e-evm-basic-testnet.yml new file mode 100644 index 000000000..26ab49228 --- /dev/null +++ b/.github/workflows/e2e-evm-basic-testnet.yml @@ -0,0 +1,33 @@ +name: EVM E2E Basic Testnet (Scheduled) + +on: + schedule: + - cron: "0 * * * *" # every hour at 00 min + +jobs: + e2e-evm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: "just install" + run: just install + working-directory: "evm-e2e" + + - name: "Run tests (just test-basic)" + run: just test-basic + working-directory: "evm-e2e" + env: + JSON_RPC_ENDPOINT: https://evm-rpc.testnet-1.nibiru.fi + MNEMONIC: ${{ secrets.WALLET_MNEMONIC_TESTNET }} + + - name: Send failure to slack channel + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: "failure" + notification_title: "EVM basic tests failed on Testnet" + message_format: "{emoji} *{workflow}* {status_message} Run: {run_url}" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TESTNET }} diff --git a/evm-e2e/justfile b/evm-e2e/justfile index d8153d37e..ce1a88523 100644 --- a/evm-e2e/justfile +++ b/evm-e2e/justfile @@ -16,6 +16,10 @@ install: test: npm test +# Runs tx receipt tests. Used for testnet quick check. +test-basic: + npm test -- tx_receipt.test.ts + # Format fmt: npm run format diff --git a/evm-e2e/test/tx_receipt.test.ts b/evm-e2e/test/tx_receipt.test.ts index adc91286a..7a95cd995 100644 --- a/evm-e2e/test/tx_receipt.test.ts +++ b/evm-e2e/test/tx_receipt.test.ts @@ -10,7 +10,7 @@ describe('Transaction Receipt Tests', () => { let recipient = ethers.Wallet.createRandom().address; it('simple transfer receipt', async () => { - const value = ethers.parseEther('1'); + const value = ethers.parseEther('0.0001'); const tx = await account.sendTransaction({ to: recipient, value, From 3f2d9d1442a67c0c0b9727651c20c6f188f47a6a Mon Sep 17 00:00:00 2001 From: Oleg Nikonychev Date: Wed, 6 Nov 2024 17:14:16 +0400 Subject: [PATCH 2/3] chore: changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e5fa640..220299f54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,6 +100,7 @@ tests for race conditions within funtoken precompile - [#2100](https://github.com/NibiruChain/nibiru/pull/2100) - refactor: cleanup statedb and precompile sections - [#2101](https://github.com/NibiruChain/nibiru/pull/2101) - fix(evm): tx receipt proper marshalling - [#2105](https://github.com/NibiruChain/nibiru/pull/2105) - test(evm): precompile call with revert +- [#2106](https://github.com/NibiruChain/nibiru/pull/2106) - chore: scheduled basic e2e tests for evm testnet endpoint #### Nibiru EVM | Before Audit 1 - 2024-10-18 From c9927c5aa648c86040cd796199d1238b0beb7186 Mon Sep 17 00:00:00 2001 From: Unique Divine <51418232+Unique-Divine@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:23:13 -0600 Subject: [PATCH 3/3] Update and rename e2e-evm-basic-testnet.yml to e2e-evm-cron.yml --- .github/workflows/e2e-evm-basic-testnet.yml | 33 --------------- .github/workflows/e2e-evm-cron.yml | 47 +++++++++++++++++++++ 2 files changed, 47 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/e2e-evm-basic-testnet.yml create mode 100644 .github/workflows/e2e-evm-cron.yml diff --git a/.github/workflows/e2e-evm-basic-testnet.yml b/.github/workflows/e2e-evm-basic-testnet.yml deleted file mode 100644 index 26ab49228..000000000 --- a/.github/workflows/e2e-evm-basic-testnet.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: EVM E2E Basic Testnet (Scheduled) - -on: - schedule: - - cron: "0 * * * *" # every hour at 00 min - -jobs: - e2e-evm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: "just install" - run: just install - working-directory: "evm-e2e" - - - name: "Run tests (just test-basic)" - run: just test-basic - working-directory: "evm-e2e" - env: - JSON_RPC_ENDPOINT: https://evm-rpc.testnet-1.nibiru.fi - MNEMONIC: ${{ secrets.WALLET_MNEMONIC_TESTNET }} - - - name: Send failure to slack channel - if: always() - uses: ravsamhq/notify-slack-action@v2 - with: - status: ${{ job.status }} - notify_when: "failure" - notification_title: "EVM basic tests failed on Testnet" - message_format: "{emoji} *{workflow}* {status_message} Run: {run_url}" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TESTNET }} diff --git a/.github/workflows/e2e-evm-cron.yml b/.github/workflows/e2e-evm-cron.yml new file mode 100644 index 000000000..11ae62b9a --- /dev/null +++ b/.github/workflows/e2e-evm-cron.yml @@ -0,0 +1,47 @@ +name: EVM E2E Cron + +on: + schedule: + - cron: '0 * * * *' # every hour at 00 min + # cron syntax: https://jasonet.co/posts/scheduled-actions/ + +jobs: + # The "evm-e2e-cron" job runs end-to-end tests on a schedule against instances + # of Nibiru to ensure core functionality remains stable. This is intended to + # highlight any outage or catch degredations in public endpoint functionality + # early. Failures trigger immediate Slack notifications to alert the team. + # + # This workflow: + # 1. Executes basic EVM integration tests against the testnet + # 2. Uses a dedicated test wallet (configured via secrets) + # 3. Reports failures to the testnet Slack channel + # + # Environment requirements: + # - WALLET_MNEMONIC_TESTNET: Secret for test wallet access + # - SLACK_WEBHOOK_TESTNET: Webhook URL for failure notifications + evm-e2e-cron: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: 'just install' + run: just install + working-directory: 'evm-e2e' + + - name: 'Run tests (just test-basic)' + run: just test-basic + working-directory: 'evm-e2e' + env: + JSON_RPC_ENDPOINT: https://evm-rpc.testnet-1.nibiru.fi + MNEMONIC: ${{ secrets.WALLET_MNEMONIC_TESTNET }} + + - name: Send failure to slack channel + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + notification_title: 'EVM basic tests failed on Testnet' + message_format: '{emoji} *{workflow}* {status_message} Run: {run_url}' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TESTNET }}