Skip to content
New issue

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

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

Already on GitHub? # to your account

Reusable (e2e) tests for chains #14233

Closed
julienrbrt opened this issue Dec 9, 2022 · 1 comment
Closed

Reusable (e2e) tests for chains #14233

julienrbrt opened this issue Dec 9, 2022 · 1 comment
Labels

Comments

@julienrbrt
Copy link
Member

julienrbrt commented Dec 9, 2022

With ADR-59, the SDK attempt to define more clearly what different types of tests exist in the SDK, how to write them and what are their usage.

This led, from v0.47, to a split of integration tests and end-to-end tests in a separate go module: https://pkg.go.dev/github.com/cosmos/cosmos-sdk/tests.

For instance, the SDK tests SimApp against the different e2e suite (such as auth, bank, etc..):

func TestE2ETestSuite(t *testing.T) {
   cfg := network.DefaultConfig(simapp.NewTestNetworkFixture)
   cfg.NumValidators = 2
   suite.Run(t, NewE2ETestSuite(cfg))
}

We are investigating the possibility of letting every each import the SDK testing suite by simply implementing func() network.TestFixture via:

import (
	"testing"

	"github.com/cosmos/cosmos-sdk/tests/e2e/auth"
	"github.com/cosmos/cosmos-sdk/testutil/network"
	"github.com/stretchr/testify/suite"
)

func TestAuthE2ETestSuite(t *testing.T) {
	cfg := network.DefaultConfig(gaia.NewTestNetworkFixture)
	cfg.NumValidators = 2
	suite.Run(t, auth.NewE2ETestSuite(cfg))
}

Or refactor away from testify suite (#12332), leaving the SDK tests not customizable or importable by other chains, but increasing our testing speed.


ref #13913, #14145, #12332, stretchr/testify#187

@julienrbrt
Copy link
Member Author

It has been decided that we will proceed with the migration away from testify: #12332.

If there is enough demand, we will investigate how to make these tests reusable after the migration.

@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant