Skip to content

fix: restore test sandbox under fish 4.9 (read-only __fish_config_dir) - #20

Merged
h13 merged 1 commit into
mainfrom
fix/fish49-config-dir
Dec 2, 2026
Merged

h13 merged 1 commit into
mainfrom
fix/fish49-config-dir

Conversation

@h13

@h13 h13 commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Fixes #19.

Root cause

fish 4.9 made __fish_config_dir read-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's set -eU on already-removed variables: erasing a nonexistent variable exits with status 4, and fishtape reports the script's final status.

Fix

  • conf.d/autoreload.fish captures the config dir once into plugin-owned __autoreload_config_dir; __autoreload_snapshot / __autoreload_conf_files / __autoreload_run_check read that instead of __fish_config_dir. Runtime behaviour is unchanged (same value, read at load time), and __autoreload_cleanup_all already erases every __autoreload_* global on uninstall.
  • Tests override __autoreload_config_dir and drop the impossible __fish_config_dir save/restore.
  • The universal-variable safety net in test cleanup is guarded with set -q.
  • Version: 1.19.0 → 1.19.1.

Test plan

  • fishtape tests/autoreload_test.fish on fish 4.9.3 locally: 137/137 pass (was 81/138).
  • CI matrix exercises fish 3.x (release-3 PPA) and 4.x.

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.
@h13
h13 merged commit 49e5568 into main Dec 2, 2026
6 checks passed
@h13
h13 deleted the fix/fish49-config-dir branch December 2, 2026 02:42
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.

CI is red on main: tests fail on current runner images (fish 4.9.3 on macos-latest)

1 participant