Skip to content

Commit 26833e7

Browse files
test(features): report Keycloak suite cleanup failures
The provider and profile cleanup discarded both errors and failed exit codes, so leftovers went unnoticed. Print them without failing the test. Signed-off-by: Matthew Grossman <[email protected]>
1 parent cfd757e commit 26833e7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎tests/suites/features/keycloak-provider-refresh/tests/provider_refresh.rs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,15 @@ async fn revoked_refresh_grant_requires_user_reauthorization(cx: &mut Context) -
119119
// testkit cleans up sandboxes, not providers or profiles, so remove them
120120
// here whether or not the test passed. A panic or a killed test process
121121
// skips this; the names are unique to the run, so leftovers don't collide.
122-
let _ = kc.cli(["provider", "delete", &provider]).await;
123-
let _ = kc.cli(["profile", "delete", &profile_id]).await;
122+
// A failed cleanup doesn't fail the test, but it is reported.
123+
for args in [
124+
["provider", "delete", provider.as_str()],
125+
["profile", "delete", profile_id.as_str()],
126+
] {
127+
if let Err(error) = kc.cli(args).await.and_then(CliOutput::success) {
128+
eprintln!("cleanup failed: {error}");
129+
}
130+
}
124131
result
125132
}
126133

0 commit comments

Comments
 (0)