aboutsummaryrefslogtreecommitdiff
path: root/tmuxrdr/scripts/test-e2e
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-13 15:31:21 +0300
committerIgor Soarez <igor@soarez.org>2026-10-13 15:31:21 +0300
commitfaad12a57a2c161ce67e54fe2b96561bc1a3bd1e (patch)
treee774ff68d0575c3b757665a4d76d06acf7f32dc9 /tmuxrdr/scripts/test-e2e
parentb79e6822209fa45fc357ddfd3d7caf1598f9af37 (diff)
tmuxrdr: e2e clears the pane env from cli calls
running the e2e from inside a herdr session leaked herdr_pane_id into the cli, so pane current looked for the caller's pane on the throwaway server and the script died with "herdr client did not come up".
Diffstat (limited to 'tmuxrdr/scripts/test-e2e')
-rwxr-xr-xtmuxrdr/scripts/test-e2e8
1 files changed, 6 insertions, 2 deletions
diff --git a/tmuxrdr/scripts/test-e2e b/tmuxrdr/scripts/test-e2e
index 0adaebc4..aa12d1ba 100755
--- a/tmuxrdr/scripts/test-e2e
+++ b/tmuxrdr/scripts/test-e2e
@@ -27,7 +27,11 @@ herdr="${HERDR:-tmuxrdr}"
delay="${TMUXRDR_E2E_DELAY:-0.8}"
session="tmuxrdr-e2e-$$"
T=(tmux -L "tmuxrdr-e2e-$$" -f /dev/null)
-H=("$herdr" --session "$session")
+# The script may run from inside a herdr pane, whose env names that pane; the
+# CLI would then look for it on the throwaway server and miss.
+u=(env -u HERDR_PANE_ID -u HERDR_TAB_ID -u HERDR_WORKSPACE_ID \
+ -u HERDR_SOCKET_PATH -u HERDR_CLIENT_SOCKET_PATH -u HERDR_ENV)
+H=("${u[@]}" "$herdr" --session "$session")
plugin_id="tmuxrdr.tmux-mode"
work="$(mktemp -d)"
cfg="$work/config.toml"
@@ -55,7 +59,7 @@ done
app="$(basename "$(dirname "$("$herdr" --help | sed -n 's/^Config: *//p')")")"
[[ "$app" == tmuxrdr ]] || die "$herdr keeps its files under '$app', not tmuxrdr: not a tmuxrdr build"
state="${XDG_STATE_HOME:-$HOME/.local/state}/$app/plugins/$plugin_id/$session"
-"$herdr" plugin list --json 2>/dev/null \
+"${H[@]}" plugin list --json 2>/dev/null \
| jq -e --arg id "$plugin_id" --arg root "$repo/tmuxrdr/plugin" \
'[.. | objects | select(.plugin_id? == $id and .plugin_root? == $root)] | length > 0' >/dev/null \
|| die "$plugin_id is not registered from this checkout; run tmuxrdr/scripts/install yes"