Skip to content

Commit

Permalink
use chain-specific config in VRF tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Jun 27, 2024
1 parent d2dd49b commit f858a41
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions integration-tests/load/vrfv2/vrfv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestVRFV2Performance(t *testing.T) {
l := logging.GetTestLogger(t)
testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err)
testConfig, err := tc.GetConfig([]string{testType}, tc.VRFv2)
testConfig, err := tc.GetChainAndTestTypeSpecificConfig(testType, tc.VRFv2)
require.NoError(t, err)
cfgl := testConfig.Logging.Loki

Expand Down Expand Up @@ -188,7 +188,7 @@ func TestVRFV2BHSPerformance(t *testing.T) {

testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err)
testConfig, err := tc.GetConfig([]string{testType}, tc.VRFv2)
testConfig, err := tc.GetChainAndTestTypeSpecificConfig(testType, tc.VRFv2)
require.NoError(t, err)
vrfv2Config := testConfig.VRFv2
testReporter := &testreporters.VRFV2TestReporter{}
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/vrfv2plus/vrfv2plus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestVRFV2PlusPerformance(t *testing.T) {
l := logging.GetTestLogger(t)
testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err)
testConfig, err := tc.GetConfig([]string{testType}, tc.VRFv2Plus)
testConfig, err := tc.GetChainAndTestTypeSpecificConfig(testType, tc.VRFv2Plus)
require.NoError(t, err)
cfgl := testConfig.Logging.Loki

Expand Down Expand Up @@ -188,7 +188,7 @@ func TestVRFV2PlusBHSPerformance(t *testing.T) {

testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err)
testConfig, err := tc.GetConfig([]string{testType}, tc.VRFv2Plus)
testConfig, err := tc.GetChainAndTestTypeSpecificConfig(testType, tc.VRFv2Plus)
require.NoError(t, err)
vrfv2PlusConfig := testConfig.VRFv2Plus
testReporter := &testreporters.VRFV2PlusTestReporter{}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/vrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func TestVRFJobReplacement(t *testing.T) {
}

func prepareVRFtestEnv(t *testing.T, l zerolog.Logger) (*test_env.CLClusterTestEnv, *vrfv1.Contracts, *seth.Client) {
config, err := tc.GetConfig([]string{"Smoke"}, tc.VRF)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRF)
require.NoError(t, err, "Error getting config")

privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config)
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/smoke/vrfv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestVRFv2Basic(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
require.NoError(t, err, "Error getting config")
vrfv2Config := config.VRFv2
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -569,7 +569,7 @@ func TestVRFv2MultipleSendingKeys(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -677,7 +677,7 @@ func TestVRFOwner(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
require.NoError(t, err, "Error getting config")
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
vrfv2Config := config.VRFv2
Expand Down Expand Up @@ -813,7 +813,7 @@ func TestVRFV2WithBHS(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
require.NoError(t, err, "Error getting config")
vrfv2Config := config.VRFv2
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1031,7 +1031,7 @@ func TestVRFV2NodeReorg(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
require.NoError(t, err, "Error getting config")
vrfv2Config := config.VRFv2
network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0]
Expand Down Expand Up @@ -1210,7 +1210,7 @@ func TestVRFv2BatchFulfillmentEnabledDisabled(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2)
require.NoError(t, err, "Error getting config")
vrfv2Config := config.VRFv2
network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0]
Expand Down
21 changes: 9 additions & 12 deletions integration-tests/smoke/vrfv2plus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ func TestVRFv2Plus(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")

config, err = tc.GetConfig([]string{"Smoke", config.GetNetworkConfig().SelectedNetworks[0], config.GetNetworkConfig().SelectedNetworks[0] + "-Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")

vrfv2PlusConfig := config.VRFv2Plus
Expand Down Expand Up @@ -750,7 +747,7 @@ func TestVRFv2PlusMultipleSendingKeys(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -855,7 +852,7 @@ func TestVRFv2PlusMigration(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1249,7 +1246,7 @@ func TestVRFV2PlusWithBHS(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1478,7 +1475,7 @@ func TestVRFV2PlusWithBHF(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1635,7 +1632,7 @@ func TestVRFv2PlusReplayAfterTimeout(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1804,7 +1801,7 @@ func TestVRFv2PlusPendingBlockSimulationAndZeroConfirmationDelays(t *testing.T)
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
chainID := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0].ChainID
Expand Down Expand Up @@ -1898,7 +1895,7 @@ func TestVRFv2PlusNodeReorg(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0]
Expand Down Expand Up @@ -2075,7 +2072,7 @@ func TestVRFv2PlusBatchFulfillmentEnabledDisabled(t *testing.T) {
)
l := logging.GetTestLogger(t)

config, err := tc.GetConfig([]string{"Smoke"}, tc.VRFv2Plus)
config, err := tc.GetChainAndTestTypeSpecificConfig("Smoke", tc.VRFv2Plus)
require.NoError(t, err, "Error getting config")
vrfv2PlusConfig := config.VRFv2Plus
network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0]
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/testconfig/testconfig_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ selected_networks=`
return fmt.Errorf(finalErrStr)
}

func GetChainAndTestTypeSpecificConfig(product Product, testType string) (TestConfig, error) {
func GetChainAndTestTypeSpecificConfig(testType string, product Product) (TestConfig, error) {
config, err := GetConfig([]string{testType}, product)
if err != nil {
return TestConfig{}, fmt.Errorf("error getting config: %w", err)
Expand Down

0 comments on commit f858a41

Please sign in to comment.