Skip to content

Commit

Permalink
chore: Finish e2e-evm continuous integration
Browse files Browse the repository at this point in the history
This refactors the e2e-evm tests to run in a single job with the hardhat
network running first to fail fast and trigger any type errors.  In
addition, contracts used to test against kvtool may be unit testing only
in the hardhat network, etc.

In addition, a curl check is added to ensure the EVM JSON-RPC is serving
requests.  This endpoint can take ~30 seconds to come online after the
kvtool server starts.  Curl is configured to check every 5 seconds and
retry 12 times over 60 seconds if the first request is not successful.

Linting and formatting checks are also added via eslint,
typescript-eslint with advanced type check rules, and prettier.

Solhint is installed, but errors without any files so is not configured
to run in CI yet.
  • Loading branch information
nddeluca committed Aug 28, 2024
1 parent 1990640 commit 7ba61df
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: make test
- name: run e2e tests
run: make docker-build test-e2e
test-e2e-evm-hardhat:
test-e2e-evm:
runs-on: ubuntu-latest
steps:
- name: Checkout current commit
Expand All @@ -58,29 +58,9 @@ jobs:
- name: Install npm dependencies
run: npm install
working-directory: tests/e2e-evm
- name: Run hardhat test suite
run: npx hardhat test --network hardhat
- name: Run test suite against hardhat network
run: npm run test-hardhat
working-directory: tests/e2e-evm
test-e2e-evm-kvtool:
runs-on: ubuntu-latest
steps:
- name: Checkout current commit
uses: actions/checkout@v4
with:
submodules: true
- name: Setup nodejs
uses: actions/setup-node@v3
with:
cache: npm
node-version-file: .tool-versions
cache-dependency-path: tests/e2e-evm/package-lock.json
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
tests/e2e/kvtool/go.sum
- name: Build local image
run: make docker-build
- name: Install kvtool
Expand All @@ -89,11 +69,10 @@ jobs:
run: kvtool testnet gen-config kava --kava.configTemplate $(sed -nr "s/E2E_KVTOOL_KAVA_CONFIG_TEMPLATE=\"(.*)\"/\1/p" tests/e2e/.env)
- name: Start kava chain
run: kvtool testnet up -d
- name: Install npm dependencies
run: npm install
working-directory: tests/e2e-evm
- name: Run hardhat test suite
run: npx hardhat test --network kvtool
- name: Wait for JSON RPC to start
run: "curl --retry-all-errors --retry 12 --retry-delay 5 -X POST -H \"Content-Type: application/json\" http://127.0.0.1:8545"
- name: Run test suite against kvtool network
run: npm run test-kvtool
working-directory: tests/e2e-evm
- name: Shutdown kava
if: always()
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,25 @@ jobs:
with:
version: ${{ env.GOLANGCI_VERSION }}
args: -v -c .golangci.yml --new-from-rev ${{ env.REV }}
e2e-evm-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout current commit
uses: actions/checkout@v4
with:
submodules: true
- name: Setup nodejs
uses: actions/setup-node@v3
with:
cache: npm
node-version-file: .tool-versions
cache-dependency-path: tests/e2e-evm/package-lock.json
- name: Install npm dependencies
run: npm install
working-directory: tests/e2e-evm
- name: Run linter
run: npm run lint
working-directory: tests/e2e-evm
- name: Run formatter
run: npm run prettier
working-directory: tests/e2e-evm

0 comments on commit 7ba61df

Please sign in to comment.