Fixed Docker e2e testing failure issue
This commit is contained in:
parent
1cae69aab3
commit
031add436e
|
|
@ -73,6 +73,7 @@ services:
|
|||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
ports:
|
||||
- "127.0.0.1:8000:8000"
|
||||
command: ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--log-level", "info"]
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
|
|
|||
|
|
@ -66,5 +66,5 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|||
CMD curl -f http://127.0.0.1:8000/health || exit 1
|
||||
|
||||
# Default command starts Uvicorn production server
|
||||
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4", "--log-level", "info"]
|
||||
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--log-level", "info"]
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,27 @@ TEST_PERSONAS: Dict[str, Dict[str, Any]] = {
|
|||
"roles": ["Tenant Administrator"],
|
||||
"tenant_id": "tenant-beta"
|
||||
},
|
||||
"admin@alpha-agri.com": {
|
||||
"sub": "usr_admin_alpha",
|
||||
"email": "admin@alpha-agri.com",
|
||||
"name": "Alpha Live Admin",
|
||||
"roles": ["Tenant Administrator"],
|
||||
"tenant_id": "tenant-alpha"
|
||||
},
|
||||
"buyer@alpha-agri.com": {
|
||||
"sub": "usr_buyer_alpha",
|
||||
"email": "buyer@alpha-agri.com",
|
||||
"name": "Alpha Live Buyer",
|
||||
"roles": ["Mandi Buyer"],
|
||||
"tenant_id": "tenant-alpha"
|
||||
},
|
||||
"admin@beta-commodities.com": {
|
||||
"sub": "usr_admin_beta",
|
||||
"email": "admin@beta-commodities.com",
|
||||
"name": "Beta Live Admin",
|
||||
"roles": ["Tenant Administrator"],
|
||||
"tenant_id": "tenant-beta"
|
||||
},
|
||||
"multi@trader.com": {
|
||||
"sub": "usr_01J8K92MLT001",
|
||||
"email": "multi@trader.com",
|
||||
|
|
@ -248,6 +269,9 @@ TEST_MEMBERSHIPS: List[Dict[str, Any]] = [
|
|||
{"membership_id": "mem_005", "tenant_id": "tenant-alpha", "user_id": "usr_01J8K92MLT001", "email": "multi@trader.com", "role": "Mandi Buyer", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_006", "tenant_id": "tenant-beta", "user_id": "usr_01J8K92MLT001", "email": "multi@trader.com", "role": "Partner / MD", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_007", "tenant_id": "tenant-gamma", "user_id": "usr_01J8K92GAM001", "email": "user@gamma.com", "role": "Mandi Buyer", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_live_admin_alpha", "tenant_id": "tenant-alpha", "user_id": "usr_admin_alpha", "email": "admin@alpha-agri.com", "role": "Tenant Administrator", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_live_buyer_alpha", "tenant_id": "tenant-alpha", "user_id": "usr_buyer_alpha", "email": "buyer@alpha-agri.com", "role": "Mandi Buyer", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_live_admin_beta", "tenant_id": "tenant-beta", "user_id": "usr_admin_beta", "email": "admin@beta-commodities.com", "role": "Tenant Administrator", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_demo_001", "tenant_id": "demo-malwa-agri", "user_id": "buyer@malwa-agri.demo", "email": "buyer@malwa-agri.demo", "role": "Mandi Buyer", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_demo_002", "tenant_id": "demo-malwa-agri", "user_id": "pmgr@malwa-agri.demo", "email": "pmgr@malwa-agri.demo", "role": "Purchase Manager", "status": "ACTIVE"},
|
||||
{"membership_id": "mem_demo_003", "tenant_id": "demo-malwa-agri", "user_id": "yard@malwa-agri.demo", "email": "yard@malwa-agri.demo", "role": "Yard Supervisor", "status": "ACTIVE"},
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Executes real HTTP requests against the live running FastAPI container (port 800
|
|||
"""
|
||||
from datetime import datetime, date, timezone
|
||||
from decimal import Decimal
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import unittest
|
||||
|
|
@ -28,7 +29,7 @@ from typing import Any, Dict, Optional, Tuple
|
|||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@ import unittest
|
|||
import urllib.request
|
||||
import urllib.error
|
||||
import uuid
|
||||
import os
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
|
||||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ verifying the complete financial lifecycle:
|
|||
"""
|
||||
from datetime import datetime, date, timezone
|
||||
from decimal import Decimal
|
||||
import os
|
||||
import json
|
||||
import unittest
|
||||
import urllib.request
|
||||
|
|
@ -27,7 +28,7 @@ from typing import Any, Dict, Optional, Tuple
|
|||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ verifying the complete physical grain procurement and inventory minting lifecycl
|
|||
from datetime import datetime, date, timedelta, timezone
|
||||
import json
|
||||
import unittest
|
||||
import os
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
import uuid
|
||||
|
|
@ -20,7 +21,7 @@ from typing import Any, Dict, Optional, Tuple
|
|||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Executes real HTTP requests against the live running FastAPI container (port 800
|
|||
from datetime import datetime, timezone, timedelta
|
||||
import json
|
||||
import time
|
||||
import os
|
||||
import unittest
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
|
|
@ -26,7 +27,7 @@ from typing import Any, Dict, Optional, Tuple
|
|||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ verifying the complete stock-to-dispatch, credit exposure, and destination short
|
|||
from datetime import datetime, date, timezone
|
||||
from decimal import Decimal
|
||||
import json
|
||||
import os
|
||||
import unittest
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
|
|
@ -21,7 +22,7 @@ from typing import Any, Dict, Optional, Tuple
|
|||
from sandbox.identity_mock import mock_idp
|
||||
|
||||
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = os.getenv("E2E_BASE_URL", "http://127.0.0.1:8000")
|
||||
|
||||
|
||||
def make_request(
|
||||
|
|
|
|||
Loading…
Reference in New Issue