From d5bf48a128d683f0bcd293574c690e738f93df7e Mon Sep 17 00:00:00 2001 From: AnieeG Date: Tue, 10 Oct 2023 16:29:35 -0700 Subject: [PATCH] with supplied toml config --- integration-tests/ccip-tests/load-test.env | 4 ++- .../ccip-tests/testsetups/ccip.go | 25 ++++++++++++++----- .../ccip-tests/types/config/node/core.go | 7 ------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/integration-tests/ccip-tests/load-test.env b/integration-tests/ccip-tests/load-test.env index b91f4b624c..a56a617a46 100644 --- a/integration-tests/ccip-tests/load-test.env +++ b/integration-tests/ccip-tests/load-test.env @@ -49,4 +49,6 @@ export CCIP_NODE_CPU=2 export DETACH_RUNNER=true export TEST_SUITE=load -export TEST_ARGS="-test.timeout 900h" \ No newline at end of file +export TEST_ARGS="-test.timeout 900h" +# creates chainlink node with this toml config +#export CCIP_TOML_PATH="the toml config path" \ No newline at end of file diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index 928779f94c..6582bb1210 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -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 ( @@ -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, @@ -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 } @@ -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) diff --git a/integration-tests/ccip-tests/types/config/node/core.go b/integration-tests/ccip-tests/types/config/node/core.go index 82a3b1dd22..1f9cb3dfe8 100644 --- a/integration-tests/ccip-tests/types/config/node/core.go +++ b/integration-tests/ccip-tests/types/config/node/core.go @@ -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 {