Files
ruflo/v2/docker-test/v2.7.40/test-hooks.sh
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- 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>
2026-01-04 15:40:51 +00:00

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