@@ -12,6 +12,20 @@ concurrency:
1212
1313env :
1414 PYTHON_VERSION : " 3.12"
15+ # Test-only CI secrets/config, inherited by all test jobs below.
16+ AUTH_SECRET_KEY : ci-test-secret-key-minimum-32-characters-long!!
17+ SECURITY_JWT_SECRET : ci-test-secret-key-minimum-32-characters-long!!
18+ USER_SERVICE_JWT_SECRET_KEY : ci-test-secret-key-minimum-32-characters-long!!
19+ ENCRYPTION_MASTER_KEY : ci-test-encrypt-key-exactly-32ch
20+ USER_SERVICE_FIELD_ENCRYPTION_KEY : ci-test-encrypt-key-exactly-32ch
21+ FERNET_TOKEN_KEY : sp1gRbNPAdgva1NX4vYC3gZDNu--cUiGM5H9xhtltN8=
22+ FERNET_FIELD_KEY : aQyP7tOjb06jmhH0Ni3Y04CqcrzrnK_KnuurAOUWl4c=
23+ POSTGRES_PASSWORD : ci_test_password
24+ USER_DB_PASSWORD : ci_test_password
25+ SERVICE_AUTH_SERVICE_SECRET : ci-test-service-secret-for-auth-32chars!!
26+ ENVIRONMENT : test
27+ KAFKA_ENABLED : " false"
28+ LOG_LEVEL : WARNING
1529
1630jobs :
1731 lint :
@@ -37,29 +51,12 @@ jobs:
3751 continue-on-error : true
3852 run : ruff check . --statistics 2>&1 | tail -25
3953
54+ # Shared-library + cross-cutting suites. All steps HARD-GATED (no masking):
55+ # a red step fails the job, which is the whole point of Phase 0.
4056 test :
41- name : Unit Tests
57+ name : Core & Shared Tests
4258 runs-on : ubuntu-latest
4359 needs : lint
44- env :
45- # Auth / JWT
46- AUTH_SECRET_KEY : ci-test-secret-key-minimum-32-characters-long!!
47- SECURITY_JWT_SECRET : ci-test-secret-key-minimum-32-characters-long!!
48- USER_SERVICE_JWT_SECRET_KEY : ci-test-secret-key-minimum-32-characters-long!!
49- # Encryption
50- ENCRYPTION_MASTER_KEY : ci-test-encrypt-key-exactly-32ch
51- USER_SERVICE_FIELD_ENCRYPTION_KEY : ci-test-encrypt-key-exactly-32ch
52- FERNET_TOKEN_KEY : sp1gRbNPAdgva1NX4vYC3gZDNu--cUiGM5H9xhtltN8=
53- FERNET_FIELD_KEY : aQyP7tOjb06jmhH0Ni3Y04CqcrzrnK_KnuurAOUWl4c=
54- # Database
55- POSTGRES_PASSWORD : ci_test_password
56- USER_DB_PASSWORD : ci_test_password
57- # Service Auth
58- SERVICE_AUTH_SERVICE_SECRET : ci-test-service-secret-for-auth-32chars!!
59- # Runtime
60- ENVIRONMENT : test
61- KAFKA_ENABLED : " false"
62- LOG_LEVEL : WARNING
6360 steps :
6461 - uses : actions/checkout@v4
6562
@@ -82,23 +79,71 @@ jobs:
8279 run : pytest tests/alignment/ -x -q --no-header
8380
8481 - name : Run shared library tests
85- continue-on-error : true
8682 run : |
87- pytest tests/solace_common/ -x - q --no-header 2>&1 || true
88- pytest tests/solace_security/ -x - q --no-header 2>&1 || true
83+ pytest tests/solace_common/ -q --no-header
84+ pytest tests/solace_security/ -q --no-header
8985
90- - name : Run service unit tests
91- continue-on-error : true
86+ # Per-service unit tests, one matrix leg each. HARD-GATED, fail-fast off so
87+ # every service reports independently. config_service has no tests dir yet.
88+ service-tests :
89+ name : Service Tests (${{ matrix.service.name }})
90+ runs-on : ubuntu-latest
91+ needs : lint
92+ strategy :
93+ fail-fast : false
94+ matrix :
95+ service :
96+ - { dir: "safety_service", name: "safety" }
97+ - { dir: "diagnosis_service", name: "diagnosis" }
98+ - { dir: "therapy_service", name: "therapy" }
99+ - { dir: "memory_service", name: "memory" }
100+ - { dir: "personality_service", name: "personality" }
101+ - { dir: "orchestrator_service", name: "orchestrator" }
102+ - { dir: "user-service", name: "user" }
103+ - { dir: "notification-service", name: "notification" }
104+ - { dir: "analytics-service", name: "analytics" }
105+ steps :
106+ - uses : actions/checkout@v4
107+
108+ - name : Set up Python
109+ uses : actions/setup-python@v5
110+ with :
111+ python-version : ${{ env.PYTHON_VERSION }}
112+ cache : pip
113+
114+ - name : Install dependencies
115+ run : |
116+ python -m pip install --upgrade pip
117+ pip install -e ".[dev]"
118+ pip install pytest-mock pytest-asyncio httpx
119+
120+ - name : Run ${{ matrix.service.name }} tests
121+ run : pytest services/${{ matrix.service.dir }}/tests/ -q --no-header
122+
123+ # Integration suites that run against mocked/in-memory deps. HARD-GATED.
124+ # The live-infra file needs real Postgres/Redis/Kafka/Weaviate and is deferred
125+ # to Sprint B.3 (staging) rather than silently masked here.
126+ integration-tests :
127+ name : Integration Tests
128+ runs-on : ubuntu-latest
129+ needs : lint
130+ steps :
131+ - uses : actions/checkout@v4
132+
133+ - name : Set up Python
134+ uses : actions/setup-python@v5
135+ with :
136+ python-version : ${{ env.PYTHON_VERSION }}
137+ cache : pip
138+
139+ - name : Install dependencies
92140 run : |
93- pytest services/safety_service/tests/ -q --no-header --ignore=services/safety_service/tests/test_api.py 2>&1 || true
94- pytest services/diagnosis_service/tests/ -q --no-header 2>&1 || true
95- pytest services/therapy_service/tests/ -q --no-header 2>&1 || true
96- pytest services/memory_service/tests/ -q --no-header 2>&1 || true
97- pytest services/personality_service/tests/ -q --no-header 2>&1 || true
141+ python -m pip install --upgrade pip
142+ pip install -e ".[dev]"
143+ pip install pytest-mock pytest-asyncio httpx
98144
99- - name : Run integration tests
100- continue-on-error : true
101- run : pytest tests/integration/ -q --no-header 2>&1 || true
145+ - name : Run integration tests (mocked deps)
146+ run : pytest tests/integration/ -q --no-header --ignore=tests/integration/test_service_integration.py
102147
103148 docker-build :
104149 name : Docker Build
0 commit comments