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 tests #26

Merged
merged 64 commits into from
Sep 25, 2023
Merged

E2E tests #26

merged 64 commits into from
Sep 25, 2023

Conversation

minghinmatthewlam
Copy link

@minghinmatthewlam minghinmatthewlam commented Sep 1, 2023

Why this should be merged

Provides an e2e test that makes sure the relayer is running properly from start up, subscribing, and delivering the message to destination chain and address. Fixes #15

How this works

  • Runs as part of CI
  • Builds a local network with warp enabled subnets
  • Configures a test relayer config
  • Builds and runs the relayer separately
  • Simulates a transaction from the Teleporter contract to sendWarpMessage with a Teleporter message payload
  • Verifies message gets delivered properly to destination with right values.

This can be extended for other future message protocols we support.

How this was tested

CI, unit tests, locally

How is this documented

README

@minghinmatthewlam minghinmatthewlam changed the title E2e tests E2E tests Sep 1, 2023
@minghinmatthewlam minghinmatthewlam marked this pull request as ready for review September 5, 2023 20:48
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
tests/e2e_test.go Outdated Show resolved Hide resolved
tests/e2e_test.go Outdated Show resolved Hide resolved
@minghinmatthewlam
Copy link
Author

LGTM, going to refresh reviews

func UnpackMessageReceivedResult(result []byte) (bool, error) {
var success bool
err := EVMTeleporterContractABI.UnpackIntoInterface(&success, "messageReceived", result)
return success, err
}

// PackSendCrossChainMessageEvent packs the SendCrossChainMessage event type. PackEvent is documented as not supporting struct types, so this should be used
// with caution. Here, we only use it for testing purposes. In a real setting, the Teleporter contract should pack the event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this warning a little more obvious? Maybes start one line of the comment with "CAUTION". I would totally miss this most of the time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, clarified that. I also thought about moving it to package tests, but that unfortunately creates an import cycle. If we decide to move these Teleporter packing/unpacking utils to teleporter, we can spend more energy putting up better guardrails, but IMO a more explicit comment is sufficient for now.

geoff-vball
geoff-vball previously approved these changes Sep 22, 2023
cam-schultz
cam-schultz previously approved these changes Sep 25, 2023
@cam-schultz cam-schultz dismissed stale reviews from geoff-vball and themself via a4d2cf5 September 25, 2023 14:47
@cam-schultz cam-schultz merged commit 9e80165 into main Sep 25, 2023
7 checks passed
@cam-schultz cam-schultz deleted the e2e-tests branch September 25, 2023 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Set up end-to-end testing framework
5 participants