From b2d3473cba436375cfcb3f6175a246ba0beba957 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Tue, 28 Jul 2020 03:24:31 +1000 Subject: [PATCH] Skip tests on Windows that attempt to bind-mount read-only Containerd's mounter doesn't yet support bind-mounts on Windows. BuildKit short-cuts this for read-write mounts, but not read-only mounts. Signed-off-by: Paul "TBBle" Hampson --- cache/contenthash/checksum_test.go | 6 ++++++ cache/manager_test.go | 9 +++++++++ source/http/httpsource_test.go | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/cache/contenthash/checksum_test.go b/cache/contenthash/checksum_test.go index 3035e53c9..2c7eae4be 100644 --- a/cache/contenthash/checksum_test.go +++ b/cache/contenthash/checksum_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "strings" "testing" "time" @@ -858,6 +859,11 @@ func TestPersistence(t *testing.T) { } func createRef(t *testing.T, cm cache.Manager, files []string) cache.ImmutableRef { + if runtime.GOOS == "windows" && len(files) > 0 { + // lm.Mount() will fail + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + mref, err := cm.New(context.TODO(), nil, cache.CachePolicyRetain) require.NoError(t, err) diff --git a/cache/manager_test.go b/cache/manager_test.go index 9441de78a..c1d1276a9 100644 --- a/cache/manager_test.go +++ b/cache/manager_test.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "testing" "github.com/containerd/containerd/content" @@ -269,6 +270,10 @@ func TestManager(t *testing.T) { } func TestSnapshotExtract(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") @@ -405,6 +410,10 @@ func TestSnapshotExtract(t *testing.T) { } func TestExtractOnMutable(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") diff --git a/source/http/httpsource_test.go b/source/http/httpsource_test.go index 07bafed5c..ad294c8c8 100644 --- a/source/http/httpsource_test.go +++ b/source/http/httpsource_test.go @@ -5,6 +5,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "testing" "github.com/containerd/containerd/content/local" @@ -25,6 +26,10 @@ import ( ) func TestHTTPSource(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + t.Parallel() ctx := context.TODO() @@ -139,6 +144,10 @@ func TestHTTPSource(t *testing.T) { } func TestHTTPDefaultName(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + t.Parallel() ctx := context.TODO() @@ -212,6 +221,10 @@ func TestHTTPInvalidURL(t *testing.T) { } func TestHTTPChecksum(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Depends on unimplemented containerd bind-mount support on Windows") + } + t.Parallel() ctx := context.TODO()