Skip to content

fix: clear GH_DASH_CONFIG in default-config test#814

Merged
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:fix/config-test-env
Mar 25, 2026
Merged

fix: clear GH_DASH_CONFIG in default-config test#814
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:fix/config-test-env

Conversation

@sideshowbarker
Copy link
Copy Markdown
Contributor

Bug: The TestParser/Should_create_default_config test fails when GH_DASH_CONFIG is set in the environment.

Cause: The test set XDG_CONFIG_HOME to an empty temp dir — to isolate it from any actual local config — but didn’t clear GH_DASH_CONFIG. ParseConfig checks GH_DASH_CONFIG — so if it’s set, dash uses the local config file specified in the value, and that local config may specify more PR sections than the 3 the test expects (causing the test to fail).

Fix: Clear GH_DASH_CONFIG with t.Setenv (which restores it afterward).

Bug: The TestParser/Should_create_default_config test fails when
GH_DASH_CONFIG is set in the environment.

Cause: The test set XDG_CONFIG_HOME to an empty temp dir — to isolate it
from any actual local config — but didn’t clear GH_DASH_CONFIG.
ParseConfig checks GH_DASH_CONFIG — so if it’s set, dash uses the local
config file specified in the value, and that local config may specify
more PR sections than the 3 the test expects (causing the test to fail).

Fix: Clear GH_DASH_CONFIG with t.Setenv (which restores it afterward).
@dlvhdr dlvhdr merged commit 1bd18d5 into dlvhdr:main Mar 25, 2026
3 checks passed
@sideshowbarker sideshowbarker deleted the fix/config-test-env branch March 25, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants