-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Open
Open
Copy link
Labels
area/testingexp/beginnerexp/intermediatekind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.status/claimed
Description
Creating a tracking issue for #36538 (comment)
We should update testenv.ProtectAll() and testenv.Clean() to also cleanup services, so that integration-tests don't have to clean up services after running the tests.
Similar to the way containers, networks, and other resources are currently handled;
moby/internal/test/environment/protect.go
Lines 32 to 43 in 3e0299f
| // ProtectAll protects the existing environment (containers, images, networks, | |
| // volumes, and, on Linux, plugins) from being cleaned up at the end of test | |
| // runs | |
| func ProtectAll(t testingT, testEnv *Execution) { | |
| ProtectContainers(t, testEnv) | |
| ProtectImages(t, testEnv) | |
| ProtectNetworks(t, testEnv) | |
| ProtectVolumes(t, testEnv) | |
| if testEnv.OSType == "linux" { | |
| ProtectPlugins(t, testEnv) | |
| } | |
| } |
moby/internal/test/environment/clean.go
Lines 25 to 42 in 3e0299f
| // 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) { | |
| client := e.APIClient() | |
| platform := e.OSType | |
| if (platform != "windows") || (platform == "windows" && e.DaemonInfo.Isolation == "hyperv") { | |
| unpauseAllContainers(t, client) | |
| } | |
| deleteAllContainers(t, client, e.protectedElements.containers) | |
| deleteAllImages(t, client, e.protectedElements.images) | |
| deleteAllVolumes(t, client, e.protectedElements.volumes) | |
| deleteAllNetworks(t, client, platform, e.protectedElements.networks) | |
| if platform == "linux" { | |
| deleteAllPlugins(t, client, e.protectedElements.plugins) | |
| } | |
| } |
labelling with both "beginner" and "intermediate"; it's probably somewhere in between 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/testingexp/beginnerexp/intermediatekind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.status/claimed