Skip to content

Commit

Permalink
remove ths env variable check in e2e test suite setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jun 23, 2023
1 parent c755f6a commit 31fe0cc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sdkclient/tx/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ type Client struct {
}

// Initializes a cosmos sdk client context and transaction factory for
// signing and broadcasting transactions
// signing and broadcasting transactions by passing chainDataDir and remaining func arguments
// Note: For signing the transactions accounts are created by names like this val0, val1....
func NewClient(
chainDataDir,
chainID string,
chainID,
tmrpcEndpoint string,
mnemonics map[string]string,
gasAdjustment float64,
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/setup/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {
}

type chain struct {
DataDir string
dataDir string
ID string
Validators []*validator
Orchestrators []*orchestrator
Expand All @@ -55,12 +55,12 @@ func newChain() (*chain, error) {

return &chain{
ID: "chain-" + tmrand.NewRand().Str(6),
DataDir: tmpDir,
dataDir: tmpDir,
}, nil
}

func (c *chain) configDir() string {
return fmt.Sprintf("%s/%s", c.DataDir, c.ID)
return fmt.Sprintf("%s/%s", c.dataDir, c.ID)
}

func (c *chain) createAndInitValidators(cdc codec.Codec, count int) error {
Expand Down
20 changes: 13 additions & 7 deletions tests/e2e/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ type E2ETestSuite struct {
GravityContractAddr string
Umee client.Client
cdc codec.Codec
MinNetwork bool // MinNetwork defines which runs only validator wihtout price-feeder, gaia and ibc-relayer

}

func (s *E2ETestSuite) SetupSuite() {
Expand All @@ -74,7 +76,7 @@ func (s *E2ETestSuite) SetupSuite() {
s.Chain, err = newChain()
s.Require().NoError(err)

s.T().Logf("starting e2e infrastructure; chain-id: %s; datadir: %s", s.Chain.ID, s.Chain.DataDir)
s.T().Logf("starting e2e infrastructure; chain-id: %s; datadir: %s", s.Chain.ID, s.Chain.dataDir)

s.DkrPool, err = dockertest.NewPool("")
s.Require().NoError(err)
Expand Down Expand Up @@ -110,10 +112,12 @@ func (s *E2ETestSuite) SetupSuite() {
s.initGenesis()
s.initValidatorConfigs()
s.runValidators()
if str := os.Getenv("TEST_QA"); len(str) == 0 {
if !s.MinNetwork {
s.runPriceFeeder()
s.runGaiaNetwork()
s.runIBCRelayer()
} else {
s.T().Log("running minimum network withut gaia,price-feeder and ibc-relayer")
}
// s.runContractDeployment()
// s.runOrchestrators()
Expand All @@ -133,9 +137,11 @@ func (s *E2ETestSuite) TearDownSuite() {
s.T().Log("tearing down e2e integration test suite...")

// s.Require().NoError(s.DkrPool.Purge(s.ethResource))
s.Require().NoError(s.DkrPool.Purge(s.GaiaResource))
s.Require().NoError(s.DkrPool.Purge(s.HermesResource))
s.Require().NoError(s.DkrPool.Purge(s.priceFeederResource))
if !s.MinNetwork {
s.Require().NoError(s.DkrPool.Purge(s.GaiaResource))
s.Require().NoError(s.DkrPool.Purge(s.HermesResource))
s.Require().NoError(s.DkrPool.Purge(s.priceFeederResource))
}

for _, vc := range s.ValResources {
s.Require().NoError(s.DkrPool.Purge(vc))
Expand All @@ -147,7 +153,7 @@ func (s *E2ETestSuite) TearDownSuite() {

s.Require().NoError(s.DkrPool.RemoveNetwork(s.DkrNet))

os.RemoveAll(s.Chain.DataDir)
os.RemoveAll(s.Chain.dataDir)
for _, td := range s.tmpDirs {
os.RemoveAll(td)
}
Expand Down Expand Up @@ -1065,7 +1071,7 @@ func (s *E2ETestSuite) initUmeeClient() {
}
ecfg := app.MakeEncodingConfig()
s.Umee, err = client.NewClient(
s.Chain.DataDir,
s.Chain.dataDir,
s.Chain.ID,
"tcp://localhost:26657",
"tcp://localhost:9090",
Expand Down
6 changes: 3 additions & 3 deletions tests/qa/cw/cw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package cw
import (
"encoding/json"
"math/rand"
"os"
"strings"
"sync"
"testing"
Expand All @@ -32,9 +31,10 @@ var (
)

func TestQA(t *testing.T) {
os.Setenv("TEST_QA", "true")
t.Log("Running qa test...")
suite.Run(t, new(QATest))
qaTest := new(QATest)
qaTest.MinNetwork = true
suite.Run(t, qaTest)
}

func (qaTest *QATest) TestCWPlusGroup() {
Expand Down

0 comments on commit 31fe0cc

Please sign in to comment.