🐛 fix(ci): serialize superpowers update and sync
This commit is contained in:
@@ -14,7 +14,7 @@ class SuperpowersWorkflowTests(unittest.TestCase):
|
||||
|
||||
def test_auto_update_workflow_name_describes_full_pipeline(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("name: Update and Sync Superpowers", text)
|
||||
self.assertIn("Update and Sync Superpowers", text)
|
||||
|
||||
def test_auto_update_workflow_triggers_on_main_push(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
@@ -31,11 +31,13 @@ class SuperpowersWorkflowTests(unittest.TestCase):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("bash .gitea/ci/update_thirdparty_superpowers.sh", text)
|
||||
|
||||
def test_auto_update_workflow_runs_sync_after_update(self):
|
||||
def test_auto_update_workflow_uses_single_serial_job(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("update:", text)
|
||||
self.assertIn("sync:", text)
|
||||
self.assertIn("needs: update", text)
|
||||
self.assertIn("update_and_sync:", text)
|
||||
self.assertNotIn("\n update:\n", text)
|
||||
self.assertNotIn("\n sync:\n", text)
|
||||
self.assertNotIn("needs: update", text)
|
||||
self.assertNotIn("outputs:", text)
|
||||
self.assertIn("bash .gitea/ci/sync_superpowers.sh", text)
|
||||
|
||||
def test_auto_update_workflow_sync_job_clears_stale_index_flags(self):
|
||||
@@ -43,11 +45,13 @@ class SuperpowersWorkflowTests(unittest.TestCase):
|
||||
self.assertIn("git update-index --no-assume-unchanged", text)
|
||||
self.assertIn("--no-skip-worktree", text)
|
||||
|
||||
def test_auto_update_workflow_sync_job_runs_from_latest_main(self):
|
||||
def test_auto_update_workflow_sync_step_runs_from_latest_main(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn('TARGET_BRANCH: "main"', text)
|
||||
self.assertIn('git fetch origin "$TARGET_BRANCH"', text)
|
||||
self.assertIn('git checkout -B "$TARGET_BRANCH" "origin/$TARGET_BRANCH"', text)
|
||||
self.assertIn('TARGET_BRANCH="$THIRDPARTY_BRANCH" bash .gitea/ci/update_thirdparty_superpowers.sh', text)
|
||||
self.assertIn('TARGET_BRANCH="main" \\', text)
|
||||
self.assertIn('SUPERPOWERS_BRANCH="$THIRDPARTY_BRANCH" \\', text)
|
||||
self.assertIn('SUPERPOWERS_DIR="$SUPERPOWERS_DIR" \\', text)
|
||||
self.assertIn('SUPERPOWERS_LIST="$SUPERPOWERS_LIST" \\', text)
|
||||
|
||||
def test_auto_update_workflow_sync_job_uses_literal_superpowers_paths(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
@@ -56,6 +60,15 @@ class SuperpowersWorkflowTests(unittest.TestCase):
|
||||
self.assertNotIn('SUPERPOWERS_DIR: "${{ env.SUPERPOWERS_DIR }}"', text)
|
||||
self.assertNotIn('SUPERPOWERS_LIST: "${{ env.SUPERPOWERS_LIST }}"', text)
|
||||
|
||||
def test_auto_update_workflow_logs_clear_serial_flow(self):
|
||||
text = AUTO_UPDATE_WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("name: 🪄 Update and Sync Superpowers", text)
|
||||
self.assertIn("- name: 🧰 Prepare repo", text)
|
||||
self.assertIn('- name: ♻️ Update thirdparty and sync main', text)
|
||||
self.assertIn('echo "📦 Refresh thirdparty/skill snapshot"', text)
|
||||
self.assertIn('echo "✅ No thirdparty snapshot change; skip main sync."', text)
|
||||
self.assertIn('echo "🚀 Sync skills into main"', 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)
|
||||
|
||||
Reference in New Issue
Block a user