From 2a9a982ae36cb0d4186b1e19259c990c62e29f6c Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Wed, 9 Oct 2019 10:48:45 -0700 Subject: [PATCH] Fix integration test for golang 1.13 Signed-off-by: Lantao Liu --- integration/{test_utils.go => main_test.go} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename integration/{test_utils.go => main_test.go} (99%) diff --git a/integration/test_utils.go b/integration/main_test.go similarity index 99% rename from integration/test_utils.go rename to integration/main_test.go index 869b46355..7993bd4ac 100644 --- a/integration/test_utils.go +++ b/integration/main_test.go @@ -22,6 +22,7 @@ import ( "flag" "fmt" "net" + "os" "os/exec" "strconv" "strings" @@ -63,11 +64,12 @@ var criRoot = flag.String("cri-root", "/var/lib/containerd/io.containerd.grpc.v1 var runtimeHandler = flag.String("runtime-handler", "", "The runtime handler to use in the test.") var containerdBin = flag.String("containerd-bin", "containerd", "The containerd binary name. The name is used to restart containerd during test.") -func init() { +func TestMain(m *testing.M) { flag.Parse() if err := ConnectDaemons(); err != nil { logrus.WithError(err).Fatalf("Failed to connect daemons") } + os.Exit(m.Run()) } // ConnectDaemons connect cri plugin and containerd, and initialize the clients.