fix: Compose generator should detect duplicate service names at generate-time (#850)
This commit is contained in:
parent
5a0b3a341e
commit
2da32d474a
3 changed files with 312 additions and 2 deletions
|
|
@ -423,6 +423,49 @@ 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
|
||||
|
||||
# ── 8. Test duplicate service name detection ──────────────────────────────
|
||||
echo "=== 8/8 Testing duplicate service name detection ==="
|
||||
|
||||
# Clean up for duplicate test
|
||||
rm -f "${FACTORY_ROOT}/projects/duplicate-test.toml"
|
||||
|
||||
# Create a TOML that would conflict with ENABLE_LLAMA_AGENT
|
||||
cat > "${FACTORY_ROOT}/projects/duplicate-test.toml" <<'TOMLEOF'
|
||||
name = "duplicate-test"
|
||||
description = "Test project for duplicate service detection"
|
||||
|
||||
[ci]
|
||||
woodpecker_repo_id = "999"
|
||||
|
||||
[agents.llama]
|
||||
base_url = "http://localhost:8080"
|
||||
model = "qwen:latest"
|
||||
roles = ["dev"]
|
||||
forge_user = "llama-bot"
|
||||
TOMLEOF
|
||||
|
||||
# Run disinto init with ENABLE_LLAMA_AGENT=1
|
||||
# This should fail because [agents.llama] conflicts with ENABLE_LLAMA_AGENT
|
||||
export ENABLE_LLAMA_AGENT="1"
|
||||
export FORGE_URL="http://localhost:3000"
|
||||
export SMOKE_FORGE_URL="$FORGE_URL"
|
||||
export FORGE_ADMIN_PASS="smoke-test-password-123"
|
||||
export SKIP_PUSH=true
|
||||
|
||||
if bash "${FACTORY_ROOT}/bin/disinto" init \
|
||||
"duplicate-test" \
|
||||
--bare --yes \
|
||||
--forge-url "$FORGE_URL" \
|
||||
--repo-root "/tmp/smoke-test-repo" 2>&1 | grep -q "Duplicate service name 'agents-llama'"; then
|
||||
pass "Duplicate service detection: correctly detected conflict between ENABLE_LLAMA_AGENT and [agents.llama]"
|
||||
else
|
||||
fail "Duplicate service detection: should have detected conflict between ENABLE_LLAMA_AGENT and [agents.llama]"
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
rm -f "${FACTORY_ROOT}/projects/duplicate-test.toml"
|
||||
unset ENABLE_LLAMA_AGENT
|
||||
|
||||
# ── Summary ──────────────────────────────────────────────────────────────────
|
||||
echo ""
|
||||
if [ "$FAILED" -ne 0 ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue