diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index d6ab22957a2..95a0d4c7d84 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -153,8 +153,15 @@ func (n *ClNode) UpgradeVersion(newImage, newVersion string) error { return fmt.Errorf("new version is empty") } if newImage == "" { - return fmt.Errorf("new image name is empty") + newImage = os.Getenv("CHAINLINK_IMAGE") } + n.l.Info(). + Str("Name", n.ContainerName). + Str("Old Image", os.Getenv("CHAINLINK_IMAGE")). + Str("Old Version", os.Getenv("CHAINLINK_VERSION")). + Str("New Image", newImage). + Str("New Version", newVersion). + Msg("Upgrading Chainlink Node") n.ContainerImage = newImage n.ContainerVersion = newVersion return n.Restart(n.NodeConfig) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 73e353c5c1b..f981f303402 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -45,9 +45,10 @@ require ( // avoids ambigious imports of indirect dependencies exclude github.com/hashicorp/consul v1.2.1 -// Pin K8s versions as their updates are highly disruptive and go mod keeps wanting to update them replace ( + // Required until https://github.com/testcontainers/testcontainers-go/pull/1971 is merged github.com/testcontainers/testcontainers-go => github.com/Tofel/testcontainers-go v0.0.0-20231130110817-e6fbf9498b56 + // Pin K8s versions as their updates are highly disruptive and go mod keeps wanting to update them k8s.io/api => k8s.io/api v0.25.11 k8s.io/client-go => k8s.io/client-go v0.25.11 k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d diff --git a/integration-tests/migration/upgrade_version_test.go b/integration-tests/migration/upgrade_version_test.go index 97db2374bf3..6603fc1685d 100644 --- a/integration-tests/migration/upgrade_version_test.go +++ b/integration-tests/migration/upgrade_version_test.go @@ -1,12 +1,12 @@ package migration import ( - "os" "testing" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-testing-framework/utils/osutil" + "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" ) @@ -14,6 +14,7 @@ func TestVersionUpgrade(t *testing.T) { t.Parallel() env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). + WithStandardCleanup(). WithGeth(). WithCLNodes(1). Build() @@ -23,16 +24,11 @@ func TestVersionUpgrade(t *testing.T) { require.NoError(t, err, "Error getting upgrade image") upgradeVersion, err := osutil.GetEnv("UPGRADE_VERSION") require.NoError(t, err, "Error getting upgrade version") - - _ = os.Setenv("CHAINLINK_IMAGE", upgradeImage) - _ = os.Setenv("CHAINLINK_VERSION", upgradeVersion) - - // just restarting CL container with the same name, DB is still the same - // // [Database] // MigrateOnStartup = true // // by default - err = env.ClCluster.Nodes[0].Restart(env.ClCluster.Nodes[0].NodeConfig) + err = env.ClCluster.Nodes[0].UpgradeVersion(upgradeImage, upgradeVersion) require.NoError(t, err) + }