ci: separate out rpc and integration tests (#931)
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
03a03b211a
commit
f32288b16d
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -29,4 +29,4 @@ jobs:
|
|||||||
.sum
|
.sum
|
||||||
- run: |
|
- run: |
|
||||||
make build
|
make build
|
||||||
if: "env.GIT_DIFF != ''"
|
if: env.GIT_DIFF
|
||||||
|
2
.github/workflows/deploy-contract.yml
vendored
2
.github/workflows/deploy-contract.yml
vendored
@ -35,4 +35,4 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo make contract-tools
|
sudo make contract-tools
|
||||||
sudo make test-contract
|
sudo make test-contract
|
||||||
if: "env.GIT_DIFF != ''"
|
if: env.GIT_DIFF
|
||||||
|
24
.github/workflows/test.yml
vendored
24
.github/workflows/test.yml
vendored
@ -73,7 +73,7 @@ jobs:
|
|||||||
- name: test-importer
|
- name: test-importer
|
||||||
run: |
|
run: |
|
||||||
make test-import
|
make test-import
|
||||||
if: "env.GIT_DIFF != ''"
|
if: env.GIT_DIFF
|
||||||
|
|
||||||
test-solidity:
|
test-solidity:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -100,7 +100,7 @@ jobs:
|
|||||||
- name: test-solidity
|
- name: test-solidity
|
||||||
run: |
|
run: |
|
||||||
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
|
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
|
||||||
if: "env.GIT_DIFF != ''"
|
if: env.GIT_DIFF
|
||||||
|
|
||||||
liveness-test:
|
liveness-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -150,3 +150,23 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make test-rpc
|
make test-rpc
|
||||||
if: env.GIT_DIFF
|
if: env.GIT_DIFF
|
||||||
|
|
||||||
|
test-e2e:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-go@v2.1.4
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
- uses: actions/checkout@v2.4.0
|
||||||
|
- uses: technote-space/get-diff-action@v6.0.1
|
||||||
|
with:
|
||||||
|
PATTERNS: |
|
||||||
|
**/**.sol
|
||||||
|
**/**.go
|
||||||
|
go.mod
|
||||||
|
go.sum
|
||||||
|
- name: Test e2e
|
||||||
|
run: |
|
||||||
|
make test-integration
|
||||||
|
if: env.GIT_DIFF
|
3
Makefile
3
Makefile
@ -324,6 +324,9 @@ test-import:
|
|||||||
test-rpc:
|
test-rpc:
|
||||||
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc" -r "true"
|
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc" -r "true"
|
||||||
|
|
||||||
|
test-integration:
|
||||||
|
./scripts/integration-test-all.sh -t "integration" -q 1 -z 1 -s 2 -m "integration" -r "true"
|
||||||
|
|
||||||
test-rpc-pending:
|
test-rpc-pending:
|
||||||
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"
|
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"
|
||||||
|
|
||||||
|
@ -139,8 +139,18 @@ echo "done sleeping"
|
|||||||
|
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
|
if [[ -z $TEST || $TEST == "integration" ]] ; then
|
||||||
|
time_out=300s
|
||||||
|
|
||||||
|
for i in $(seq 1 "$TEST_QTD"); do
|
||||||
|
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
|
||||||
|
echo "going to test ethermint node $HOST_RPC ..."
|
||||||
|
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
|
||||||
|
TEST_FAIL=$?
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
|
||||||
time_out=300s
|
time_out=300s
|
||||||
if [[ $TEST == "pending" ]]; then
|
if [[ $TEST == "pending" ]]; then
|
||||||
time_out=60m0s
|
time_out=60m0s
|
||||||
@ -149,10 +159,9 @@ if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
|
|||||||
for i in $(seq 1 "$TEST_QTD"); do
|
for i in $(seq 1 "$TEST_QTD"); do
|
||||||
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
|
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
|
||||||
echo "going to test ethermint node $HOST_RPC ..."
|
echo "going to test ethermint node $HOST_RPC ..."
|
||||||
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
|
|
||||||
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=$time_out -v -short
|
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=$time_out -v -short
|
||||||
|
|
||||||
RPC_FAIL=$?
|
TEST_FAIL=$?
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -175,8 +184,8 @@ for i in "${arr[@]}"; do
|
|||||||
stop_func "$i"
|
stop_func "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
|
if [[ (-z $TEST || $TEST == "rpc" || $TEST == "integration" ) && $TEST_FAIL -ne 0 ]]; then
|
||||||
exit $RPC_FAIL
|
exit $TEST_FAIL
|
||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -127,7 +127,7 @@ if [[ -z $TEST || $TEST == "rpc" ]]; then
|
|||||||
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=300s -v -short
|
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=300s -v -short
|
||||||
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=300s -v -short
|
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=300s -v -short
|
||||||
|
|
||||||
RPC_FAIL=$?
|
TEST_FAIL=$?
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -150,8 +150,8 @@ for i in "${arr[@]}"; do
|
|||||||
stop_func "$i"
|
stop_func "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
|
if [[ (-z $TEST || $TEST == "rpc") && $TEST_FAIL -ne 0 ]]; then
|
||||||
exit $RPC_FAIL
|
exit $TEST_FAIL
|
||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -4,11 +4,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
evmtypes "github.com/tharsis/ethermint/x/evm/types"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
evmtypes "github.com/tharsis/ethermint/x/evm/types"
|
||||||
|
|
||||||
// . "github.com/onsi/ginkgo"
|
// . "github.com/onsi/ginkgo"
|
||||||
// . "github.com/onsi/gomega"
|
// . "github.com/onsi/gomega"
|
||||||
|
|
||||||
@ -392,6 +393,7 @@ func (s *IntegrationTestSuite) TestGetLogs() {
|
|||||||
common.HexToHash("0x000000000000000000000000" + fmt.Sprintf("%x", common.BytesToAddress(s.network.Validators[0].Address))),
|
common.HexToHash("0x000000000000000000000000" + fmt.Sprintf("%x", common.BytesToAddress(s.network.Validators[0].Address))),
|
||||||
common.HexToHash("0x000000000000000000000000378c50d9264c63f3f92b806d4ee56e9d86ffb3ec"),
|
common.HexToHash("0x000000000000000000000000378c50d9264c63f3f92b806d4ee56e9d86ffb3ec"),
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Require().Equal(expectedTopics, logs[0].Topics)
|
s.Require().Equal(expectedTopics, logs[0].Topics)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user