chore: Remove blocking read strings

This commit is contained in:
Jayson Reis 2026-02-18 15:52:07 +00:00 committed by Chummy
parent bc0be9a3c1
commit b9af601943
26 changed files with 331 additions and 243 deletions

View file

@ -335,8 +335,8 @@ mod tests {
// ── §8.1 Log rotation tests ─────────────────────────────
#[test]
fn audit_logger_writes_event_when_enabled() -> Result<()> {
#[tokio::test]
async fn audit_logger_writes_event_when_enabled() -> Result<()> {
let tmp = TempDir::new()?;
let config = AuditConfig {
enabled: true,
@ -353,7 +353,7 @@ mod tests {
let log_path = tmp.path().join("audit.log");
assert!(log_path.exists(), "audit log file must be created");
let content = std::fs::read_to_string(&log_path)?;
let content = tokio::fs::read_to_string(&log_path).await?;
assert!(!content.is_empty(), "audit log must not be empty");
let parsed: AuditEvent = serde_json::from_str(content.trim())?;
@ -361,8 +361,8 @@ mod tests {
Ok(())
}
#[test]
fn audit_log_command_event_writes_structured_entry() -> Result<()> {
#[tokio::test]
async fn audit_log_command_event_writes_structured_entry() -> Result<()> {
let tmp = TempDir::new()?;
let config = AuditConfig {
enabled: true,
@ -382,7 +382,7 @@ mod tests {
})?;
let log_path = tmp.path().join("audit.log");
let content = std::fs::read_to_string(&log_path)?;
let content = tokio::fs::read_to_string(&log_path).await?;
let parsed: AuditEvent = serde_json::from_str(content.trim())?;
let action = parsed.action.unwrap();

View file

@ -334,8 +334,8 @@ mod tests {
assert!(!SecretStore::is_encrypted(""));
}
#[test]
fn key_file_created_on_first_encrypt() {
#[tokio::test]
async fn key_file_created_on_first_encrypt() {
let tmp = TempDir::new().unwrap();
let store = SecretStore::new(tmp.path(), true);
assert!(!store.key_path.exists());
@ -343,7 +343,7 @@ mod tests {
store.encrypt("test").unwrap();
assert!(store.key_path.exists(), "Key file should be created");
let key_hex = fs::read_to_string(&store.key_path).unwrap();
let key_hex = tokio::fs::read_to_string(&store.key_path).await.unwrap();
assert_eq!(
key_hex.len(),
KEY_LEN * 2,