mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-05 04:06:37 +02:00
fix(test): disables helper auto-detect must follow symlinks (#7654)
ep_disable_chat#75 ran with `disables: ["@feature:chat"]` declared in
ep.json but the helper printed "No 'disables' declared — running
standard test suite" and exec'd a vanilla `playwright test`, with
@feature:chat-tagged tests running anyway and timing out one by one.
Root cause: the auto-detect used `find -maxdepth 3 plugin_packages/
-name ep.json -not -path '*/.versions/*'`. Live-plugin-manager
installs plugins under `plugin_packages/.versions/<name>@<ver>/`
and exposes them as symlinks at `plugin_packages/ep_<name>`. find(1)
doesn't follow symlinks by default, so:
- the .versions/ ep.json was excluded by -not -path
- the symlink at plugin_packages/ep_<name> was visited but find
didn't recurse into it because it's a symlink, not a real dir
=> 0 candidates found, helper falls through to standard mode.
Switch to a shell glob with `-f` membership tests, which resolve
symlinks correctly. Verified against a synthetic install: the helper
now finds the disables list and prints "Plugin disables: @feature:chat"
before running pass 1.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6900767934
commit
56596e21bb
@ -71,12 +71,22 @@ elif [[ -n "$EP_JSON" ]]; then
|
||||
DISABLES="$(read_disables_from_json "$EP_JSON")"
|
||||
else
|
||||
# Auto-detect from plugin_packages/. Skip if 0 or >1 disabling plugins.
|
||||
#
|
||||
# Live-plugin-manager installs plugins under plugin_packages/.versions/
|
||||
# and exposes them as symlinks at plugin_packages/ep_<name>. find(1)
|
||||
# doesn't follow symlinks by default, so iterate via shell glob and
|
||||
# `-f $dir/ep.json` (which DOES resolve symlinks) instead.
|
||||
declare -a CANDIDATES=()
|
||||
if [[ -d plugin_packages ]]; then
|
||||
while IFS= read -r f; do
|
||||
shopt -s nullglob
|
||||
for dir in plugin_packages/ep_*; do
|
||||
[[ -L "$dir" || -d "$dir" ]] || continue
|
||||
f="$dir/ep.json"
|
||||
[[ -f "$f" ]] || continue
|
||||
d="$(read_disables_from_json "$f")"
|
||||
[[ -n "$d" ]] && CANDIDATES+=("$d")
|
||||
done < <(find plugin_packages -maxdepth 3 -name ep.json -not -path '*/.versions/*' 2>/dev/null)
|
||||
done
|
||||
shopt -u nullglob
|
||||
fi
|
||||
if [[ ${#CANDIDATES[@]} -eq 1 ]]; then
|
||||
DISABLES="${CANDIDATES[0]}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user