-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add suite extension for the cli tests
- Loading branch information
Pantani
authored and
Pantani
committed
Oct 26, 2023
1 parent
f643ccd
commit 68af5e2
Showing
8 changed files
with
236 additions
and
205 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
ignite/templates/module/create/files/base/x/{{moduleName}}/client/cli/suite_test.go.plush
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package cli_test | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"<%= modulePath %>/testutil/network" | ||
) | ||
|
||
type IntegrationTestSuite struct { | ||
suite.Suite | ||
|
||
network *network.Network | ||
} | ||
|
||
func (s *IntegrationTestSuite) SetupSuite() { | ||
s.T().Log("setting up integration test suite") | ||
s.network = network.New(s.T(), network.DefaultConfig()) | ||
h, err := s.network.WaitForHeight(1) | ||
s.Require().NoError(err, "stalled at height %d", h) | ||
} | ||
|
||
func (s *IntegrationTestSuite) TearDownTest() { | ||
s.T().Log("tearing down test") | ||
s.network.Config = network.DefaultConfig() | ||
} | ||
|
||
func (s *IntegrationTestSuite) TearDownSuite() { | ||
s.T().Log("tearing down integration test suite") | ||
s.network.Cleanup() | ||
} | ||
|
||
func (s *IntegrationTestSuite) TestNetwork_Liveness() { | ||
h, err := s.network.WaitForHeightWithTimeout(10, time.Minute) | ||
s.Require().NoError(err, "expected to reach 10 blocks; got %d", h) | ||
} | ||
|
||
func TestIntegrationTestSuite(t *testing.T) { | ||
suite.Run(t, new(IntegrationTestSuite)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.