Parcourir la source

Merge pull request #37090 from thaJeztah/de-noise-integration-cleanup

Make integration tests less noisy
Sebastiaan van Stijn il y a 7 ans
Parent
commit
b1efaeff61
1 fichiers modifiés avec 2 ajouts et 5 suppressions
  1. 2 5
      internal/test/environment/clean.go

+ 2 - 5
internal/test/environment/clean.go

@@ -25,7 +25,7 @@ type logT interface {
 // Clean the environment, preserving protected objects (images, containers, ...)
 // and removing everything else. It's meant to run after any tests so that they don't
 // depend on each others.
-func (e *Execution) Clean(t testingT) {
+func (e *Execution) Clean(t assert.TestingT) {
 	if ht, ok := t.(test.HelperT); ok {
 		ht.Helper()
 	}
@@ -112,7 +112,7 @@ func getAllContainers(ctx context.Context, t assert.TestingT, client client.Cont
 	return containers
 }
 
-func deleteAllImages(t testingT, apiclient client.ImageAPIClient, protectedImages map[string]struct{}) {
+func deleteAllImages(t assert.TestingT, apiclient client.ImageAPIClient, protectedImages map[string]struct{}) {
 	if ht, ok := t.(test.HelperT); ok {
 		ht.Helper()
 	}
@@ -123,15 +123,12 @@ func deleteAllImages(t testingT, apiclient client.ImageAPIClient, protectedImage
 	for _, image := range images {
 		tags := tagsFromImageSummary(image)
 		if len(tags) == 0 {
-			t.Logf("Removing image %s", image.ID)
 			removeImage(ctx, t, apiclient, image.ID)
 			continue
 		}
 		for _, tag := range tags {
 			if _, ok := protectedImages[tag]; !ok {
-				t.Logf("Removing image %s", tag)
 				removeImage(ctx, t, apiclient, tag)
-				continue
 			}
 		}
 	}