mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 14:43:05 +09:00
- Reorganize v3/ into implementation/ subfolders: - planning/, architecture/, migration/, integration/ - security/, adrs/, research/, swarm-plans/ - Add 15-agent concurrent swarm implementation plans: - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x) - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies - Update .claude/settings.json with proper hooks format - Add bash aliases for claude --dangerously-skip-permissions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
71 lines
2.1 KiB
Bash
71 lines
2.1 KiB
Bash
#!/bin/bash
|
|
|
|
echo "========================================="
|
|
echo "Test 2: Hooks Exit Code Validation"
|
|
echo "========================================="
|
|
|
|
FAILED_TESTS=0
|
|
|
|
# Test pre-command hook
|
|
echo ""
|
|
echo "🔧 Testing pre-command hook exit code..."
|
|
npx claude-flow@2.7.40 hooks pre-command --command 'npm dist-tag ls claude-flow' --validate-safety true --prepare-resources true >/dev/null 2>&1
|
|
PRE_CMD_EXIT=$?
|
|
|
|
if [ $PRE_CMD_EXIT -eq 0 ]; then
|
|
echo "✅ pre-command hook exits with status 0"
|
|
else
|
|
echo "❌ FAIL: pre-command hook exited with status $PRE_CMD_EXIT"
|
|
FAILED_TESTS=$((FAILED_TESTS + 1))
|
|
fi
|
|
|
|
# Test post-command hook
|
|
echo ""
|
|
echo "🔧 Testing post-command hook exit code..."
|
|
npx claude-flow@2.7.40 hooks post-command --command 'npm dist-tag ls claude-flow' --track-metrics true --store-results true >/dev/null 2>&1
|
|
POST_CMD_EXIT=$?
|
|
|
|
if [ $POST_CMD_EXIT -eq 0 ]; then
|
|
echo "✅ post-command hook exits with status 0"
|
|
else
|
|
echo "❌ FAIL: post-command hook exited with status $POST_CMD_EXIT"
|
|
FAILED_TESTS=$((FAILED_TESTS + 1))
|
|
fi
|
|
|
|
# Test pre-edit hook
|
|
echo ""
|
|
echo "📝 Testing pre-edit hook exit code..."
|
|
npx claude-flow@2.7.40 hooks pre-edit --file '/tmp/test.js' --auto-assign-agents true >/dev/null 2>&1
|
|
PRE_EDIT_EXIT=$?
|
|
|
|
if [ $PRE_EDIT_EXIT -eq 0 ]; then
|
|
echo "✅ pre-edit hook exits with status 0"
|
|
else
|
|
echo "❌ FAIL: pre-edit hook exited with status $PRE_EDIT_EXIT"
|
|
FAILED_TESTS=$((FAILED_TESTS + 1))
|
|
fi
|
|
|
|
# Test post-edit hook
|
|
echo ""
|
|
echo "📝 Testing post-edit hook exit code..."
|
|
npx claude-flow@2.7.40 hooks post-edit --file '/tmp/test.js' --format true --update-memory true >/dev/null 2>&1
|
|
POST_EDIT_EXIT=$?
|
|
|
|
if [ $POST_EDIT_EXIT -eq 0 ]; then
|
|
echo "✅ post-edit hook exits with status 0"
|
|
else
|
|
echo "❌ FAIL: post-edit hook exited with status $POST_EDIT_EXIT"
|
|
FAILED_TESTS=$((FAILED_TESTS + 1))
|
|
fi
|
|
|
|
echo ""
|
|
if [ $FAILED_TESTS -eq 0 ]; then
|
|
echo "✅ PASS: All hooks exit cleanly (4/4)"
|
|
echo "========================================="
|
|
exit 0
|
|
else
|
|
echo "❌ FAIL: $FAILED_TESTS hook(s) failed"
|
|
echo "========================================="
|
|
exit 1
|
|
fi
|