From d9d58542e2e926e67c41aa6c2aff62f78b21d03a Mon Sep 17 00:00:00 2001 From: Anirudh Warrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Tue, 23 Jan 2024 22:48:13 +0400 Subject: [PATCH] fix automation tests (#11815) * fix automation benchmark test action * update default toml * try newer run tests action * another try * look for .root_dir even deeper * Update integration-tests/benchmark/keeper_test.go * Update integration-tests/test.Dockerfile --------- Co-authored-by: Bartek Tofel --- .../workflows/automation-benchmark-tests.yml | 7 ++ integration-tests/benchmark/keeper_test.go | 4 +- integration-tests/test.Dockerfile | 1 - .../testconfig/automation/automation.toml | 2 - integration-tests/testconfig/keeper/config.go | 72 +++++++------------ .../testconfig/keeper/keeper.toml | 2 +- 6 files changed, 37 insertions(+), 51 deletions(-) diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index ca317fd220a..740975ae5ee 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -2,6 +2,11 @@ name: Automation Benchmark Test on: workflow_dispatch: inputs: + testType: + description: Type of test to run (benchmark, soak) + required: true + default: benchmark + type: string base64Config: description: base64-ed config required: true @@ -68,6 +73,8 @@ jobs: TEST_ARGS: -test.timeout 720h ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com + TEST_TYPE: ${{ github.event.inputs.testType }} + TEST_TEST_TYPE: ${{ github.event.inputs.testType }} with: test_command_to_run: cd integration-tests && go test -timeout 30m -v -run ^TestAutomationBenchmark$ ./benchmark -count=1 test_download_vendor_packages_command: make gomod diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go index 2c06da56aaa..12a7e4c75aa 100644 --- a/integration-tests/benchmark/keeper_test.go +++ b/integration-tests/benchmark/keeper_test.go @@ -134,7 +134,7 @@ func TestAutomationBenchmark(t *testing.T) { } networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "") testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest) - l.Info().Str("Test Name", testName).Strs("Test Inputs", config.Keeper.Common.TestInputs).Msg("Running Benchmark Test") + l.Info().Str("Test Name", testName).Msg("Running Benchmark Test") benchmarkTestNetwork := getNetworkConfig(networkName, &config) l.Info().Str("Namespace", testEnvironment.Cfg.Namespace).Msg("Connected to Keepers Benchmark Environment") @@ -314,7 +314,7 @@ func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenc TTL: time.Hour * 720, // 30 days, NamespacePrefix: fmt.Sprintf( "automation-%s-%s-%s", - keeperTestConfig.GetConfigurationName(), + strings.ToLower(keeperTestConfig.GetConfigurationName()), strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"), strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest), "_", "-"), ), diff --git a/integration-tests/test.Dockerfile b/integration-tests/test.Dockerfile index 69c04078826..fc6eefd650c 100644 --- a/integration-tests/test.Dockerfile +++ b/integration-tests/test.Dockerfile @@ -7,5 +7,4 @@ ARG SUITES=chaos migration performance reorg smoke soak benchmark COPY . testdir/ WORKDIR /go/testdir RUN /go/testdir/integration-tests/scripts/buildTests "${SUITES}" -RUN touch .root_dir ENTRYPOINT ["/go/testdir/integration-tests/scripts/entrypoint"] diff --git a/integration-tests/testconfig/automation/automation.toml b/integration-tests/testconfig/automation/automation.toml index 2e1f3a0dd70..58b95f9b4cc 100644 --- a/integration-tests/testconfig/automation/automation.toml +++ b/integration-tests/testconfig/automation/automation.toml @@ -8,7 +8,6 @@ chainlink_node_funding = 0.5 number_of_nodes=6 duration=100 block_time=1 -number_of_events=1 spec_type="minimum" chainlink_node_log_level="info" use_prometheus=false @@ -22,7 +21,6 @@ chainlink_node_funding = 100 number_of_nodes=6 duration=900 block_time=1 -number_of_events=1 spec_type="minimum" chainlink_node_log_level="info" use_prometheus=false diff --git a/integration-tests/testconfig/keeper/config.go b/integration-tests/testconfig/keeper/config.go index beb963b8ded..da6cd7acc98 100644 --- a/integration-tests/testconfig/keeper/config.go +++ b/integration-tests/testconfig/keeper/config.go @@ -2,8 +2,6 @@ package keeper import ( "errors" - - "github.com/smartcontractkit/chainlink-testing-framework/utils/net" ) type Config struct { @@ -18,24 +16,23 @@ func (c *Config) Validate() error { } type Common struct { - RegistryToTest *string `toml:"registry_to_test"` - NumberOfRegistries *int `toml:"number_of_registries"` - NumberOfNodes *int `toml:"number_of_nodes"` - NumberOfUpkeeps *int `toml:"number_of_upkeeps"` - UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"` - CheckGasToBurn *int64 `toml:"check_gas_to_burn"` - PerformGasToBurn *int64 `toml:"perform_gas_to_burn"` - MaxPerformGas *int64 `toml:"max_perform_gas"` - BlockRange *int64 `toml:"block_range"` - BlockInterval *int64 `toml:"block_interval"` - ForceSingleTxKey *bool `toml:"forces_single_tx_key"` - DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"` - RegistryAddress *string `toml:"registry_address"` - RegistrarAddress *string `toml:"registrar_address"` - LinkTokenAddress *string `toml:"link_token_address"` - EthFeedAddress *string `toml:"eth_feed_address"` - GasFeedAddress *string `toml:"gas_feed_address"` - TestInputs []string `toml:"test_inputs"` + RegistryToTest *string `toml:"registry_to_test"` + NumberOfRegistries *int `toml:"number_of_registries"` + NumberOfNodes *int `toml:"number_of_nodes"` + NumberOfUpkeeps *int `toml:"number_of_upkeeps"` + UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"` + CheckGasToBurn *int64 `toml:"check_gas_to_burn"` + PerformGasToBurn *int64 `toml:"perform_gas_to_burn"` + MaxPerformGas *int64 `toml:"max_perform_gas"` + BlockRange *int64 `toml:"block_range"` + BlockInterval *int64 `toml:"block_interval"` + ForceSingleTxKey *bool `toml:"forces_single_tx_key"` + DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"` + RegistryAddress *string `toml:"registry_address"` + RegistrarAddress *string `toml:"registrar_address"` + LinkTokenAddress *string `toml:"link_token_address"` + EthFeedAddress *string `toml:"eth_feed_address"` + GasFeedAddress *string `toml:"gas_feed_address"` } func (c *Common) Validate() error { @@ -69,35 +66,20 @@ func (c *Common) Validate() error { if c.BlockInterval == nil || *c.BlockInterval <= 0 { return errors.New("block_interval must be a positive integer") } - if c.RegistryAddress == nil || *c.RegistryAddress == "" { - return errors.New("registry_address must be set") - } - if !net.IsValidURL(*c.RegistryAddress) { - return errors.New("registry_address must be a valid address") - } - if c.RegistrarAddress == nil || *c.RegistrarAddress == "" { - return errors.New("registrar_address must be set") - } - if !net.IsValidURL(*c.RegistrarAddress) { - return errors.New("registrar_address must be a valid address") - } - if c.LinkTokenAddress == nil || *c.LinkTokenAddress == "" { - return errors.New("link_token_address must be set") - } - if !net.IsValidURL(*c.LinkTokenAddress) { - return errors.New("link_token_address must be a valid address") + if c.RegistryAddress == nil { + c.RegistryAddress = new(string) } - if c.EthFeedAddress == nil || *c.EthFeedAddress == "" { - return errors.New("eth_feed_address must be set") + if c.RegistrarAddress == nil { + c.RegistrarAddress = new(string) } - if !net.IsValidURL(*c.EthFeedAddress) { - return errors.New("eth_feed_address must be a valid address") + if c.LinkTokenAddress == nil { + c.LinkTokenAddress = new(string) } - if c.GasFeedAddress == nil || *c.GasFeedAddress == "" { - return errors.New("gas_feed_address must be set") + if c.EthFeedAddress == nil { + c.EthFeedAddress = new(string) } - if !net.IsValidURL(*c.GasFeedAddress) { - return errors.New("gas_feed_address must be a valid address") + if c.GasFeedAddress == nil { + c.GasFeedAddress = new(string) } return nil } diff --git a/integration-tests/testconfig/keeper/keeper.toml b/integration-tests/testconfig/keeper/keeper.toml index 5ba2ab85d02..516dbb35a63 100644 --- a/integration-tests/testconfig/keeper/keeper.toml +++ b/integration-tests/testconfig/keeper/keeper.toml @@ -7,7 +7,7 @@ registry_to_test = "2_1" number_of_registries = 1 number_of_nodes = 6 number_of_upkeeps = 500 -upkeep_gas_limit = 150000 +upkeep_gas_limit = 1500000 check_gas_to_burn = 100000 perform_gas_to_burn = 50000 max_perform_gas = 5000000