Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2e refactor separate suites #592

Merged
merged 37 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0ca3a53
wip
cam-schultz Oct 7, 2024
2207e65
use tagged subnet-evm
cam-schultz Oct 8, 2024
b553d96
lengthen timeout
cam-schultz Oct 8, 2024
f90c70d
new justification format
cam-schultz Oct 8, 2024
f4bb683
bump avago
cam-schultz Oct 9, 2024
f281179
add delegation to erc20 staking flow
cam-schultz Oct 9, 2024
06a244e
resolve todos
cam-schultz Oct 9, 2024
d6e0632
separate init vdr helpers
cam-schultz Oct 9, 2024
ead93bc
reduce to 67 quorum
cam-schultz Oct 9, 2024
7c1e007
separate e2e suites
cam-schultz Oct 9, 2024
72ea62d
init chainid before tests
cam-schultz Oct 9, 2024
63bad1a
init chainid before tests
cam-schultz Oct 9, 2024
406caf7
simplify local network
cam-schultz Oct 9, 2024
2d5bbb3
cleanup
cam-schultz Oct 9, 2024
3b62b9b
build fix
cam-schultz Oct 9, 2024
c8ebfd2
add back in teleporter setup
cam-schultz Oct 9, 2024
5a76c07
recover subnet helper
cam-schultz Oct 9, 2024
0fa2ae8
native staking e2e
cam-schultz Oct 10, 2024
c3a0640
remove delegation flows
cam-schultz Oct 10, 2024
70b85e9
tear down network between validator manager tests
cam-schultz Oct 10, 2024
b4710e5
create new default registerer at runtime
cam-schultz Oct 10, 2024
c9320a9
bump awm-relayer
cam-schultz Oct 10, 2024
7136669
poa->pos migration e2e
cam-schultz Oct 10, 2024
3ecdb46
remove debug logs
cam-schultz Oct 10, 2024
2f3390a
add todo
cam-schultz Oct 10, 2024
e033da0
component-wise e2e test jobs
cam-schultz Oct 10, 2024
e0e108b
update job names
cam-schultz Oct 10, 2024
f57c860
remove upload artifact
cam-schultz Oct 10, 2024
11e8a39
lint fixes
cam-schultz Oct 10, 2024
0cb408f
Merge branch 'acp-77-e2e' into e2e-refactor-separate-suites
cam-schultz Oct 10, 2024
380fc9a
resolve todos
cam-schultz Oct 10, 2024
43c2279
Merge branch 'acp-77-updates' into acp-77-e2e
cam-schultz Oct 14, 2024
391b03c
Merge branch 'acp-77-e2e' into e2e-refactor-separate-suites
cam-schultz Oct 14, 2024
4bd2158
simplify component check
cam-schultz Oct 14, 2024
098442e
remove ref to unused var
cam-schultz Oct 15, 2024
646e4dd
test all suites by default
cam-schultz Oct 15, 2024
4cbde54
correct arg
cam-schultz Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 49 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
source scripts/constants.sh
go test ./...

e2e_tests:
name: e2e_tests
teleporter_e2e:
name: teleporter-e2e-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout repositories and submodules
Expand All @@ -67,15 +67,52 @@ jobs:
run: |
export PATH=$PATH:$HOME/.foundry/bin
export PATH="$PATH:$GOPATH/bin"
./scripts/local/e2e_test.sh
./scripts/local/e2e_test.sh --components teleporter

- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
if: always()
governance_e2e:
name: governance-e2e-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout repositories and submodules
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Install Foundry
run: ./scripts/install_foundry.sh

- name: Run E2E Tests
# Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc
run: |
export PATH=$PATH:$HOME/.foundry/bin
export PATH="$PATH:$GOPATH/bin"
./scripts/local/e2e_test.sh --components governance

validator_manager_e2e:
name: validator-manager-e2e-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout repositories and submodules
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Go
uses: actions/setup-go@v5
with:
name: e2e-tmpnet-data
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
go-version-file: 'go.mod'

- name: Install Foundry
run: ./scripts/install_foundry.sh

- name: Run E2E Tests
# Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc
run: |
export PATH=$PATH:$HOME/.foundry/bin
export PATH="$PATH:$GOPATH/bin"
./scripts/local/e2e_test.sh --components validator-manager
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module github.com/ava-labs/teleporter
go 1.22.8

require (
github.com/ava-labs/avalanchego v1.12.0-initial-poc.3
github.com/ava-labs/avalanchego v1.12.0-initial-poc.5
github.com/supranational/blst v0.3.11 // indirect
)

require (
github.com/ava-labs/awm-relayer v1.4.1-0.20241003183820-366b0dc8cea6
github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6
github.com/ava-labs/subnet-evm v0.6.10
github.com/ethereum/go-ethereum v1.13.14
github.com/onsi/ginkgo/v2 v2.20.2
Expand All @@ -19,6 +19,7 @@ require (
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
golang.org/x/tools v0.26.0
google.golang.org/protobuf v1.35.1
)

require (
Expand Down Expand Up @@ -144,8 +145,7 @@ require (
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/grpc v1.67.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.12.0-initial-poc.3 h1:JfVooBCdMzpeGUT9/phJNl2GHflkGehlMJokXeWKa2A=
github.com/ava-labs/avalanchego v1.12.0-initial-poc.3/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE=
github.com/ava-labs/awm-relayer v1.4.1-0.20241003183820-366b0dc8cea6 h1:v7k5wQxcvnYcMaz+zoO1OLAcU8REDD1EhfPZdl4Q+aI=
github.com/ava-labs/awm-relayer v1.4.1-0.20241003183820-366b0dc8cea6/go.mod h1:sSXpQtgiduMdZw5IVTSa1v418VCjb8GDLyrcGwJZ/HE=
github.com/ava-labs/avalanchego v1.12.0-initial-poc.5 h1:gW4xAqZNvkA4gP8M9yDyd7YUzuwfQbbCR+hgd1ztOto=
github.com/ava-labs/avalanchego v1.12.0-initial-poc.5/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE=
github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6 h1:WdFWoZ8clWfTPp3cKyWYTsveMKW/0SQzWk8U1aCcdnw=
github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6/go.mod h1:6eqh3V1Og40gXmZUOP6tCrlmMEcVuj9l737yYh1s8uw=
github.com/ava-labs/coreth v0.13.8 h1:f14X3KgwHl9LwzfxlN6S4bbn5VA2rhEsNnHaRLSTo/8=
github.com/ava-labs/coreth v0.13.8/go.mod h1:t3BSv/eQv0AlDPMfEDCMMoD/jq1RkUsbFzQAFg5qBcE=
github.com/ava-labs/subnet-evm v0.6.10 h1:uIh6bFMA4GCMVMQ3agBPxTMlYHL8FBR5FrhMR+drfKI=
Expand Down Expand Up @@ -991,8 +991,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand All @@ -1005,8 +1005,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
70 changes: 61 additions & 9 deletions scripts/local/e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,55 @@ TELEPORTER_PATH=$(
cd ../.. && pwd
)

function printHelp() {
echo "Usage: ./scripts/local/e2e_test.sh [--component component]"
echo ""
printUsage
}

function printUsage() {
cat << EOF
Arguments:
--components component1,component2 Comma separated list of test suites to run. Valid components are:
$(echo $valid_components | tr ' ' '\n' | sort | tr '\n' ' ')
(default: all)
Options:
--help Print this help message
EOF
}

valid_components=$(ls -d $TELEPORTER_PATH/tests/local/*/ | xargs -n 1 basename)
components=

while [ $# -gt 0 ]; do
case "$1" in
--components)
if [[ $2 != --* ]]; then
components=$2
else
echo "Invalid components $2" && printHelp && exit 1
fi
shift;;
--help)
printHelp && exit 0 ;;
*)
echo "Invalid option: $1" && printHelp && exit 1;;
esac
shift
done

# Run all suites if no component is provided
if [ -z "$components" ]; then
components=$valid_components
fi

# Exit if invalid component is provided
for component in $(echo $components | tr ',' ' '); do
if [[ $valid_components != *$component* ]]; then
echo "Invalid component $component" && exit 1
fi
done

source "$TELEPORTER_PATH"/scripts/constants.sh
source "$TELEPORTER_PATH"/scripts/versions.sh

Expand Down Expand Up @@ -38,15 +87,18 @@ cd "$TELEPORTER_PATH"
# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}

ginkgo build ./tests/local/
for component in $(echo $components | tr ',' ' '); do
echo "Building e2e tests for $component"
ginkgo build ./tests/local/$component

# Run the tests
echo "Running e2e tests $RUN_E2E"
RUN_E2E=true ./tests/local/local.test \
--ginkgo.vv \
--ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} \
--ginkgo.focus=${GINKGO_FOCUS:-""} \
--ginkgo.trace
echo "Running e2e tests for $component"
RUN_E2E=true ./tests/local/$component/$component.test \
--ginkgo.vv \
--ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} \
--ginkgo.focus=${GINKGO_FOCUS:-""} \
--ginkgo.trace

echo "e2e tests passed"
echo "$component e2e tests passed"
echo ""
done
exit 0
2 changes: 1 addition & 1 deletion tests/flows/governance/validator_set_sig.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func ValidatorSetSig(network interfaces.LocalNetwork) {
network.SetChainConfigs(chainConfigs)
restartCtx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
network.RestartNodes(restartCtx, network.GetAllNodeIDs())
network.RestartNodes(restartCtx, nil)

// ************************************************************************************************
// Test Case 1: validatorChain (subnetB) != targetChain (subnetA)
Expand Down
2 changes: 1 addition & 1 deletion tests/flows/teleporter/registry/teleporter_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {
network.SetChainConfigs(chainConfigs)
restartCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
network.RestartNodes(restartCtx, network.GetAllNodeIDs())
network.RestartNodes(restartCtx, nil)

// Call addProtocolVersion on subnetB to register the new Teleporter version
utils.AddProtocolVersionAndWaitForAcceptance(
Expand Down
2 changes: 1 addition & 1 deletion tests/flows/teleporter/relayer_modifies_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func relayAlteredMessage(
sendEvent, err := utils.GetEventFromLogs(sourceReceipt.Logs, source.TeleporterMessenger.ParseSendCrossChainMessage)
Expect(err).Should(BeNil())

signedWarpMessage := network.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination)
signedWarpMessage := utils.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination)

// Construct the transaction to send the Warp message to the destination chain
_, fundedKey := network.GetFundedAccountInfo()
Expand Down
2 changes: 1 addition & 1 deletion tests/flows/teleporter/validator_churn.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func ValidatorChurn(network interfaces.LocalNetwork) {
sentTeleporterMessage := sendEvent.Message

// Construct the signed warp message
signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetAInfo, subnetBInfo)
signedWarpMessage := utils.ConstructSignedWarpMessage(ctx, receipt, subnetAInfo, subnetBInfo)

//
// Modify the validator set on Subnet A
Expand Down
Loading