Skip to content

Commit

Permalink
with supplied toml config
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Oct 10, 2023
1 parent 940d676 commit d5bf48a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
4 changes: 3 additions & 1 deletion integration-tests/ccip-tests/load-test.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export CCIP_NODE_CPU=2

export DETACH_RUNNER=true
export TEST_SUITE=load
export TEST_ARGS="-test.timeout 900h"
export TEST_ARGS="-test.timeout 900h"
# creates chainlink node with this toml config
#export CCIP_TOML_PATH="the toml config path"
25 changes: 19 additions & 6 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/types/config/node"
ccipnode "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/types/config/node"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
integrationnodes "github.com/smartcontractkit/chainlink/integration-tests/types/config/node"
)

const (
Expand Down Expand Up @@ -404,6 +405,20 @@ func NewCCIPTestConfig(t *testing.T, lggr zerolog.Logger, tType string) *CCIPTes
dbCPU, _ := utils.GetEnv("CCIP_DB_CPU")
DONDBResourceProfile["resources"] = SetResourceProfile("2", "4Gi", dbCPU, dbMem)

ccipTOML, _ := utils.GetEnv("CCIP_TOML_PATH")
if ccipTOML == "" {
tomlFile, err := os.Open(ccipTOML)
if err != nil {
allError = multierr.Append(allError, err)
} else {
defer tomlFile.Close()
_, err := tomlFile.Read(node.CCIPTOML)
if err != nil {
allError = multierr.Append(allError, err)
}
}
}

p := &CCIPTestConfig{
Test: t,
MsgType: actions.TokenTransfer,
Expand Down Expand Up @@ -1193,13 +1208,12 @@ func DeployLocalCluster(
}
}
}

configOpts := []integrationnodes.NodeConfigOpt{
node.WithPrivateEVMs(networks),
}
// a func to start the CL nodes asynchronously
deployCL := func() error {
toml, err := node.NewConfigFromToml(ccipnode.CCIPTOML,
node.WithPrivateEVMs(networks),
node.WithDBConnections(50, 50),
)
toml, err := node.NewConfigFromToml(ccipnode.CCIPTOML, configOpts...)
if err != nil {
return err
}
Expand Down Expand Up @@ -1290,7 +1304,6 @@ func DeployEnvironments(
tomlCfg, err := node.NewConfigFromToml(
ccipnode.CCIPTOML,
ccipnode.WithPrivateEVMs(nets),
node.WithDBConnections(50, 50),
)
tomlStr, err := tomlCfg.TOMLString()
require.NoError(t, err)
Expand Down
7 changes: 0 additions & 7 deletions integration-tests/ccip-tests/types/config/node/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ func NewConfigFromToml(tomlConfig []byte, opts ...node.NodeConfigOpt) (*chainlin
return &cfg, nil
}

func WithDBConnections(openConn, idleConn int64) node.NodeConfigOpt {
return func(c *chainlink.Config) {
c.Database.MaxIdleConns = itutils.Ptr(idleConn)
c.Database.MaxOpenConns = itutils.Ptr(openConn)
}
}

func WithPrivateEVMs(networks []blockchain.EVMNetwork) node.NodeConfigOpt {
var evmConfigs []*evmcfg.EVMConfig
for _, network := range networks {
Expand Down

0 comments on commit d5bf48a

Please sign in to comment.