La test infrastructure del WMS Agile è progettata su tre principi fondamentali:
Ogni livello è indipendente ma orchestrato da infrastructure/test-master.sh.
La pipeline CI Gitea esegue L1→L3→L4→L5 ad ogni push su main.
L1 + L3 + L4 + L6 + L7 in parallelo (FASE 1). L2 sequenziale (FASE 2). L5 ultimo (FASE 3). SimBot & Stress indipendenti.
/health su tutti e 7 i microserviziPOST /api/auth/login → JWT validoGET /api/products — inventory-msGET /api/inbound/orders — inbound-msGET /api/outbound/orders — outbound-msGET /api/missions — warehouse-msCriterio di successo: tutti i servizi rispondono 2xx — se L1 fallisce, la pipeline si ferma.
Criterio di successo: ogni flusso senza errori 5xx, dati coerenti end-to-end tra DB diversi.
| File | Servizio | Test | Assert |
|---|---|---|---|
OutboundServiceTest.php | outbound-ms | 16 | 42 |
StockServiceTest.php | inventory-ms | 14 | 37 |
InboundServiceTest.php | inbound-ms | 21 | 58 |
| Totale | 51 | 137 | |
order_number + retrytenant_iddeleted_at filter in tutti i SELECTPDOException 23000 → 400docker exec wms-{svc} vendor/bin/phpunit tests/ --testdox --colors
| Spec | Test | Cosa testa |
|---|---|---|
auth.spec.js | 5 | Login form, validazione, credenziali errate, redirect post-login |
dashboard.spec.js | 6 | KPI dashboard, sezioni, JS errors, 401/500 check, logout |
navigation.spec.js | 4 | Nav link click, topbar persistence, logout flow |
forms.spec.js | 4 | Modal prodotto/ordine, form validation, required fields |
simulator.spec.js | 8 | Scenario grid S2-S7, cockpit, speed, API check, no JS errors |
billing.spec.js | 6 | Dashboard billing, invoice list, FatturaPA, state transitions |
ai-chat.spec.js | 8 | Chat panel, messaggi, KB search, tools, streaming |
| Totale | 41 ✅ | 7 spec file, tutti in produzione |
/usr/bin/google-chrome (devenv), Playwright Chromium (CI)page.evaluate() dopo ogni loginlocation.hash = 'section' (non link diretti)WMS_BASE_URL=https://wms.agile.software| § | Sezione | Servizio | Check |
|---|---|---|---|
| 0 | Login | auth-ms | JWT token |
| 1 | Billing | billing-ms :3091 | Fatture, FatturaPA XML, Revolut payment |
| 2 | AI | ai-ms :3087 | Settings, tools, chat, KB stats, sim-datasets |
| 3 | Calendar | calendar-ms :3088 | Holidays (16 paesi), settings, tokens |
| 4 | WCS | wcs-ms :3089 | Status, adapters, robot dispatch |
| 5 | Network | network-ms :3090 | Partners, PO, confirm, ship, receipt |
| 6 | Returns | warehouse-ms | NCR, stock adjustments, rettifiche |
| 7 | Multi-tenant | auth-ms | Supervisor login, tenant isolation, null check |
| 8 | Error Cases | all | 400/422 validation, 401 auth, 404, JWT tampering |
| 9 | Labour | warehouse-ms | Shift reports, KPI operatori |
| 10 | Yard | warehouse-ms | Status, dock slots, trailer management |
| 11 | Slotting + Audit | warehouse-ms | Proposals, audit trail, notifications |
Graceful degradation: test passano anche se un servizio esterno non e' configurato (Revolut, Anthropic).
Skip per sezione: WMS_SKIP_BILLING=1, WMS_SKIP_AI=1, ecc.
A differenza della v2 (Playwright + Node.js headless), SimBot v3 gira interamente nel browser dell'utente:
frame.contentDocument, zero dipendenze/api/ai/chat + fallback locale (12+ risposte)| Fase | Cosa fa | Tipo | Verifica DB |
|---|---|---|---|
| 00 Reset | Elimina dati SB- precedenti via API | Cleanup | — |
| 01 Login | Accesso admin, verifica #app-screen | Auth | — |
| 02 Dashboard Tour | KPI, health banner, risorse, alert | Tour | — |
| 03 Warehouse | 5 magazzini via form UI | CRUD | Batch |
| 04 Zone | 30 zone (6 tipi, 5 ambienti) | CRUD | Batch |
| 05 Bin | 27 bin (FEFO, FIFO, dedicated) | CRUD | Batch |
| 06 Prodotti | 61 SKU (cold/frozen/ambient) | CRUD | Batch |
| 07 Packaging GS1 | Tour EA>CASE>PALLET, EAN/GTIN | Tour | — |
| 08 Clienti/Forn/Corr | 15 fornitori, 20 clienti, 4 corrieri | CRUD | — |
| 09 Operatori/Equip | 8 mezzi (UI) + 6 operatori (API) | CRUD+API | — |
| 10 Inventario | Lotti + stock (scadenze realistiche) | API | — |
| 11 Inbound | 3 ordini + receiving QC + putaway | API+UI | — |
| 12 Outbound | 3 ordini + confirm + wave + ship | UI+API | — |
| 13 TMS | 3 autisti + 1 giro consegna | UI+API | — |
| 14 Tracking | 3 colli + scan eventi | API | — |
| 15 Missioni | 5 missioni (pick/put/transfer/count) | API | — |
| 16 Conformita NCR | 4 NCR (danni, discrepanze, scadenze) | API | — |
| 17 4PL & Billing | 3 aziende multi-tenant | UI+API | — |
| 18 Yard | 3 trailer con stati banchina | API | — |
| 19 Mappa | Tour planimetria SVG interattiva | Tour | — |
| 20 Calendario | Tour disponibilita risorse | Tour | — |
| 21 Notifiche | Test alert SSE real-time | Tour | — |
| 22 AI Assistant | Claude + RAG, domanda live | Tour+API | — |
| 23 Operativita | 5 giorni simulati (ordini/missioni/alert) | API | — |
| 24 Report KPI | 6 tab report + stock + dashboard | Tour | — |
| 25 Verifica | Conteggi API + navigazione 7 sezioni | Check | Full |
| Totale S2-Full | 200+ entita | 26 fasi | |
SimBot monitora automaticamente ogni operazione e segnala bug in tempo reale:
A fine sessione il log mostra un Bug Report con fase, tipo di problema e dettaglio tecnico. Il contatore Bug nella barra KPI e' verde (0) o rosso (problemi rilevati).
All'avvio la voce descrive l'azienda che stiamo simulando. Per lo scenario S2-Full:
La voce spiega il significato di ogni campo al primo inserimento di ogni tipo:
Premendo PAUSA il bot si ferma e l'utente puo interagire in due modalita:
A fine sessione: Bug Report + Report Osservazioni nel log.
POST /api/simulator/reset cancella 30+ tabelle su 7 database| Scenario | Veloce | Normale | Lento | Demo |
|---|---|---|---|---|
| S2 Fast | ~2 min | ~4 min | ~7 min | ~10 min |
| S2 Full | ~8 min | ~15 min | ~25 min | ~35 min |
Indicatore ~Xmin sempre visibile nella barra viola, si aggiorna in tempo reale.
https://app.wms.agile.software/simbot/panel.html (SimBot) https://app.wms.agile.software/simbot-guide.html (Guida utente) https://app.wms.agile.software/simbot-technical.html (Specifica tecnica)
| # | Sezione | Worker | Verifica | Status |
|---|---|---|---|---|
| 0 | Login iniziale | 1× | Setup token | OK |
| 1 | Concurrent Login | 10× | JWT race condition | OK |
| 2 | Concurrent SKU | 10× | Unique constraint, no 5xx | OK |
| 3 | Concurrent Inbound | 10× | order_number unici | OK |
| 4 | Concurrent Outbound | 10× | order_number unici | OK |
| 5 | Stock Movements | 10× | No stock negativo (GREATEST guard) | OK |
| 6 | API Flood | 50× | No crash, no rate 5xx | OK |
| 7 | Tenant Isolation | — | Tenant 99999 non visibile | OK |
| 8 | Qty verification | — | Campo JSON corretto | cosmetic |
Fix race condition applicati: MAX()+1+random_int(1,20) + retry 5× con jitter su InboundService e OutboundService.
Il Simulatore WMS non è solo una demo commerciale — è il livello di test più avanzato dell'intera suite. Simula fino a 365 giorni di operatività in pochi minuti, generando migliaia di eventi reali che testano il sistema in condizioni impossibili da riprodurre con test tradizionali.
| Scenario | Verticale | Cosa testa in modo unico |
|---|---|---|
| S1 Logitech 4PL Group | Consumer Electronics | 5 facility, 3 tenant 4PL, SLA multi-carrier, billing cycle |
| S2 +Layer Complexity | 4PL Avanzato | Resi, guasti equipment (OEE), flash sale, stagionalità per SKU |
| S3 Pharma Cold Chain | Farmaceutico | GDP compliance, temperatura 2–8°C, lotti FEFO critici |
| S4 Automotive JIT | Automotive | Just-in-time, kanban, lead time rigido, zero stock tollerato |
| S5 Retail Omnichannel | Retail | E-commerce + punto vendita, webhook ordini, wave picking ad alto volume |
| S6 E-commerce Express | E-commerce | SLA 24h, alto volume, stress picking, cartonization automatica |
| S7 Food Distribution | Food & Beverage | FEFO obbligatorio, tracciabilità filiera, allerta scadenze |
Il Sim Wizard (/sim-wizard.html) guida la configurazione in 7 step (scenario, dati custom CSV/JSON, speed, health check) e lancia automaticamente il simulatore con i parametri scelti. Il SimRecorder cattura ogni evento per la revisione post-simulazione. Lo Snapshot AI invia la timeline a Claude per analisi automatica delle anomalie.
LOG_BUFFER_MAX=500 — buffer circolare log UI (shift() automatico)MAX_BUG_ITEMS=200, MAX_EVENTS=500, UI_TICK_EVERY=3FASE 1 (parallela — 5 test in background):
L1 Smoke ─┐
L3 PHPUnit ─┤
L4 SimAPIs ─┤ → tutti in background (&) → wait
L6 Super ─┤
L7 Simulator ─┘
FASE 2 (sequenziale):
L2 E2E Integration (12 step multi-microservizio)
FASE 3 (UI, saltabile con SKIP_L5=1):
L5 Playwright (41 test, 7 spec, Chrome headless)
Standalone (manuali, non nel master):
Stress Test → ./infrastructure/test-stress.sh [URL] [CONCURRENCY]
SimBot S2-Fast → node simbot/simbot-runner.js --headless --scenario=s2
SimBot S2-Full → node simbot/simbot-runner.js --headless --scenario=s2-full
Output: /tmp/wms-test-report-YYYYMMDD.html (master)
simbot/report/index.html (SimBot)
| Data | Livello | Bug | Severità | Fix applicato |
|---|---|---|---|---|
| 2026-02-26 | Stress | InboundService: COUNT()+1 duplica order_number sotto carico |
Critical | MAX()+1+random_int(1,20) + retry 5× jitter |
| 2026-02-26 | Stress | OutboundService: stesso problema (+$attempt insufficiente) |
Critical | Jitter casuale su retry — rompe simmetria temporale |
| 2026-02-26 | Stress | ProductService TOCTOU: SELECT check + INSERT separati → 5xx su duplicate SKU | High | catch PDOException 23000 → return 400 |
| 2026-02-26 | L1 Smoke | AuditLogger non nell'autoload inbound-ms → 500 su create order | High | Aggiunto wms/audit-lib a composer.json + rebuild |
| 2026-02-26 | L5 Playwright | Onboarding overlay blocca tutti i click post-login | Medium | Dismiss via page.evaluate() in ogni spec |
| 2026-02-26 | L5 Playwright | text=credenziali invalido come CSS selector |
Medium | .or(page.getByText(/regex/i)) |
| 2026-03-02 | L4 Simulator | POST /api/ai/knowledge/search restituiva 405 (route mancante) |
High | Aggiunta route in ai-ms/public/index.php + docker cp |
on: schedule)