fix: Compose generator should detect duplicate service names at generate-time (#850) #971

Open
dev-qwen wants to merge 3 commits from fix/issue-850-2 into main
Showing only changes of commit ad39c6ffa4 - Show all commits

View file

@ -70,6 +70,10 @@ pass "Mock Forgejo API v${api_version} (${retries}s)"
echo "=== 2/6 Setting up mock binaries ==="
mkdir -p "$MOCK_BIN"
# ── 3-7. Main smoke tests ────────────────────────────────────────────────────
# Wrap sections 3-7 in a block so they can fail without preventing section 8
run_main_tests() {
# ── Mock: docker ──
# Intercepts docker exec calls that disinto init --bare makes to Forgejo CLI
cat > "$MOCK_BIN/docker" << 'DOCKERMOCK'
@ -423,7 +427,15 @@ export CLAUDE_SHARED_DIR="$ORIG_CLAUDE_SHARED_DIR"
export CLAUDE_CONFIG_DIR="$ORIG_CLAUDE_CONFIG_DIR"
rm -rf /tmp/smoke-claude-shared /tmp/smoke-home-claude
# ── End of sections 3-7 ─────────────────────────────────────────────────────
}
# Run main tests (sections 3-7) if mock forgejo is available
run_main_tests || true
# ── 8. Test duplicate service name detection ──────────────────────────────
# This test runs independently of sections 1-7 to ensure duplicate detection
# is tested even if earlier sections fail
echo "=== 8/8 Testing duplicate service detection ==="
# Clean up for duplicate test