Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: update log path snapshots for pass-through sanitization (#2159)

Worktrunk Botecb945d559d1
diff --git a/tests/integration_tests/config_state.rs b/tests/integration_tests/config_state.rs
index 16f57b7c5..f27c88667 100644
--- a/tests/integration_tests/config_state.rs
+++ b/tests/integration_tests/config_state.rs
@@ -1173,13 +1173,13 @@ fn test_state_get_json_with_logs(repo: TestRepo) {
{
"file": "bugfix/internal/remove.log",
"modified_at": "<MTIME>",
- "path": "_REPO_/.git/wt/logs/bugfix-zgc/internal/remove.log",
+ "path": "_REPO_/.git/wt/logs/bugfix/internal/remove.log",
"size": "<SIZE>"
},
{
"file": "feature/user/post-start/npm.log",
"modified_at": "<MTIME>",
- "path": "_REPO_/.git/wt/logs/feature-axb/user/post-start/npm-iox.log",
+ "path": "_REPO_/.git/wt/logs/feature/user/post-start/npm.log",
"size": "<SIZE>"
}
],
@@ -2111,12 +2111,12 @@ fn test_logs_get_json_with_files(repo: TestRepo) {
.unwrap();
assert!(output.status.success());
- // Redact dynamic timestamps, sizes, and sanitize hashes (hashes vary per input).
+ // Redact dynamic timestamps and sizes. "main" and "server" are already
+ // filename-safe, so sanitize_for_filename passes them through unchanged —
+ // no hash suffixes appear and no redaction is needed.
let mut settings = insta::Settings::clone_current();
settings.add_filter(r#""modified_at": \d+"#, r#""modified_at": "<TIMESTAMP>""#);
settings.add_filter(r#""size": \d+"#, r#""size": "<SIZE>""#);
- settings.add_filter(r"main-[a-z0-9]{3}", "main-<HASH>");
- settings.add_filter(r"server-[a-z0-9]{3}", "server-<HASH>");
settings.bind(|| {
assert_snapshot!(String::from_utf8_lossy(&output.stdout));
});
diff --git a/tests/snapshots/integration__integration_tests__config_state__logs_get_json_with_files.snap b/tests/snapshots/integration__integration_tests__config_state__logs_get_json_with_files.snap
index 6475761fd..3eba082c2 100644
--- a/tests/snapshots/integration__integration_tests__config_state__logs_get_json_with_files.snap
+++ b/tests/snapshots/integration__integration_tests__config_state__logs_get_json_with_files.snap
@@ -23,7 +23,7 @@ expression: "String::from_utf8_lossy(&output.stdout)"
{
"file": "main/user/post-start/server.log",
"modified_at": "<TIMESTAMP>",
- "path": "_REPO_/.git/wt/logs/main-<HASH>/user/post-start/server-<HASH>.log",
+ "path": "_REPO_/.git/wt/logs/main/user/post-start/server.log",
"size": "<SIZE>"
}
]