Repository navigation
fix: restore test sandbox under fish 4.9 (read-only __fish_config_dir) - #20
Merged
Merged
Conversation
fish 4.9 made __fish_config_dir read-only, so the test suite could no longer point the plugin at its temp sandbox and 57/138 tests failed against the real config dir (issue #19). - conf.d captures the dir once into plugin-owned __autoreload_config_dir (cleaned up by __autoreload_cleanup_all like every __autoreload_* var); snapshot/conf_files/run_check read that instead. - Tests override __autoreload_config_dir and drop the now-impossible __fish_config_dir save/restore. - Test cleanup guards the universal-variable safety net: erasing a nonexistent variable exits 4 on fish 4.9, and fishtape reports the script's final status as a failure (the lone ubuntu failure). 137/137 pass locally on fish 4.9.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19.
Root cause
fish 4.9 made
__fish_config_dirread-only. The test suite sandboxes the plugin by overriding that variable, so on runners that now ship fish 4.9.3 (macos-latest, release-4 PPA) the override errors out and the plugin watches the real config dir — 57/138 tests fail. The lone ubuntu/release-3-style failure (tests/autoreload_test.fish at undefined) was the cleanup'sset -eUon already-removed variables: erasing a nonexistent variable exits with status 4, and fishtape reports the script's final status.Fix
conf.d/autoreload.fishcaptures the config dir once into plugin-owned__autoreload_config_dir;__autoreload_snapshot/__autoreload_conf_files/__autoreload_run_checkread that instead of__fish_config_dir. Runtime behaviour is unchanged (same value, read at load time), and__autoreload_cleanup_allalready erases every__autoreload_*global on uninstall.__autoreload_config_dirand drop the impossible__fish_config_dirsave/restore.set -q.Test plan
fishtape tests/autoreload_test.fishon fish 4.9.3 locally: 137/137 pass (was 81/138).