Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleanup of secrets in tests #9254

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,8 @@ with_retries ~action =
if i % 10 == 0 then
IO.println "Still failing after "+i.to_text+" retries. ("+loc.to_display_text+")"
Thread.sleep (1000*sleep_time . floor)
@Tail_Call go (i+1)
## TODO This used to be
@Tail_Call go (i+1)
We should re-add the tail call once https://github.com/enso-org/enso/issues/9251 is fixed.
go (i+1)
go 1
13 changes: 8 additions & 5 deletions test/Base_Tests/src/Network/Enso_Cloud/Secrets_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ add_specs suite_builder setup:Cloud_Tests_Setup = setup.with_prepared_environmen
my_secret.name . should_equal "my_test_secret"
my_secret.id.is_empty . should_be_false

with_retries <|
delete_on_fail my_secret <| with_retries <|
Enso_Secret.list . should_contain my_secret

my_secret.delete . should_succeed
Expand Down Expand Up @@ -155,10 +155,7 @@ add_specs suite_builder setup:Cloud_Tests_Setup = setup.with_prepared_environmen
nested_secret = Enso_Secret.create "my-nested-secret-1" "NESTED_secret_value" parent=subdirectory
nested_secret.should_succeed

delete_on_fail caught_panic =
nested_secret.delete
Panic.throw caught_panic
Panic.catch Any handler=delete_on_fail <|
delete_on_fail nested_secret <|
with_retries <|
Enso_Secret.list parent=subdirectory . should_contain nested_secret
Enso_Secret.exists "my-nested-secret-1" parent=subdirectory . should_be_true
Expand Down Expand Up @@ -236,3 +233,9 @@ main filter=Nothing =

wait_until_secret_is_propagated secret =
with_retries <| Enso_Secret.list . should_contain secret

delete_on_fail resource ~action =
on_failure caught_panic =
resource.delete
Panic.throw caught_panic
Panic.catch Any handler=on_failure action
Loading