Skip to content

Commit 944fc62

Browse files
committed
Refactor test execution and enhance documentation for integration tests
- Simplified test execution commands in CLAUDE.md and quickstart.md for better usability. - Added instructions for running tests from the project root and clarified the process for executing the complete Robot Framework test suite. - Introduced a new Docker service for the Deepgram streaming worker in docker-compose-test.yml to improve testing capabilities. - Updated system_admin_tests.robot to use a defined default prompt for restoration, enhancing test reliability and clarity.
1 parent 916135e commit 944fc62

File tree

5 files changed

+54
-20
lines changed

5 files changed

+54
-20
lines changed

CLAUDE.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,8 @@ cp .env.template .env # Configure API keys
114114
# Run full integration test suite
115115
./run-test.sh
116116

117-
# Manual test execution (for debugging)
118-
source .env && export DEEPGRAM_API_KEY && export OPENAI_API_KEY
119-
uv run robot --outputdir test-results --loglevel INFO ../../tests/integration/integration_test.robot
120-
121117
# Leave test containers running for debugging (don't auto-cleanup)
122-
CLEANUP_CONTAINERS=false source .env && export DEEPGRAM_API_KEY && export OPENAI_API_KEY
123-
uv run robot --outputdir test-results --loglevel INFO ../../tests/integration/integration_test.robot
124-
125-
# Manual cleanup when needed
126-
docker compose -f docker-compose-test.yml down -v
118+
CLEANUP_CONTAINERS=false ./run-test.sh
127119
```
128120

129121
#### Test Configuration Flags

Docs/getting-started.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,16 @@ PARAKEET_ASR_URL=http://host.docker.internal:8080
175175

176176
After configuration, verify everything works with the integration test suite:
177177
```bash
178+
# From backends/advanced directory
178179
./run-test.sh
179180

180-
# Alternative: Manual test with detailed logging
181-
source .env && export DEEPGRAM_API_KEY OPENAI_API_KEY && \
182-
uv run robot --outputdir ../../test-results --loglevel INFO ../../tests/integration/integration_test.robot
181+
# Or run all tests from project root
182+
cd ../..
183+
./run-test.sh advanced-backend
184+
185+
# Or run complete Robot Framework test suite
186+
cd tests
187+
./run-robot-tests.sh
183188
```
184189
This end-to-end test validates the complete audio processing pipeline using Robot Framework.
185190

backends/advanced/Docs/quickstart.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@ PARAKEET_ASR_URL=http://host.docker.internal:8080
173173

174174
After configuration, verify everything works with the integration test suite:
175175
```bash
176+
# From backends/advanced directory
176177
./run-test.sh
177178

178-
# Alternative: Manual test with detailed logging
179-
source .env && export DEEPGRAM_API_KEY OPENAI_API_KEY && \
180-
uv run robot --outputdir ../../test-results --loglevel INFO ../../tests/integration/integration_test.robot
179+
# Or run all tests from project root
180+
cd ../..
181+
./run-test.sh advanced-backend
182+
183+
# Or run complete Robot Framework test suite
184+
cd tests
185+
./run-robot-tests.sh
181186
```
182187
This end-to-end test validates the complete audio processing pipeline using Robot Framework.
183188

backends/advanced/docker-compose-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,39 @@ services:
200200
condition: service_healthy
201201
restart: unless-stopped
202202

203+
deepgram-streaming-worker-test:
204+
build:
205+
context: .
206+
dockerfile: Dockerfile
207+
command: >
208+
uv run python -m advanced_omi_backend.workers.audio_stream_deepgram_streaming_worker
209+
volumes:
210+
- ./src:/app/src
211+
- ./data/test_data:/app/data
212+
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml
213+
- ${PLUGINS_CONFIG:-../../config/plugins.yml}:/app/plugins.yml
214+
environment:
215+
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
216+
- REDIS_URL=redis://redis-test:6379/0
217+
- HA_TOKEN=${HA_TOKEN}
218+
- MONGODB_URI=mongodb://mongo-test:27017/test_db
219+
- QDRANT_BASE_URL=qdrant-test
220+
- QDRANT_PORT=6333
221+
- DEBUG_DIR=/app/debug_dir
222+
- OPENAI_API_KEY=${OPENAI_API_KEY}
223+
- GROQ_API_KEY=${GROQ_API_KEY}
224+
- AUTH_SECRET_KEY=test-jwt-signing-key-for-integration-tests
225+
- ADMIN_PASSWORD=test-admin-password-123
226+
- ADMIN_EMAIL=test-admin@example.com
227+
- TRANSCRIPTION_PROVIDER=${TRANSCRIPTION_PROVIDER:-deepgram}
228+
- MEMORY_PROVIDER=${MEMORY_PROVIDER:-chronicle}
229+
depends_on:
230+
redis-test:
231+
condition: service_started
232+
mongo-test:
233+
condition: service_healthy
234+
restart: unless-stopped
235+
203236
# Mycelia - AI memory and timeline service (test environment)
204237
# mycelia-backend-test:
205238
# build:

tests/endpoints/system_admin_tests.robot

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,8 @@ Save And Retrieve Chat Configuration Test
190190
[Documentation] Test saving and retrieving chat configuration
191191
[Tags] infra permissions
192192
193-
# Get original prompt to restore later
194-
${response}= GET On Session api /api/admin/chat/config
195-
${original_prompt}= Set Variable ${response.text}
193+
# Define known default prompt for restoration (from system_controller.py and chat_service.py)
194+
${default_prompt}= Set Variable You are a helpful AI assistant with access to the user's personal memories and conversation history.
196195

197196
# Save custom prompt
198197
${custom_prompt}= Set Variable You are a specialized AI assistant for technical support and troubleshooting.
@@ -210,9 +209,9 @@ Save And Retrieve Chat Configuration Test
210209
${retrieved}= Set Variable ${response.text}
211210
Should Be Equal ${retrieved} ${custom_prompt} msg=Retrieved prompt should match saved prompt
212211

213-
# Restore original prompt to avoid test interference
212+
# Restore default prompt to avoid test interference
214213
${response}= POST On Session api /api/admin/chat/config
215-
... data=${original_prompt}
214+
... data=${default_prompt}
216215
... headers=${headers}
217216
Should Be Equal As Integers ${response.status_code} 200
218217

0 commit comments

Comments
 (0)