From a0a5b685f9d0b82d407d132b6c7997c24d1cfc84 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 17 Oct 2019 12:38:02 -0700 Subject: [PATCH 1/4] Move delete --all test so that it is run in serial --- test/integration/a_download_only_test.go | 14 ++++++++++---- test/integration/start_stop_delete_test.go | 5 ----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/integration/a_download_only_test.go b/test/integration/a_download_only_test.go index 8e311b9d527f..ff8869f23f1b 100644 --- a/test/integration/a_download_only_test.go +++ b/test/integration/a_download_only_test.go @@ -34,10 +34,8 @@ import ( "k8s.io/minikube/pkg/minikube/localpath" ) -// Note this test runs before all because filename is alphabetically first -// is used to cache images and binaries used by other parallel tests to avoid redownloading. -// TestDownloadOnly tests the --download-only option -func TestDownloadOnly(t *testing.T) { +// This test runs before others due to filename order. +func TestDownloadAndDeleteAll(t *testing.T) { profile := UniqueProfileName("download") ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) defer Cleanup(t, profile, cancel) @@ -79,5 +77,13 @@ func TestDownloadOnly(t *testing.T) { } }) } + t.Run("DeleteAll", func(t *testing.T) { + // This is a weird place to test profile deletion, but this test is serial, and we have an unneccesary profile to delete! + rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "--all")) + if err != nil { + t.Errorf("%s failed: %v", rr.Args, err) + } + }) }) + } diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 1ed1f6b676fe..bf575baeee7f 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -139,11 +139,6 @@ func TestStartStop(t *testing.T) { if err != nil { t.Errorf("%s failed: %v", rr.Args, err) } - - rr, err = Run(t, exec.CommandContext(ctx, Target(), "delete", "--all")) - if err != nil { - t.Errorf("%s failed: %v", rr.Args, err) - } }) } }) From f75c26e31e63c1bb88c378cf9c6c108ba8290ede Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 17 Oct 2019 12:40:52 -0700 Subject: [PATCH 2/4] Rename serial tests file --- test/integration/Untitled-1 | 0 test/integration/{a_download_only_test.go => a_serial_tests.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/integration/Untitled-1 rename test/integration/{a_download_only_test.go => a_serial_tests.go} (100%) diff --git a/test/integration/Untitled-1 b/test/integration/Untitled-1 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/integration/a_download_only_test.go b/test/integration/a_serial_tests.go similarity index 100% rename from test/integration/a_download_only_test.go rename to test/integration/a_serial_tests.go From 21aeec60eacf85d827ca0afc3aaf5b50bb489c67 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 17 Oct 2019 12:41:27 -0700 Subject: [PATCH 3/4] Remove obsolete comment --- test/integration/a_serial_tests.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/a_serial_tests.go b/test/integration/a_serial_tests.go index ff8869f23f1b..6a459602414d 100644 --- a/test/integration/a_serial_tests.go +++ b/test/integration/a_serial_tests.go @@ -16,7 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// a_download_only_test.go filename starts with a, for the purpose that it runs before all parallel tests and downloads the images and caches them. package integration import ( From e00868823947c0090aaaad860bf01100b5b6a373 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 17 Oct 2019 12:55:56 -0700 Subject: [PATCH 4/4] Fix comments --- test/integration/a_serial_tests.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/a_serial_tests.go b/test/integration/a_serial_tests.go index 6a459602414d..78dd73652557 100644 --- a/test/integration/a_serial_tests.go +++ b/test/integration/a_serial_tests.go @@ -33,7 +33,6 @@ import ( "k8s.io/minikube/pkg/minikube/localpath" ) -// This test runs before others due to filename order. func TestDownloadAndDeleteAll(t *testing.T) { profile := UniqueProfileName("download") ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) @@ -76,8 +75,8 @@ func TestDownloadAndDeleteAll(t *testing.T) { } }) } + // This is a weird place to test profile deletion, but this test is serial, and we have a profile to delete! t.Run("DeleteAll", func(t *testing.T) { - // This is a weird place to test profile deletion, but this test is serial, and we have an unneccesary profile to delete! rr, err := Run(t, exec.CommandContext(ctx, Target(), "delete", "--all")) if err != nil { t.Errorf("%s failed: %v", rr.Args, err)