mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-05 23:18:56 +08:00
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:
14
scripts/test_example_plugins.sh
Executable file
14
scripts/test_example_plugins.sh
Executable 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
|
||||
Reference in New Issue
Block a user