Skip to content

Commit

Permalink
integration tests: don't clean when KEEP_* flags true (#4400)
Browse files Browse the repository at this point in the history
When bumping to pycloudlib version 1!5.0.0, we gained the ability to
clean anything created by the Cloud instance, not just the Instance
instance. This commit ensures we don't do this when KEEP_ settings
are true.
  • Loading branch information
TheRealFalcon authored Aug 31, 2023
1 parent 06a6788 commit 8761fe8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/integration_tests/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ def get_instance(
return IntegrationInstance(self, cloud_instance, settings)

def destroy(self):
self.cloud_instance.clean()
if self.settings.KEEP_IMAGE or self.settings.KEEP_INSTANCE:
log.info(
"NOT cleaning cloud instance because KEEP_IMAGE or "
"KEEP_INSTANCE is True"
)
else:
self.cloud_instance.clean()

def snapshot(self, instance):
return self.cloud_instance.snapshot(instance, clean=True)
Expand Down

0 comments on commit 8761fe8

Please sign in to comment.