Skip to content

Commit

Permalink
Cleanup should be safer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-strzelczyk committed Jan 4, 2024
1 parent dec6989 commit df9b163
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions products/storage/metadata/storage_move_file.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ terraform = ["tf/storage_move_file/single_bucket_move.tf"]
command = "gsutil ls gs://$BUCKET_NAME/ | grep $NEW_FILE_NAME"

[tests.cleanup]
# Make sure the template is deleted. If the command can fail, use `|| true` to supress the failure.
# In this case, it WILL fail, if the test was successful, so we want to ignore this failure.
# Make sure the file is deleted. If the command can fail, use `|| true` to supress the failure.
# Since Terraform was used to set up the environment, it will be automatically used to clean up using
# `terraform destroy`. However, since some resources might no longer be under Terraform control, we have an option to
# execute some commands before `terraform destroy` takes place.

commands = ["gsutil rm -f gs://$BUCKET_NAME/$NEW_FILE_NAME"]
commands = ["gsutil rm -f gs://$BUCKET_NAME/$NEW_FILE_NAME || true"]

[tests.python]
# We can specify which versions of a language we want to test against.
Expand Down Expand Up @@ -114,7 +113,7 @@ terraform = ["tf/storage_move_file/move_between_buckets.tf"]
command = "gsutil ls gs://$NEW_BUCKET_NAME/ | grep $NEW_FILE_NAME"

[tests.cleanup]
commands = ["gsutil rm -f gs://$NEW_BUCKET_NAME/$NEW_FILE_NAME"]
commands = ["gsutil rm -f gs://$NEW_BUCKET_NAME/$NEW_FILE_NAME || true"]

[tests.python]
versions = ["3.8", "3.12"]
Expand Down

0 comments on commit df9b163

Please sign in to comment.