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

test: e2e testing #96

Merged
merged 15 commits into from
Dec 1, 2023
Merged

test: e2e testing #96

merged 15 commits into from
Dec 1, 2023

Conversation

hacheigriega
Copy link
Member

@hacheigriega hacheigriega commented Oct 27, 2023

Motivation

End-to-end testing is an addition to the current seda-chain testing framework that relies only on unit tests.

Explanation of Changes

The e2e testing runs two chain Docker containers to deploy a local chain. It then sends transactions through Docker command lines and tests the outcomes using HTTP API queries. Once testing is finished, the containers are torn down.

The current implementation tests the three transaction commands in our wasm-storage module:

  • storing data request wasms
  • storing overlay wasms through governance process
  • instantiating and registering Proxy contract through governance process

To run the e2e tests, first build the Docker image using a Makefile command:

make docker-build-e2e

You can then run the e2e test with the following command:

go test -v -run ^TestIntegrationTestSuite$ github.com/sedaprotocol/seda-chain/e2e 

Note that to run these tests through VS Code, you may have to adjust the timeout period. The tests take about a minute or two to run.

Related PRs and Issues

Closes #94

@hacheigriega hacheigriega marked this pull request as ready for review November 2, 2023 19:42
@hacheigriega hacheigriega requested a review from a team November 2, 2023 21:16
Copy link
Contributor

@gluax gluax left a comment

Choose a reason for hiding this comment

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

I'll take a more in-depth look at the tests themselves tomorrow morning:

But make side:
Could we prevent these tests from running under the make-unit-cover command? Since these aren't unit tests. Ideally, they would have a separate command make-e2e-test and make-e2e-cover.

Copy link
Contributor

@gluax gluax left a comment

Choose a reason for hiding this comment

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

More comments now that I'm not tired, haha.

e2e/e2e_exec_test.go Show resolved Hide resolved
e2e/e2e_exec_test.go Show resolved Hide resolved
e2e/e2e_register_proxy_contract_test.go Outdated Show resolved Hide resolved
s.runValidators(s.chain, 0)
}

func (s *IntegrationTestSuite) TearDownSuite() {
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC golang calls this automatically? So the temp files should always get removed even if an error happens right? If not maybe we should consider making these temp files in the /tmp dir instead of locally was what I think I saw.

e2e/genesis.go Outdated Show resolved Hide resolved
@hacheigriega hacheigriega merged commit 9a78160 into main Dec 1, 2023
6 checks passed
@hacheigriega hacheigriega deleted the hy/e2e branch December 1, 2023 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔧 e2e testing
2 participants