Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows CI: Enable more integration tests #38469

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions integration/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
)

func TestBuildWithRemoveAndForceRemove(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)()

cases := []struct {
Expand Down Expand Up @@ -189,7 +188,6 @@ func TestBuildMultiStageCopy(t *testing.T) {

func TestBuildMultiStageParentConfig(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions")
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
dockerfile := `
FROM busybox AS stage0
ENV WHO=parent
Expand Down Expand Up @@ -341,7 +339,6 @@ func TestBuildWithEmptyLayers(t *testing.T) {
// #35652
func TestBuildMultiStageOnBuild(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.33"), "broken in earlier versions")
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)()
// test both metadata and layer based commands as they may be implemented differently
dockerfile := `FROM busybox AS stage1
Expand Down Expand Up @@ -448,7 +445,6 @@ COPY bar /`
// docker/for-linux#135
// #35641
func TestBuildMultiStageLayerLeak(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
ctx := context.TODO()
defer setupTest(t)()
Expand Down
2 changes: 0 additions & 2 deletions integration/container/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

func TestCopyFromContainerPathDoesNotExist(t *testing.T) {
defer setupTest(t)()
skip.If(t, testEnv.OSType == "windows")

ctx := context.Background()
apiclient := testEnv.APIClient()
Expand All @@ -48,7 +47,6 @@ func TestCopyFromContainerPathIsNotDir(t *testing.T) {

func TestCopyToContainerPathDoesNotExist(t *testing.T) {
defer setupTest(t)()
skip.If(t, testEnv.OSType == "windows")

ctx := context.Background()
apiclient := testEnv.APIClient()
Expand Down
7 changes: 5 additions & 2 deletions integration/container/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func TestExecWithCloseStdin(t *testing.T) {

func TestExec(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions")
skip.If(t, testEnv.OSType == "windows", "FIXME. Probably needs to wait for container to be in running state.")
defer setupTest(t)()
ctx := context.Background()
client := testEnv.APIClient()
Expand Down Expand Up @@ -118,7 +117,11 @@ func TestExec(t *testing.T) {
assert.NilError(t, err)
out := string(r)
assert.NilError(t, err)
assert.Assert(t, is.Contains(out, "PWD=/tmp"), "exec command not running in expected /tmp working directory")
expected := "PWD=/tmp"
if testEnv.OSType == "windows" {
expected = "PWD=C:/tmp"
}
assert.Assert(t, is.Contains(out, expected), "exec command not running in expected /tmp working directory")
assert.Assert(t, is.Contains(out, "FOO=BAR"), "exec command not running with expected environment variable FOO")
}

Expand Down
6 changes: 5 additions & 1 deletion integration/container/kill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,39 @@ func TestKillContainerInvalidSignal(t *testing.T) {
}

func TestKillContainer(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "TODO Windows: FIXME. No SIGWINCH")
defer setupTest(t)()
client := testEnv.APIClient()

testCases := []struct {
doc string
signal string
status string
skipOs string
}{
{
doc: "no signal",
signal: "",
status: "exited",
skipOs: "",
},
{
doc: "non killing signal",
signal: "SIGWINCH",
status: "running",
skipOs: "windows",
},
{
doc: "killing signal",
signal: "SIGTERM",
status: "exited",
skipOs: "",
},
}

for _, tc := range testCases {
tc := tc
t.Run(tc.doc, func(t *testing.T) {
skip.If(t, testEnv.OSType == tc.skipOs, "Windows does not support SIGWINCH")
ctx := context.Background()
id := container.Run(ctx, t, client)
err := client.ContainerKill(ctx, id, tc.signal)
Expand Down
1 change: 0 additions & 1 deletion integration/container/nat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestNetworkNat(t *testing.T) {
}

func TestNetworkLocalhostTCPNat(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
skip.If(t, testEnv.IsRemoteDaemon)

defer setupTest(t)()
Expand Down
1 change: 0 additions & 1 deletion integration/container/resize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

func TestResize(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
defer setupTest(t)()
client := testEnv.APIClient()
ctx := context.Background()
Expand Down
2 changes: 0 additions & 2 deletions integration/image/remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import (
"github.com/docker/docker/integration/internal/container"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
)

func TestRemoveImageOrphaning(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)()
ctx := context.Background()
client := testEnv.APIClient()
Expand Down
2 changes: 0 additions & 2 deletions integration/image/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/docker/docker/testutil"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
)

// tagging a named image in a new unprefixed repo should work
Expand Down Expand Up @@ -95,7 +94,6 @@ func TestTagExistedNameWithoutForce(t *testing.T) {
// ensure tagging using official names works
// ensure all tags result in the same name
func TestTagOfficialNames(t *testing.T) {
skip.If(t, testEnv.OSType == "windows")
defer setupTest(t)()
client := testEnv.APIClient()
ctx := context.Background()
Expand Down
2 changes: 0 additions & 2 deletions integration/volume/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
)

func TestVolumesCreateAndList(t *testing.T) {
Expand Down Expand Up @@ -61,7 +60,6 @@ func TestVolumesCreateAndList(t *testing.T) {
}

func TestVolumesRemove(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
defer setupTest(t)()
client := testEnv.APIClient()
ctx := context.Background()
Expand Down