Skip to content

upgrade integration tests #2669

@siggy

Description

@siggy

Introduce integration tests to validate linkerd upgrade.

The integration test should do the following:

  • install last stable
  • with current version, run linkerd upgrade
  • validate with linkerd check the control-plane is healthy

We should modify the existing auto-injected integration test:

run_test "$test_directory/install_test.go" "--proxy-auto-inject" || exit_code=$?

Proposal

bin/test-run

# fresh install of current branch
run_test "$test_directory/install_test.go" || exit_code=$?

# stable install
curl https://run.linkerd.io/install | sh
$HOME/.linkerd2/bin/linkerd --proxy-auto-inject

# upgrade to current branch
run_test "$test_directory/install_test.go" "--upgrade" || exit_code=$?

test/install_test.go

$ git diff
diff --git a/test/install_test.go b/test/install_test.go
index fd56898b..c87d233c 100644
--- a/test/install_test.go
+++ b/test/install_test.go
@@ -102,13 +102,20 @@ func TestCheckPreInstall(t *testing.T) {
 }

 func TestInstall(t *testing.T) {
-       cmd := []string{"install",
-               "--controller-log-level", "debug",
-               "--proxy-log-level", "warn,linkerd2_proxy=debug",
-               "--linkerd-version", TestHelper.GetVersion(),
-       }
-       if TestHelper.AutoInject() {
-               cmd = append(cmd, []string{"--proxy-auto-inject"}...)
+       cmd := []string{}
+       if !TestHelper.Upgrade() {
+               cmd = append(cmd, "install",
+                       "--controller-log-level", "debug",
+                       "--proxy-log-level", "warn,linkerd2_proxy=debug",
+                       "--linkerd-version", TestHelper.GetVersion(),
+               )
+       } else {
+               cmd = append(cmd, "upgrade",
+                       "--controller-log-level", "debug",
+                       "--proxy-log-level", "warn,linkerd2_proxy=debug",
+                       "--linkerd-version", TestHelper.GetVersion(),
+                       "--proxy-auto-inject",
+               )
                linkerdDeployReplicas["linkerd-proxy-injector"] = deploySpec{1, []string{"proxy-injector"}}
        }

Part of #2459

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions