Skip to content

Commit

Permalink
Update CTF and SELECTED_NETWORKS env in E2E tests (#11103)
Browse files Browse the repository at this point in the history
* Update CTF and SELECTED_NETWORKS env

* Update go mod
  • Loading branch information
lukaszcl authored Oct 27, 2023
1 parent e6118da commit 12ff0e6
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion integration-tests/benchmark/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func getEnv(key, fallback string) string {

func SetupAutomationBenchmarkEnv(t *testing.T) (*environment.Environment, blockchain.EVMNetwork) {
l := logging.GetTestLogger(t)
testNetwork := networks.SelectedNetwork // Environment currently being used to run benchmark test on
testNetwork := networks.MustGetSelectedNetworksFromEnv()[0] // Environment currently being used to run benchmark test on
blockTime := "1"
networkDetailTOML := `MinIncomingConfirmations = 1`

Expand Down
11 changes: 6 additions & 5 deletions integration-tests/chaos/automation_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ListenAddresses = ["0.0.0.0:6690"]`

defaultAutomationSettings = map[string]interface{}{
"replicas": 6,
"toml": client.AddNetworksConfig(baseTOML, networks.SelectedNetwork),
"toml": client.AddNetworksConfig(baseTOML, networks.MustGetSelectedNetworksFromEnv()[0]),
"db": map[string]interface{}{
"stateful": true,
"capacity": "1Gi",
Expand All @@ -61,9 +61,10 @@ ListenAddresses = ["0.0.0.0:6690"]`
}

defaultEthereumSettings = &ethereum.Props{
NetworkName: networks.SelectedNetwork.Name,
Simulated: networks.SelectedNetwork.Simulated,
WsURLs: networks.SelectedNetwork.URLs,
// utils.MustGetSelectedNetworksFromEnv()
NetworkName: networks.MustGetSelectedNetworksFromEnv()[0].Name,
Simulated: networks.MustGetSelectedNetworksFromEnv()[0].Simulated,
WsURLs: networks.MustGetSelectedNetworksFromEnv()[0].URLs,
Values: map[string]interface{}{
"resources": map[string]interface{}{
"requests": map[string]interface{}{
Expand Down Expand Up @@ -182,7 +183,7 @@ func TestAutomationChaos(t *testing.T) {
testCase := tst
t.Run(fmt.Sprintf("Automation_%s", name), func(t *testing.T) {
t.Parallel()
network := networks.SelectedNetwork // Need a new copy of the network for each test
network := networks.MustGetSelectedNetworksFromEnv()[0] // Need a new copy of the network for each test

testEnvironment := environment.
New(&environment.Config{
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/chaos/ocr2vrf_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
func TestOCR2VRFChaos(t *testing.T) {
t.Parallel()
l := logging.GetTestLogger(t)
loadedNetwork := networks.SelectedNetwork
loadedNetwork := networks.MustGetSelectedNetworksFromEnv()[0]

defaultOCR2VRFSettings := map[string]interface{}{
"replicas": 6,
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestOCR2VRFChaos(t *testing.T) {
testCase := tc
t.Run(fmt.Sprintf("OCR2VRF_%s", testCaseName), func(t *testing.T) {
t.Parallel()
testNetwork := networks.SelectedNetwork // Need a new copy of the network for each test
testNetwork := networks.MustGetSelectedNetworksFromEnv()[0] // Need a new copy of the network for each test
testEnvironment := environment.
New(&environment.Config{
NamespacePrefix: fmt.Sprintf(
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/chaos/ocr_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
)

func TestMain(m *testing.M) {
defaultOCRSettings["toml"] = client.AddNetworksConfig(config.BaseOCRP2PV1Config, networks.SelectedNetwork)
defaultOCRSettings["toml"] = client.AddNetworksConfig(config.BaseOCRP2PV1Config, networks.MustGetSelectedNetworksFromEnv()[0])
os.Exit(m.Run())
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/docker/test_env/test_env_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) {
}
return b.te, nil
}
networkConfig := networks.SelectedNetwork
networkConfig := networks.MustGetSelectedNetworksFromEnv()[0]
var internalDockerUrls test_env.InternalDockerUrls
if b.hasGeth && networkConfig.Simulated {
networkConfig, internalDockerUrls, err = b.te.StartGeth()
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/segmentio/ksuid v1.0.4
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-env v0.38.3
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231018101901-23824db88d36
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231027132403-4898f11e80b6
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20231020123319-d255366a6545
github.com/smartcontractkit/ocr2keepers v0.7.27
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab0
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05/go.mod h1:o0Pn1pbaUluboaK6/yhf8xf7TiFCkyFl6WUOdwqamuU=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb h1:HiluOfEVGOQTM6BTDImOqYdMZZ7qq7fkZ3TJdmItNr8=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb/go.mod h1:/30flFG4L/iCYAFeA3DUzR0xuHSxAMONiWTzyzvsNwo=
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231018101901-23824db88d36 h1:ow84QG8vEHMvfjGg0RF8HNYh80WcHci6PIenXyY6K8Y=
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231018101901-23824db88d36/go.mod h1:RWlmjwnjIGbQAnRfKwe02Ife82nNI3rZmdI0zgkfbyk=
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231027132403-4898f11e80b6 h1:f1nUQ/1eUTMwNbOZK0P7P6OHvTDGQSn2KE+LtwY0rXA=
github.com/smartcontractkit/chainlink-testing-framework v1.17.12-0.20231027132403-4898f11e80b6/go.mod h1:RWlmjwnjIGbQAnRfKwe02Ife82nNI3rZmdI0zgkfbyk=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/functions/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type S4SecretsCfg struct {
}

func SetupLocalLoadTestEnv(cfg *PerformanceConfig) (*FunctionsTest, error) {
bc, err := blockchain.NewEVMClientFromNetwork(networks.SelectedNetwork, log.Logger)
bc, err := blockchain.NewEVMClientFromNetwork(networks.MustGetSelectedNetworksFromEnv()[0], log.Logger)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestCronPerformance(t *testing.T) {

func setupCronTest(t *testing.T) (testEnvironment *environment.Environment) {
logging.Init()
network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := ethereum.New(nil)
if !network.Simulated {
evmConfig = ethereum.New(&ethereum.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/directrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestDirectRequestPerformance(t *testing.T) {
}

func setupDirectRequestTest(t *testing.T) (testEnvironment *environment.Environment) {
network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := ethereum.New(nil)
if !network.Simulated {
evmConfig = ethereum.New(&ethereum.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/flux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestFluxPerformance(t *testing.T) {
}

func setupFluxTest(t *testing.T) (testEnvironment *environment.Environment, testNetwork blockchain.EVMNetwork) {
testNetwork = networks.SelectedNetwork
testNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
evmConf := ethereum.New(nil)
if !testNetwork.Simulated {
evmConf = ethereum.New(&ethereum.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func setupKeeperTest(
contracts.ContractDeployer,
contracts.LinkToken,
) {
network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := eth.New(nil)
if !network.Simulated {
evmConfig = eth.New(&eth.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/ocr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestOCRBasic(t *testing.T) {
}

func setupOCRTest(t *testing.T) (testEnvironment *environment.Environment, testNetwork blockchain.EVMNetwork) {
testNetwork = networks.SelectedNetwork
testNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := ethereum.New(nil)
if !testNetwork.Simulated {
evmConfig = ethereum.New(&ethereum.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/performance/vrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestVRFBasic(t *testing.T) {
}

func setupVRFTest(t *testing.T) (testEnvironment *environment.Environment, testNetwork blockchain.EVMNetwork) {
testNetwork = networks.SelectedNetwork
testNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := ethereum.New(nil)
if !testNetwork.Simulated {
evmConfig = ethereum.New(&ethereum.Props{
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/reorg/automation_reorg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ HistoryDepth = 400
[EVM.GasEstimator]
Mode = 'FixedPrice'
LimitDefault = 5_000_000`
activeEVMNetwork = networks.SelectedNetwork
activeEVMNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
defaultAutomationSettings = map[string]interface{}{
"toml": client.AddNetworkDetailedConfig(baseTOML, networkTOML, activeEVMNetwork),
"db": map[string]interface{}{
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestAutomationReorg(t *testing.T) {
for name, registryVersion := range registryVersions {
t.Run(name, func(t *testing.T) {
t.Parallel()
network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]

defaultAutomationSettings["replicas"] = numberOfNodes
cd := chainlink.New(0, defaultAutomationSettings)
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/smoke/automation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ var (

func TestMain(m *testing.M) {
logging.Init()
fmt.Printf("Running Smoke Test on %s\n", networks.SelectedNetwork.Name) // Print to get around disabled logging
fmt.Printf("Chainlink Image %s\n", os.Getenv("CHAINLINK_IMAGE")) // Print to get around disabled logging
fmt.Printf("Chainlink Version %s\n", os.Getenv("CHAINLINK_VERSION")) // Print to get around disabled logging
fmt.Printf("Running Smoke Test on %s\n", networks.MustGetSelectedNetworksFromEnv()[0].Name) // Print to get around disabled logging
fmt.Printf("Chainlink Image %s\n", os.Getenv("CHAINLINK_IMAGE")) // Print to get around disabled logging
fmt.Printf("Chainlink Version %s\n", os.Getenv("CHAINLINK_VERSION")) // Print to get around disabled logging
os.Exit(m.Run())
}

Expand Down Expand Up @@ -1028,7 +1028,7 @@ func setupAutomationTestDocker(
l := logging.GetTestLogger(t)
// Add registry version to config
registryConfig.RegistryVersion = registryVersion
network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]

// build the node config
clNodeConfig := node.NewConfig(node.NewBaseConfig())
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func setupOCR2Test(t *testing.T, forwardersEnabled bool) (
testEnvironment *environment.Environment,
testNetwork blockchain.EVMNetwork,
) {
testNetwork = networks.SelectedNetwork
testNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := ethereum.New(nil)
if !testNetwork.Simulated {
evmConfig = ethereum.New(&ethereum.Props{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/ocr2vrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestOCR2VRFFulfillmentModel(t *testing.T) {
}

func setupOCR2VRFEnvironment(t *testing.T) (testEnvironment *environment.Environment, testNetwork blockchain.EVMNetwork) {
testNetwork = networks.SelectedNetwork
testNetwork = networks.MustGetSelectedNetworksFromEnv()[0]
evmConfig := eth.New(nil)
if !testNetwork.Simulated {
evmConfig = eth.New(&eth.Props{
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/testsetups/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func NewOCRSoakTest(t *testing.T, forwarderFlow bool) (*OCRSoakTest, error) {

// DeployEnvironment deploys the test environment, starting all Chainlink nodes and other components for the test
func (o *OCRSoakTest) DeployEnvironment(customChainlinkNetworkTOML string) {
network := networks.SelectedNetwork // Environment currently being used to soak test on
network := networks.MustGetSelectedNetworksFromEnv()[0] // Environment currently being used to soak test on
nsPre := "soak-ocr-"
if o.OperatorForwarderFlow {
nsPre = fmt.Sprintf("%sforwarder-", nsPre)
Expand Down Expand Up @@ -165,7 +165,7 @@ func (o *OCRSoakTest) DeployEnvironment(customChainlinkNetworkTOML string) {
// LoadEnvironment loads an existing test environment using the provided URLs
func (o *OCRSoakTest) LoadEnvironment(chainlinkURLs []string, chainURL, mockServerURL string) {
var (
network = networks.SelectedNetwork
network = networks.MustGetSelectedNetworksFromEnv()[0]
err error
)
o.chainClient, err = blockchain.ConnectEVMClient(network, o.log)
Expand All @@ -185,7 +185,7 @@ func (o *OCRSoakTest) Environment() *environment.Environment {
func (o *OCRSoakTest) Setup() {
var (
err error
network = networks.SelectedNetwork
network = networks.MustGetSelectedNetworksFromEnv()[0]
)

// Environment currently being used to soak test on
Expand Down Expand Up @@ -387,7 +387,7 @@ func (o *OCRSoakTest) LoadState() error {
o.startTime = testState.StartTime
o.startingBlockNum = testState.StartingBlockNum

network := networks.SelectedNetwork
network := networks.MustGetSelectedNetworksFromEnv()[0]
o.chainClient, err = blockchain.ConnectEVMClient(network, o.log)
if err != nil {
return err
Expand Down

0 comments on commit 12ff0e6

Please sign in to comment.