From a1a6bcb53048673081484ccea6871f0890fa0061 Mon Sep 17 00:00:00 2001 From: npty Date: Mon, 8 Jul 2024 19:22:24 +0700 Subject: [PATCH] chore: try fixing tests --- .github/workflows/test-core.yml | 26 +++++-------------- .../src/__tests__/export.spec.ts | 4 +-- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 9e29eee3..dca8aa60 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -16,15 +16,13 @@ jobs: ports: - "8545:8545" options: >- - --expose 8545 - --entrypoint anvil -- --host 0.0.0.0 -p 8545 + --entrypoint anvil evm-node-2: image: ghcr.io/foundry-rs/foundry ports: - - "8546:8546" + - "8546:8545" options: >- - --expose 8546 - --entrypoint anvil -- --host 0.0.0.0 -p 8546 + --entrypoint anvil steps: - name: Setup Node uses: actions/setup-node@v4 @@ -48,20 +46,8 @@ jobs: - name: Test timeout-minutes: 15 + env: + EVM_NODE_1: evm-node-1:8545 + EVM_NODE_2: evm-node-2:8546 run: | - apt-get update - apt-get install curl -y - echo "Checking EVM node 1 (8545)" - curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://localhost:8545 - echo "\n\nChecking EVM node 2 (8546)" - curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://localhost:8546 - echo "\n\nTrying with 127.0.0.1 instead of localhost" - curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://127.0.0.1:8545 - echo "\n\nChecking if curl can reach other services" - curl -v http://example.com - echo "\n\nDocker logs for Anvil containers" - docker logs $(docker ps -q --filter "ancestor=ghcr.io/foundry-rs/foundry:latest") - echo "\n\nRunning tests" - - # curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://127.0.0.1:8545 npm run test:core diff --git a/packages/axelar-local-dev/src/__tests__/export.spec.ts b/packages/axelar-local-dev/src/__tests__/export.spec.ts index e59cd580..8a9dbf55 100644 --- a/packages/axelar-local-dev/src/__tests__/export.spec.ts +++ b/packages/axelar-local-dev/src/__tests__/export.spec.ts @@ -133,11 +133,11 @@ describe('export', () => { chains: [ { name: 'Ethereum', - rpcUrl: 'http://127.0.0.1:8545', + rpcUrl: process.env.EVM_NODE_1 || 'http://127.0.0.1:8545', }, { name: 'Avalanche', - rpcUrl: 'http://127.0.0.1:8546', + rpcUrl: process.env.EVM_NODE_2 || 'http://127.0.0.1:8546', }, ], })) as Network[];