1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #38469 from olljanat/win-more-integration-tests

Windows CI: Enable more integration tests
This commit is contained in:
Sebastiaan van Stijn 2020-09-21 09:43:18 +02:00 committed by GitHub
commit 4ce3d71c1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 10 additions and 17 deletions

View file

@ -22,7 +22,6 @@ import (
) )
func TestBuildWithRemoveAndForceRemove(t *testing.T) { func TestBuildWithRemoveAndForceRemove(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
cases := []struct { cases := []struct {
@ -189,7 +188,6 @@ func TestBuildMultiStageCopy(t *testing.T) {
func TestBuildMultiStageParentConfig(t *testing.T) { func TestBuildMultiStageParentConfig(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions") skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions")
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
dockerfile := ` dockerfile := `
FROM busybox AS stage0 FROM busybox AS stage0
ENV WHO=parent ENV WHO=parent
@ -341,7 +339,6 @@ func TestBuildWithEmptyLayers(t *testing.T) {
// #35652 // #35652
func TestBuildMultiStageOnBuild(t *testing.T) { func TestBuildMultiStageOnBuild(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.33"), "broken in earlier versions") skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.33"), "broken in earlier versions")
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
// test both metadata and layer based commands as they may be implemented differently // test both metadata and layer based commands as they may be implemented differently
dockerfile := `FROM busybox AS stage1 dockerfile := `FROM busybox AS stage1
@ -448,7 +445,6 @@ COPY bar /`
// docker/for-linux#135 // docker/for-linux#135
// #35641 // #35641
func TestBuildMultiStageLayerLeak(t *testing.T) { 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") skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
ctx := context.TODO() ctx := context.TODO()
defer setupTest(t)() defer setupTest(t)()

View file

@ -22,7 +22,6 @@ import (
func TestCopyFromContainerPathDoesNotExist(t *testing.T) { func TestCopyFromContainerPathDoesNotExist(t *testing.T) {
defer setupTest(t)() defer setupTest(t)()
skip.If(t, testEnv.OSType == "windows")
ctx := context.Background() ctx := context.Background()
apiclient := testEnv.APIClient() apiclient := testEnv.APIClient()
@ -48,7 +47,6 @@ func TestCopyFromContainerPathIsNotDir(t *testing.T) {
func TestCopyToContainerPathDoesNotExist(t *testing.T) { func TestCopyToContainerPathDoesNotExist(t *testing.T) {
defer setupTest(t)() defer setupTest(t)()
skip.If(t, testEnv.OSType == "windows")
ctx := context.Background() ctx := context.Background()
apiclient := testEnv.APIClient() apiclient := testEnv.APIClient()

View file

@ -85,7 +85,6 @@ func TestExecWithCloseStdin(t *testing.T) {
func TestExec(t *testing.T) { func TestExec(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions") 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)() defer setupTest(t)()
ctx := context.Background() ctx := context.Background()
client := testEnv.APIClient() client := testEnv.APIClient()
@ -118,7 +117,11 @@ func TestExec(t *testing.T) {
assert.NilError(t, err) assert.NilError(t, err)
out := string(r) out := string(r)
assert.NilError(t, err) 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") assert.Assert(t, is.Contains(out, "FOO=BAR"), "exec command not running with expected environment variable FOO")
} }

View file

@ -30,7 +30,6 @@ func TestKillContainerInvalidSignal(t *testing.T) {
} }
func TestKillContainer(t *testing.T) { func TestKillContainer(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "TODO Windows: FIXME. No SIGWINCH")
defer setupTest(t)() defer setupTest(t)()
client := testEnv.APIClient() client := testEnv.APIClient()
@ -38,27 +37,32 @@ func TestKillContainer(t *testing.T) {
doc string doc string
signal string signal string
status string status string
skipOs string
}{ }{
{ {
doc: "no signal", doc: "no signal",
signal: "", signal: "",
status: "exited", status: "exited",
skipOs: "",
}, },
{ {
doc: "non killing signal", doc: "non killing signal",
signal: "SIGWINCH", signal: "SIGWINCH",
status: "running", status: "running",
skipOs: "windows",
}, },
{ {
doc: "killing signal", doc: "killing signal",
signal: "SIGTERM", signal: "SIGTERM",
status: "exited", status: "exited",
skipOs: "",
}, },
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc tc := tc
t.Run(tc.doc, func(t *testing.T) { t.Run(tc.doc, func(t *testing.T) {
skip.If(t, testEnv.OSType == tc.skipOs, "Windows does not support SIGWINCH")
ctx := context.Background() ctx := context.Background()
id := container.Run(ctx, t, client) id := container.Run(ctx, t, client)
err := client.ContainerKill(ctx, id, tc.signal) err := client.ContainerKill(ctx, id, tc.signal)

View file

@ -40,7 +40,6 @@ func TestNetworkNat(t *testing.T) {
} }
func TestNetworkLocalhostTCPNat(t *testing.T) { func TestNetworkLocalhostTCPNat(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
skip.If(t, testEnv.IsRemoteDaemon) skip.If(t, testEnv.IsRemoteDaemon)
defer setupTest(t)() defer setupTest(t)()

View file

@ -17,7 +17,6 @@ import (
) )
func TestResize(t *testing.T) { func TestResize(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
client := testEnv.APIClient() client := testEnv.APIClient()
ctx := context.Background() ctx := context.Background()

View file

@ -9,11 +9,9 @@ import (
"github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/container"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp" is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
) )
func TestRemoveImageOrphaning(t *testing.T) { func TestRemoveImageOrphaning(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
ctx := context.Background() ctx := context.Background()
client := testEnv.APIClient() client := testEnv.APIClient()

View file

@ -8,7 +8,6 @@ import (
"github.com/docker/docker/testutil" "github.com/docker/docker/testutil"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp" is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
) )
// tagging a named image in a new unprefixed repo should work // tagging a named image in a new unprefixed repo should work
@ -95,7 +94,6 @@ func TestTagExistedNameWithoutForce(t *testing.T) {
// ensure tagging using official names works // ensure tagging using official names works
// ensure all tags result in the same name // ensure all tags result in the same name
func TestTagOfficialNames(t *testing.T) { func TestTagOfficialNames(t *testing.T) {
skip.If(t, testEnv.OSType == "windows")
defer setupTest(t)() defer setupTest(t)()
client := testEnv.APIClient() client := testEnv.APIClient()
ctx := context.Background() ctx := context.Background()

View file

@ -16,7 +16,6 @@ import (
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp" is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
) )
func TestVolumesCreateAndList(t *testing.T) { func TestVolumesCreateAndList(t *testing.T) {
@ -61,7 +60,6 @@ func TestVolumesCreateAndList(t *testing.T) {
} }
func TestVolumesRemove(t *testing.T) { func TestVolumesRemove(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
client := testEnv.APIClient() client := testEnv.APIClient()
ctx := context.Background() ctx := context.Background()