Skip to content

Commit

Permalink
[DEVSVCS-545] automation benchmark test remove support for keepers v1 (
Browse files Browse the repository at this point in the history
…#14472)

* Remove keepers v1.X support from benchmark test

* config cleanup

* update references
  • Loading branch information
anirudhwarrier authored Sep 18, 2024
1 parent 3f83f9e commit b1fdcd9
Show file tree
Hide file tree
Showing 9 changed files with 416 additions and 404 deletions.
4 changes: 2 additions & 2 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ runner-test-matrix:
test_env_vars:
TEST_SUITE: chaos

- id: benchmark/keeper_test.go:^TestAutomationBenchmark$
path: integration-tests/benchmark/keeper_test.go
- id: benchmark/automation_test.go:^TestAutomationBenchmark$
path: integration-tests/benchmark/automation_test.go
test_env_type: k8s-remote-runner
remote_runner_memory: 4Gi
runs_on: ubuntu-latest
Expand Down
12 changes: 11 additions & 1 deletion integration-tests/actions/automationv2/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,14 @@ func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctfTestEnv.K
}

func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) {
a.setupDeployment(t, true)
}

func (a *AutomationTest) SetupAutomationDeploymentWithoutJobs(t *testing.T) {
a.setupDeployment(t, false)
}

func (a *AutomationTest) setupDeployment(t *testing.T, addJobs bool) {
l := logging.GetTestLogger(t)
err := a.CollectNodeDetails()
require.NoError(t, err, "Error collecting node details")
Expand Down Expand Up @@ -891,7 +899,9 @@ func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) {
err = a.DeployRegistrar()
require.NoError(t, err, "Error deploying registrar contract")

a.AddJobsAndSetConfig(t)
if addJobs {
a.AddJobsAndSetConfig(t)
}
}

func (a *AutomationTest) LoadAutomationDeployment(t *testing.T, linkTokenAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ func TestAutomationBenchmark(t *testing.T) {
testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err, "Error getting test type")

config, err := tc.GetConfig([]string{testType}, tc.Keeper)
config, err := tc.GetConfig([]string{testType}, tc.Automation)
require.NoError(t, err, "Error getting test config")

testEnvironment, benchmarkNetwork := SetupAutomationBenchmarkEnv(t, &config)
if testEnvironment.WillUseRemoteRunner() {
return
}
networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "")
testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest)
testName := fmt.Sprintf("%s%s", networkName, *config.Automation.Benchmark.RegistryToTest)
l.Info().Str("Test Name", testName).Msg("Running Benchmark Test")
benchmarkTestNetwork := getNetworkConfig(&config)

Expand All @@ -105,7 +105,7 @@ func TestAutomationBenchmark(t *testing.T) {
CheckGasLimit: uint32(45_000_000), //45M
StalenessSeconds: big.NewInt(90_000),
GasCeilingMultiplier: uint16(2),
MaxPerformGas: uint32(*config.Keeper.Common.MaxPerformGas),
MaxPerformGas: uint32(*config.Automation.Benchmark.MaxPerformGas),
MinUpkeepSpend: big.NewInt(0),
FallbackGasPrice: big.NewInt(2e11),
FallbackLinkPrice: big.NewInt(2e18),
Expand All @@ -114,27 +114,20 @@ func TestAutomationBenchmark(t *testing.T) {
MaxRevertDataSize: uint32(5_000),
},
Upkeeps: &testsetups.UpkeepConfig{
NumberOfUpkeeps: *config.Keeper.Common.NumberOfUpkeeps,
CheckGasToBurn: *config.Keeper.Common.CheckGasToBurn,
PerformGasToBurn: *config.Keeper.Common.PerformGasToBurn,
BlockRange: *config.Keeper.Common.BlockRange,
BlockInterval: *config.Keeper.Common.BlockInterval,
UpkeepGasLimit: *config.Keeper.Common.UpkeepGasLimit,
NumberOfUpkeeps: *config.Automation.Benchmark.NumberOfUpkeeps,
CheckGasToBurn: *config.Automation.Benchmark.CheckGasToBurn,
PerformGasToBurn: *config.Automation.Benchmark.PerformGasToBurn,
BlockRange: *config.Automation.Benchmark.BlockRange,
BlockInterval: *config.Automation.Benchmark.BlockInterval,
UpkeepGasLimit: *config.Automation.Benchmark.UpkeepGasLimit,
FirstEligibleBuffer: 1,
},
Contracts: &testsetups.PreDeployedContracts{
RegistrarAddress: *config.Keeper.Common.RegistrarAddress,
RegistryAddress: *config.Keeper.Common.RegistryAddress,
LinkTokenAddress: *config.Keeper.Common.LinkTokenAddress,
EthFeedAddress: *config.Keeper.Common.EthFeedAddress,
GasFeedAddress: *config.Keeper.Common.GasFeedAddress,
},
ChainlinkNodeFunding: benchmarkTestNetwork.funding,
UpkeepSLA: benchmarkTestNetwork.upkeepSLA,
BlockTime: benchmarkTestNetwork.blockTime,
DeltaStage: benchmarkTestNetwork.deltaStage,
ForceSingleTxnKey: *config.Keeper.Common.ForceSingleTxKey,
DeleteJobsOnEnd: *config.Keeper.Common.DeleteJobsOnEnd,
ForceSingleTxnKey: *config.Automation.Benchmark.ForceSingleTxKey,
DeleteJobsOnEnd: *config.Automation.Benchmark.DeleteJobsOnEnd,
},
)
t.Cleanup(func() {
Expand All @@ -152,13 +145,7 @@ func TestAutomationBenchmark(t *testing.T) {
}

func addRegistry(config *tc.TestConfig) []ethcontracts.KeeperRegistryVersion {
switch *config.Keeper.Common.RegistryToTest {
case "1_1":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_1}
case "1_2":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_2}
case "1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_3}
switch *config.Automation.Benchmark.RegistryToTest {
case "2_0":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0}
case "2_1":
Expand All @@ -167,19 +154,14 @@ func addRegistry(config *tc.TestConfig) []ethcontracts.KeeperRegistryVersion {
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2}
case "2_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_3}
case "2_0-1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0, ethcontracts.RegistryVersion_1_3}
case "2_1-2_0-1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_1,
ethcontracts.RegistryVersion_2_0, ethcontracts.RegistryVersion_1_3}
case "2_2-2_1":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2, ethcontracts.RegistryVersion_2_1}
case "2_0-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_0, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_0, *config.Automation.Benchmark.NumberOfRegistries)
case "2_1-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_1, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_1, *config.Automation.Benchmark.NumberOfRegistries)
case "2_2-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_2, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_2, *config.Automation.Benchmark.NumberOfRegistries)
default:
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0}
}
Expand Down Expand Up @@ -275,13 +257,13 @@ var networkConfig = map[string]NetworkConfig{
},
}

func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) {
func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.AutomationBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) {
l := logging.GetTestLogger(t)
testNetwork := networks.MustGetSelectedNetworkConfig(keeperTestConfig.GetNetworkConfig())[0] // Environment currently being used to run benchmark test on
blockTime := "1"
numberOfNodes := *keeperTestConfig.GetKeeperConfig().Common.NumberOfNodes
numberOfNodes := *keeperTestConfig.GetAutomationConfig().General.NumberOfNodes

if strings.Contains(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest, "2_") {
if strings.Contains(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest, "2_") {
numberOfNodes++
}

Expand All @@ -295,7 +277,7 @@ func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenc
"automation-%s-%s-%s",
strings.ToLower(strings.Join(keeperTestConfig.GetConfigurationNames(), "")),
strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"),
strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest), "_", "-"),
strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest), "_", "-"),
),
Test: t,
PreventPodEviction: true,
Expand Down
Loading

0 comments on commit b1fdcd9

Please sign in to comment.