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:
Prajjwol Gautam 2022-02-09 05:56:12 -08:00 committed by GitHub
parent 03a03b211a
commit f32288b16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 14 deletions

View File

@ -29,4 +29,4 @@ jobs:
.sum
- run: |
make build
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF

View File

@ -35,4 +35,4 @@ jobs:
run: |
sudo make contract-tools
sudo make test-contract
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF

View File

@ -73,7 +73,7 @@ jobs:
- name: test-importer
run: |
make test-import
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF
test-solidity:
runs-on: ubuntu-latest
@ -100,7 +100,7 @@ jobs:
- name: test-solidity
run: |
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF
liveness-test:
runs-on: ubuntu-latest
@ -150,3 +150,23 @@ jobs:
run: |
make test-rpc
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

View File

@ -324,6 +324,9 @@ test-import:
test-rpc:
./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:
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"

View File

@ -139,8 +139,18 @@ echo "done sleeping"
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
if [[ $TEST == "pending" ]]; then
time_out=60m0s
@ -149,10 +159,9 @@ if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
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
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=$time_out -v -short
RPC_FAIL=$?
TEST_FAIL=$?
done
fi
@ -175,8 +184,8 @@ for i in "${arr[@]}"; do
stop_func "$i"
done
if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
exit $RPC_FAIL
if [[ (-z $TEST || $TEST == "rpc" || $TEST == "integration" ) && $TEST_FAIL -ne 0 ]]; then
exit $TEST_FAIL
else
exit 0
fi

View File

@ -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/rpc/... -timeout=300s -v -short
RPC_FAIL=$?
TEST_FAIL=$?
done
fi
@ -150,8 +150,8 @@ for i in "${arr[@]}"; do
stop_func "$i"
done
if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
exit $RPC_FAIL
if [[ (-z $TEST || $TEST == "rpc") && $TEST_FAIL -ne 0 ]]; then
exit $TEST_FAIL
else
exit 0
fi

View File

@ -4,11 +4,12 @@ import (
"bytes"
"context"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
"math/big"
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
// . "github.com/onsi/ginkgo"
// . "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("0x000000000000000000000000378c50d9264c63f3f92b806d4ee56e9d86ffb3ec"),
}
s.Require().Equal(expectedTopics, logs[0].Topics)
}