feat(4.0-P7): 新增 5 个示例插件,逐个运行契约与行为测试

- webhook-on-event、custom-rss-site、template-rename、nfo-writer、ntfy-notifier
- scripts/test_example_plugins.sh 对每个示例运行 ab-plugin validate 与自带测试
- 宿主侧测试把全部示例载入 PluginManager,断言 Provider 与钩子已登记
- NotifierContract 发现 ntfy 示例的中文标题请求头缺陷,已改用 bytes 请求头
This commit is contained in:
Estrella Pan
2026-10-08 14:50:59 +02:00
parent e0fc4c4eb6
commit a1adf237b8
27 changed files with 856 additions and 1 deletions

14
scripts/test_example_plugins.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# 逐个示例插件:校验清单,再跑它自己的测试(与插件作者在示例目录里 `uv run pytest` 一致)。
# 在仓库根目录运行;CI 与本地共用。
set -euo pipefail
root="$(cd "$(dirname "$0")/.." && pwd)"
cd "$root/backend"
for dir in "$root"/examples/plugins/*/; do
name="$(basename "$dir")"
echo "== $name"
uv run ab-plugin validate "$dir"
if [ -d "$dir/tests" ]; then
uv run pytest -q -c "$dir/pyproject.toml" --rootdir "$dir" -p no:cacheprovider "$dir/tests"
fi
done