Skip to content

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

Redact APPDATA env var in snapshot tests

Maximilian Roos669681b795b9
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index d19937b6f..660a050c0 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -915,6 +915,8 @@ pub fn setup_snapshot_settings(repo: &TestRepo) -> insta::Settings {
// Windows: the `home` crate uses USERPROFILE for home_dir()
settings.add_redaction(".env.USERPROFILE", "[TEST_HOME]");
settings.add_redaction(".env.XDG_CONFIG_HOME", "[TEST_CONFIG_HOME]");
+ // Windows: etcetera uses APPDATA for config_dir()
+ settings.add_redaction(".env.APPDATA", "[TEST_CONFIG_HOME]");
settings.add_redaction(".env.PATH", "[PATH]");
// Normalize timestamps in log filenames (format: YYYYMMDD-HHMMSS)
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_command_not_found.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_command_not_found.snap
index 3c8c69998..5375a2569 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_command_not_found.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_command_not_found.snap
@@ -7,7 +7,7 @@ info:
- show
- "--doctor"
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpjj5ErM/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_not_configured.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_not_configured.snap
index a12da38db..e99f05dcb 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_not_configured.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_doctor_not_configured.snap
@@ -7,7 +7,7 @@ info:
- show
- "--doctor"
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiw5aui/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_partial_shell_config_shows_hint.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_partial_shell_config_shows_hint.snap
index c20fd3d88..35d5652ea 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_partial_shell_config_shows_hint.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_partial_shell_config_shows_hint.snap
@@ -6,7 +6,7 @@ info:
- config
- show
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpe62ExY/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_correct_order.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_correct_order.snap
index dc3c757ef..a82a43e33 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_correct_order.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_correct_order.snap
@@ -6,7 +6,7 @@ info:
- config
- show
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0MPkhE/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_warning.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_warning.snap
index 9cfd2c6a3..81581a302 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_warning.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_zsh_compinit_warning.snap
@@ -6,7 +6,7 @@ info:
- config
- show
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpK02YUP/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
diff --git a/tests/snapshots/integration__integration_tests__internal_flag__config_show_with_internal_flag.snap b/tests/snapshots/integration__integration_tests__internal_flag__config_show_with_internal_flag.snap
index 82278e3c9..73b397088 100644
--- a/tests/snapshots/integration__integration_tests__internal_flag__config_show_with_internal_flag.snap
+++ b/tests/snapshots/integration__integration_tests__internal_flag__config_show_with_internal_flag.snap
@@ -7,7 +7,7 @@ info:
- config
- show
env:
- APPDATA: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp77cGMU/.config
+ APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"