From 2bd34bda9543c1b66f53eaf26706f0de887db187 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Mon, 30 Nov 2020 10:20:15 -0600 Subject: Delete image snapshots created for integration tests (#682) Integration tests have been leaving behind snapshot images, so now we clean them up. Also, in testing, found that in Azure, deleting a resource group will automatically delete the instance, so if KEEP_INSTANCE is True, we no longer delete the resource group. Co-authored-by: Daniel Watkins --- tests/integration_tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/integration_tests/conftest.py') diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index 6e1465be..d7e0fca2 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -81,7 +81,10 @@ def session_cloud(): cloud = platforms[integration_settings.PLATFORM]() cloud.emit_settings_to_log() yield cloud - cloud.destroy() + try: + cloud.delete_snapshot() + finally: + cloud.destroy() @pytest.fixture(scope='session', autouse=True) -- cgit v1.2.3