Skip to content

Commit 696f91f

Browse files
Tyler Titsworthclaynerobison
Tyler Titsworth
andauthored
No Docker TR Case (#101)
Signed-off-by: Tyler Titsworth <tyler.titsworth@intel.com> Co-authored-by: Clayne Robison <clayne.b.robison@intel.com>
1 parent 5db8ff7 commit 696f91f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test-runner/test_runner.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,16 @@ def get_test_list(args: dict, tests_yaml: List[dict]):
200200
# Switch logging context back to the initial state
201201
set_log_filename(logging.getLogger(), "test-runner", args.logs_path)
202202
# Remove remaining containers
203-
remaining_containers = docker.container.list()
204-
for container in remaining_containers:
205-
docker.stop(container, time=None)
203+
test_images = [expandvars(test.img) for test in tests if test.img]
204+
if test_images:
205+
remaining_containers = docker.container.list()
206+
for container in remaining_containers:
207+
docker.stop(container, time=None)
208+
docker.image.remove(test_images, force=True)
209+
logging.info("%d Images Removed", len(test_images))
206210
# Print Summary Table
207211
logging.info(
208212
"\n%s", tabulate(summary, headers=["#", "Test", "Status"], tablefmt="orgtbl")
209213
)
210-
test_images = [expandvars(test.img) for test in tests if test.img]
211-
docker.image.remove(test_images, force=True)
212-
logging.info("%d Images Removed", len(test_images))
213214
if ERROR:
214215
sys.exit(1)

0 commit comments

Comments
 (0)