Skip to content

Commit

Permalink
Update upgrade 1.18 tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Apr 29, 2020
1 parent c4cd6f7 commit 88d7cd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
27 changes: 4 additions & 23 deletions pkg/upgrade/v1_18_0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,7 @@ import (
)

func TestUpgradeDeprecatedOptionsv1_18_0(t *testing.T) {
// Ugly hack to run 1.18.0 tests without assign latest version to 1.18
// we can remove once we migrate to semver or release 1.18
v1_17_1.next = &v1_18_0
versions["1.17.1"] = v1_17_0
latest = &v1_18_0
defer func() {
v1_17_1.next = nil
versions["1.17.1"] = v1_17_0
latest = &v1_17_0
}()

latestVersion := "1.18.0"
nsn := types.NamespacedName{Name: "my-instance"}
existing := v1.NewJaeger(nsn)
existing.Status.Version = "1.17.1"
Expand Down Expand Up @@ -55,7 +45,7 @@ func TestUpgradeDeprecatedOptionsv1_18_0(t *testing.T) {
cl := fake.NewFakeClient(objs...)

// test
assert.NoError(t, ManagedInstances(context.Background(), cl, cl))
assert.NoError(t, ManagedInstances(context.Background(), cl, cl, latestVersion))

// verify
persisted := &v1.Jaeger{}
Expand All @@ -76,16 +66,7 @@ func TestUpgradeDeprecatedOptionsv1_18_0(t *testing.T) {
}

func TestUpgradeAgentWithTChannelEnablev1_18_0_(t *testing.T) {
// Ugly hack to run 1.18.0 tests without assign latest version to 1.18
// we can remove once we migrate to semver or release 1.18
v1_17_1.next = &v1_18_0
versions["1.17.1"] = v1_17_0
latest = &v1_18_0
defer func() {
v1_17_1.next = nil
versions["1.17.1"] = v1_17_0
latest = &v1_17_0
}()
latestVersion := "1.18.0"
nsn := types.NamespacedName{Name: "my-instance"}
existing := v1.NewJaeger(nsn)
existing.Status.Version = "1.17.1"
Expand All @@ -106,7 +87,7 @@ func TestUpgradeAgentWithTChannelEnablev1_18_0_(t *testing.T) {
s.AddKnownTypes(v1.SchemeGroupVersion, &v1.JaegerList{})
cl := fake.NewFakeClient(objs...)

assert.NoError(t, ManagedInstances(context.Background(), cl, cl))
assert.NoError(t, ManagedInstances(context.Background(), cl, cl, latestVersion))

// verify
persisted := &v1.Jaeger{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/upgrade/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ var (
upgrades = map[string]upgradeFunction{
"1.15.0": upgrade1_15_0,
"1.17.0": upgrade1_17_0,
"1.18.0": upgrade1_18_0,
"1.18.0": upgrade1_18_0,
}
)

0 comments on commit 88d7cd7

Please sign in to comment.