🔧 chore(ci): automate thirdparty superpowers refresh and sync base
Update Third-party Superpowers / Update thirdparty/skill snapshot (push) Failing after 1m30s
Update Third-party Superpowers / Update thirdparty/skill snapshot (push) Failing after 1m30s
This commit is contained in:
@@ -16,6 +16,7 @@ tests/
|
||||
├── test_vendor_snapshot_templates.py # vendor 快照模板完整性测试
|
||||
├── test_plan_progress_cli.py # plan_progress CLI 测试
|
||||
├── test_superpowers_list_sync.py # superpowers 列表一致性测试
|
||||
├── test_superpowers_workflows.py # superpowers 工作流配置校验
|
||||
├── test_sync_templates_placeholders.py # 占位符替换测试(sync_rules/sync_standards)
|
||||
├── test_toml_edge_cases.py # TOML 解析边界测试
|
||||
├── templates/ # 模板验证测试
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SYNC_WORKFLOW = ROOT / ".gitea" / "workflows" / "sync-superpowers.yml"
|
||||
AUTO_UPDATE_WORKFLOW = ROOT / ".gitea" / "workflows" / "update-thirdparty-superpowers.yml"
|
||||
AUTO_UPDATE_SCRIPT = ROOT / ".gitea" / "ci" / "update_thirdparty_superpowers.sh"
|
||||
|
||||
|
||||
class SuperpowersWorkflowTests(unittest.TestCase):
|
||||
def test_sync_workflow_uses_manual_trigger(self):
|
||||
text = SYNC_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("workflow_dispatch:", text)
|
||||
|
||||
def test_sync_workflow_runs_from_latest_main(self):
|
||||
text = SYNC_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn('TARGET_BRANCH: "main"', text)
|
||||
self.assertIn('git fetch origin "${{ env.TARGET_BRANCH }}"', text)
|
||||
self.assertIn(
|
||||
'git checkout -B "${{ env.TARGET_BRANCH }}" "origin/${{ env.TARGET_BRANCH }}"',
|
||||
text,
|
||||
)
|
||||
|
||||
def test_auto_update_workflow_triggers_on_main_push(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("push:", text)
|
||||
self.assertIn("- main", text)
|
||||
self.assertIn("workflow_dispatch:", text)
|
||||
|
||||
def test_auto_update_workflow_runs_update_script(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("bash .gitea/ci/update_thirdparty_superpowers.sh", text)
|
||||
|
||||
def test_auto_update_script_targets_thirdparty_branch(self):
|
||||
text = AUTO_UPDATE_SCRIPT.read_text(encoding="utf-8")
|
||||
self.assertIn('TARGET_BRANCH="${TARGET_BRANCH:-thirdparty/skill}"', text)
|
||||
self.assertIn("git ls-remote", text)
|
||||
self.assertIn('git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"', text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user