Skip to content

Commit af05dcc

Browse files
committed
feat(integration): INT-12 Odoo->SuiteCRM contact sync Phase 7 + CI
1 parent c9de4d8 commit af05dcc

2 files changed

Lines changed: 55 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
run: docker compose -f docker/docker-compose.sso.yml down -v
191191

192192
lab-05-smoke:
193-
name: Lab 05 -- Odoo Advanced Integration (INT-05 Odoo↔Keycloak OIDC + WireMock)
193+
name: Lab 05 -- Odoo Advanced Integration (INT-05 Odoo↔Keycloak OIDC + INT-12 Odoo↔SuiteCRM customer sync + WireMock)
194194
runs-on: ubuntu-latest
195195
needs: validate
196196
continue-on-error: true

tests/labs/test-lab-13-05.sh

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env bash
22
# test-lab-13-05.sh — Lab 13-05: Advanced Integration
3-
# Module 13: Odoo ERP · INT-05: Odoo↔Keycloak OIDC
3+
# Module 13: Odoo ERP · INT-05: Odoo↔Keycloak OIDC · INT-12: Odoo↔SuiteCRM customer sync
44
# Services: PostgreSQL · Redis · OpenLDAP · Keycloak · WireMock (Snipe-IT/SuiteCRM-mock) · Mailhog · Odoo
55
# Ports: Odoo:8370 Gevent:8371 WireMock:8372 KC:8470 LDAP:3896 MH:8670
66
# INT-05: LDAP seed (odooadmin/odoouser1/odoouser2) · KC LDAP federation · Odoo OIDC provider · token issuance
7+
# INT-12: SuiteCRM JSONRPC WireMock stub · SUITECRM_URL/JSONRPC_ENDPOINT env vars · container reach
78
set -euo pipefail
89

910
LAB_ID="13-05"
@@ -489,10 +490,61 @@ if [ -n "${OIDC_ACCESS}" ]; then
489490
fi
490491
fi
491492

493+
# ── Phase 7: INT-12 SuiteCRM ↔ Odoo customer sync (partner API WireMock) ──────
494+
section "Phase 7: SuiteCRM Customer Sync WireMock + Env Vars (INT-12)"
495+
496+
# 7.1 -- Register SuiteCRM JSONRPC contact list stub
497+
HTTP_STATUS=$(curl -sf -o /dev/null -w "%{http_code}" \
498+
-X POST "${MOCK_URL}/__admin/mappings" \
499+
-H "Content-Type: application/json" \
500+
-d '{
501+
"request": {"method": "POST", "urlPattern": "/jsonrpc.*"},
502+
"response": {"status": 200,
503+
"headers": {"Content-Type": "application/json"},
504+
"body": "{\\"result\\":{\\"entry_list\\":[{\\"id\\":\\"contact-001\\",\\"name\\":\\"Alice Odoo\\",\\"email1\\":\\"alice@lab.local\\",\\"account_name\\":\\"Odoo Corp\\"}]}}"}}
505+
}' || echo "000")
506+
[ "${HTTP_STATUS}" = "201" ] \
507+
&& pass "INT-12: WireMock stub /jsonrpc (SuiteCRM contact list) registered" \
508+
|| fail "INT-12: WireMock stub /jsonrpc failed (HTTP ${HTTP_STATUS})"
509+
510+
# 7.2 -- Verify SuiteCRM JSONRPC stub responds
511+
if curl -sf -X POST "${MOCK_URL}/jsonrpc" \
512+
-H "Content-Type: application/json" \
513+
-d '{"method":"get_entry_list","parameters":{"module_name":"Contacts"}}' \
514+
| grep -q 'entry_list'; then
515+
pass "INT-12: WireMock SuiteCRM JSONRPC contact list responds correctly"
516+
else
517+
fail "INT-12: WireMock SuiteCRM JSONRPC contact list not responding"
518+
fi
519+
520+
# 7.3 -- Env var checks for INT-12
521+
for envpair in "SUITECRM_URL=http://odoo-i05-mock" "SUITECRM_JSONRPC_ENDPOINT=/jsonrpc"; do
522+
KEY="${envpair%%=*}"
523+
VAL="${envpair#*=}"
524+
if docker exec odoo-i05-app env 2>/dev/null | grep -q "${KEY}=${VAL}"; then
525+
pass "INT-12: Env ${KEY} set correctly in Odoo container"
526+
else
527+
fail "INT-12: Env ${KEY} not set or wrong in Odoo container"
528+
fi
529+
done
530+
531+
# 7.4 -- Odoo container → SuiteCRM WireMock reachable
532+
if docker exec odoo-i05-app curl -sf \
533+
-X POST "http://odoo-i05-mock:8080/jsonrpc" \
534+
-H "Content-Type: application/json" \
535+
-d '{"method":"get_entry_list","parameters":{"module_name":"Contacts"}}' \
536+
> /dev/null 2>&1; then
537+
pass "INT-12: Odoo container can reach SuiteCRM JSONRPC endpoint (WireMock)"
538+
else
539+
fail "INT-12: Odoo container cannot reach SuiteCRM JSONRPC endpoint"
540+
fi
541+
492542
# ── Results ───────────────────────────────────────────────────────────────────
493543
echo ""
494544
echo -e "${CYAN}============================================================${NC}"
495-
echo -e " Lab ${LAB_ID} Complete — INT-05: Odoo↔Keycloak OIDC"
545+
echo -e " Lab ${LAB_ID}: INT-05 + INT-12 Complete"
546+
echo -e " INT-05: Odoo ↔ Keycloak OIDC"
547+
echo -e " INT-12: Odoo ↔ SuiteCRM customer sync"
496548
echo -e " ${GREEN}PASS: ${PASS}${NC} | ${RED}FAIL: ${FAIL}${NC}"
497549
echo -e "${CYAN}============================================================${NC}"
498550

0 commit comments

Comments
 (0)