From 8f6fa99b49c8adcea950317d9e93fc82eae0c8f5 Mon Sep 17 00:00:00 2001 From: Jurj Andrei George Date: Wed, 11 Jan 2023 19:11:19 +0200 Subject: [PATCH] Skip failing Windows unit tests (volume) As discussed during the SIG Testing meeting on January 10, 2023, failing Windows unit tests are now skipped. These changes should be reverted when the unit tests wil get fixed. Mentioned SIG Testing meeting: https://docs.google.com/document/d/1z8MQpr_jTwhmjLMUaqQyBk1EYG_Y_3D4y4YdMJ7V1Kk/edit#heading=h.qwblxf2uhgoo --- pkg/volume/downwardapi/downwardapi_test.go | 6 ++++++ pkg/volume/flexvolume/probe_test.go | 15 +++++++++++++++ pkg/volume/local/local_test.go | 5 +++++ pkg/volume/rbd/rbd_test.go | 5 +++++ pkg/volume/util/hostutil/hostutil_test.go | 5 +++++ 5 files changed, 36 insertions(+) diff --git a/pkg/volume/downwardapi/downwardapi_test.go b/pkg/volume/downwardapi/downwardapi_test.go index 915f835c3b6..c6d80910351 100644 --- a/pkg/volume/downwardapi/downwardapi_test.go +++ b/pkg/volume/downwardapi/downwardapi_test.go @@ -21,6 +21,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "testing" "k8s.io/api/core/v1" @@ -72,6 +73,11 @@ func TestCanSupport(t *testing.T) { } func TestDownwardAPI(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if runtime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + labels1 := map[string]string{ "key1": "value1", "key2": "value2", diff --git a/pkg/volume/flexvolume/probe_test.go b/pkg/volume/flexvolume/probe_test.go index e79c4aaa70a..655c761987a 100644 --- a/pkg/volume/flexvolume/probe_test.go +++ b/pkg/volume/flexvolume/probe_test.go @@ -72,6 +72,11 @@ func TestProberExistingDriverBeforeInit(t *testing.T) { // Probes newly added drivers after prober is running. func TestProberAddRemoveDriver(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if goruntime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + // Arrange _, fs, watcher, prober := initTestEnvironment(t) prober.Probe() @@ -205,6 +210,11 @@ func TestEmptyPluginDir(t *testing.T) { // Issue an event to remove plugindir. New directory should still be watched. func TestRemovePluginDir(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if goruntime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + // Arrange driverPath, fs, watcher, _ := initTestEnvironment(t) err := fs.RemoveAll(pluginDir) @@ -226,6 +236,11 @@ func TestRemovePluginDir(t *testing.T) { // Issue an event to remove plugindir. New directory should still be watched. func TestNestedDriverDir(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if goruntime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + // Arrange _, fs, watcher, _ := initTestEnvironment(t) // Assert diff --git a/pkg/volume/local/local_test.go b/pkg/volume/local/local_test.go index bd47ab1f520..0a956aaf654 100644 --- a/pkg/volume/local/local_test.go +++ b/pkg/volume/local/local_test.go @@ -244,6 +244,11 @@ func TestInvalidLocalPath(t *testing.T) { } func TestBlockDeviceGlobalPathAndMountDevice(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if runtime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + // Block device global mount path testing tmpBlockDir, plug := getDeviceMountablePluginWithBlockPath(t, true) defer os.RemoveAll(tmpBlockDir) diff --git a/pkg/volume/rbd/rbd_test.go b/pkg/volume/rbd/rbd_test.go index ae84ecab936..2e0b608ddad 100644 --- a/pkg/volume/rbd/rbd_test.go +++ b/pkg/volume/rbd/rbd_test.go @@ -359,6 +359,11 @@ type testcase struct { } func TestPlugin(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if runtime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + tmpDir, err := utiltesting.MkTmpdir("rbd_test") if err != nil { t.Fatalf("error creating temp dir: %v", err) diff --git a/pkg/volume/util/hostutil/hostutil_test.go b/pkg/volume/util/hostutil/hostutil_test.go index 4e68c6f1a9a..886421d4f33 100644 --- a/pkg/volume/util/hostutil/hostutil_test.go +++ b/pkg/volume/util/hostutil/hostutil_test.go @@ -119,6 +119,11 @@ func createSocketFile(socketDir string) (string, error) { } func TestGetFileType(t *testing.T) { + // Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023 + if goruntime.GOOS == "windows" { + t.Skip("Skipping test that fails on Windows") + } + hu := NewHostUtil() testCase := []struct {