github.com/Finschia/finschia-sdk@v0.48.1/testutil/network/network_test.go (about)

     1  //go:build norace
     2  // +build norace
     3  
     4  package network_test
     5  
     6  import (
     7  	"testing"
     8  	"time"
     9  
    10  	"github.com/stretchr/testify/suite"
    11  
    12  	"github.com/Finschia/finschia-sdk/testutil/network"
    13  )
    14  
    15  type IntegrationTestSuite struct {
    16  	suite.Suite
    17  
    18  	network *network.Network
    19  }
    20  
    21  func (s *IntegrationTestSuite) SetupSuite() {
    22  	s.T().Log("setting up integration test suite")
    23  
    24  	s.network = network.New(s.T(), network.DefaultConfig())
    25  	s.Require().NotNil(s.network)
    26  
    27  	_, err := s.network.WaitForHeight(1)
    28  	s.Require().NoError(err)
    29  }
    30  
    31  func (s *IntegrationTestSuite) TearDownSuite() {
    32  	s.T().Log("tearing down integration test suite")
    33  	s.network.Cleanup()
    34  }
    35  
    36  func (s *IntegrationTestSuite) TestNetwork_Liveness() {
    37  	h, err := s.network.WaitForHeightWithTimeout(10, time.Minute)
    38  	s.Require().NoError(err, "expected to reach 10 blocks; got %d", h)
    39  }
    40  
    41  func TestIntegrationTestSuite(t *testing.T) {
    42  	suite.Run(t, new(IntegrationTestSuite))
    43  }