From 0016ff9c15d0f66f91414936470e6914f0fdf6eb Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Tue, 22 May 2018 14:32:53 +0200 Subject: [PATCH] Fix e2e/system tests a setup step is required and the test fails. Signed-off-by: Vincent Demeester --- e2e/system/inspect_test.go | 4 +++- e2e/system/main_test.go | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 e2e/system/main_test.go diff --git a/e2e/system/inspect_test.go b/e2e/system/inspect_test.go index eb1e37d3df..aefab51606 100644 --- a/e2e/system/inspect_test.go +++ b/e2e/system/inspect_test.go @@ -11,6 +11,8 @@ func TestInspectInvalidReference(t *testing.T) { // This test should work on both Windows and Linux result := icmd.RunCmd(icmd.Command("docker", "inspect", "FooBar")) result.Assert(t, icmd.Expected{ - Out: "[]\nError: No such object: FooBar", + Out: "[]", + Err: "Error: No such object: FooBar", + ExitCode: 1, }) } diff --git a/e2e/system/main_test.go b/e2e/system/main_test.go new file mode 100644 index 0000000000..b154d1a191 --- /dev/null +++ b/e2e/system/main_test.go @@ -0,0 +1,17 @@ +package system + +import ( + "fmt" + "os" + "testing" + + "github.com/docker/cli/internal/test/environment" +) + +func TestMain(m *testing.M) { + if err := environment.Setup(); err != nil { + fmt.Println(err.Error()) + os.Exit(3) + } + os.Exit(m.Run()) +}