From f62f6c6c7abb929c4c802129aae78c0435fbf9d1 Mon Sep 17 00:00:00 2001 From: backrooms-yrc <1945826346@qq.com> Date: Fri, 21 Aug 2026 03:12:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?ci:=20=E6=9C=BA=E5=99=A8=E4=BA=BA=E8=BF=9E?= =?UTF-8?q?=E9=80=9A=E6=80=A7=E6=B5=8B=E8=AF=95=EF=BC=88=E7=A9=BA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 5765eb4f3858eea39fe057ba15d086ec0fd19ca8 Mon Sep 17 00:00:00 2001 From: backrooms-yrc <1945826346@qq.com> Date: Fri, 21 Aug 2026 03:16:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ci:=20=E6=B5=8B=E8=AF=95=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E8=BE=93=E5=87=BA=E6=AF=8F=E4=B8=AA=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E9=80=80=E5=87=BA=E7=A0=81=EF=BC=8C=E7=95=99=E8=A8=80?= =?UTF-8?q?=E4=BB=85=E8=B4=B4=E5=A4=B1=E8=B4=A5=E6=AE=B5=E8=90=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f258002..2428a53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,15 +29,16 @@ jobs: run: | set +e : > /tmp/pytest.log + : > /tmp/failed.txt overall=0 for f in test_*.py; do echo "=== $f ===" >> /tmp/pytest.log python3 "$f" >> /tmp/pytest.log 2>&1 code=$? echo "--- exit $code ---" >> /tmp/pytest.log - [ $code -ne 0 ] && overall=1 + echo "[$f] exit=$code" + if [ $code -ne 0 ]; then overall=1; echo "$f" >> /tmp/failed.txt; fi done - tail -40 /tmp/pytest.log echo "exit_code=$overall" >> "$GITHUB_OUTPUT" exit 0 @@ -48,18 +49,28 @@ jobs: script: | const fs = require('fs'); const log = fs.readFileSync('/tmp/pytest.log', 'utf8'); - const tail = log.split('\n').slice(-25).join('\n'); + const failed = fs.readFileSync('/tmp/failed.txt', 'utf8').trim().split('\n').filter(Boolean); + const sections = []; + for (const f of failed) { + const marker = `=== ${f} ===`; + const start = log.indexOf(marker); + const end = log.indexOf('--- exit', start); + let seg = start >= 0 ? log.slice(start + marker.length, end).trim() : '(未捕获到日志)'; + const lines = seg.split('\n'); + if (lines.length > 40) { + seg = lines.slice(0, 20).join('\n') + '\n...(中间省略)...\n' + lines.slice(-15).join('\n'); + } + sections.push(`### ❌ \`${f}\`\n\n\`\`\`\n${seg}\n\`\`\``); + } const body = [ '## ❌ 测试未通过', '', - '测试机器人自动运行了仓库测试,结果如下(末尾日志):', + `以下 ${failed.length} 个测试脚本失败:`, '', - '```', - tail, - '```', + sections.join('\n\n'), '', '请根据日志修复后重新推送,机器人会自动重跑。' - ].join('\n'); + ].join('\n').slice(0, 60000); await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, From dbdeea079b03ace02fd5db464f657cc639336eb6 Mon Sep 17 00:00:00 2001 From: backrooms-yrc <1945826346@qq.com> Date: Fri, 21 Aug 2026 03:18:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20test=5Fmusic=5Faudio=20=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E5=A4=8D=E8=BF=87=E6=9C=9F=E7=9A=84=20astrbo?= =?UTF-8?q?t=5Fplugin=5Fpixiv=20=E6=A8=A1=E5=9D=97=E5=90=8D=E5=BC=95?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_music_audio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_music_audio.py b/test_music_audio.py index 347554a..19ec3b0 100644 --- a/test_music_audio.py +++ b/test_music_audio.py @@ -141,12 +141,12 @@ def _wrap(f): "cross_group_memory": {"CrossGroupMemoryStore": object}, "group_switch_store": {"GroupSwitchStore": object}, }.items(): - module = types.ModuleType(f"astrbot_plugin_pixiv.{module_name}") + module = types.ModuleType(f"astrbot_plugin_currentcortex.{module_name}") for name, value in attributes.items(): setattr(module, name, value) sys.modules[module.__name__] = module -from astrbot_plugin_pixiv import main +from astrbot_plugin_currentcortex import main class TestPlugin: From a69cc89360258ccc8c3d99071101b5d337d67a38 Mon Sep 17 00:00:00 2001 From: backrooms-yrc <1945826346@qq.com> Date: Fri, 21 Aug 2026 03:20:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?ci:=20=E6=B5=8B=E8=AF=95=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=AE=89=E8=A3=85=20ffmpeg=EF=BC=88test=5Fmusic=5Faud?= =?UTF-8?q?io=20=E8=BD=AC=E7=A0=81=E6=B5=8B=E8=AF=95=E9=9C=80=E8=A6=81?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2428a53..9414be0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,9 @@ jobs: cache: pip - name: 安装依赖 - run: pip install -r requirements.txt + run: | + sudo apt-get update -q && sudo apt-get install -y -q ffmpeg + pip install -r requirements.txt - name: 运行测试 id: pytest