Keep the Daytona key rendering out of the test's assertion messages

CodeQL read the assertion messages as a log of the credentials'
Debug output. The test proves that output never holds the key, so the
messages added nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-09-19 18:05:01 -04:00
parent 53b9f91bc1
commit 399aef8111
No known key found for this signature in database

View file

@ -1041,9 +1041,11 @@ mod tests {
let credentials = DaytonaCredentials::from_api_key("dtn_secret_key".to_string(), |name| {
(name == EnvVars::DAYTONA_ORGANIZATION_ID).then(|| "org-1".to_string())
});
// The rendering stays out of the assertion messages: a failure must
// not print the key it is checking for.
let rendered = format!("{credentials:?}");
assert!(!rendered.contains("dtn_secret_key"), "{rendered}");
assert!(rendered.contains("org-1"), "{rendered}");
assert!(!rendered.contains("dtn_secret_key"));
assert!(rendered.contains("org-1"));
assert_eq!(
credentials.config().api_key.as_deref(),
Some("dtn_secret_key")