Skip to content

Commit 05c8b8f

Browse files
Merge pull request #167 from thestumonkey/robot2
Robot2
2 parents 2ae5946 + 1b4f802 commit 05c8b8f

File tree

94 files changed

+9048
-3990
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+9048
-3990
lines changed

.github/workflows/integration-tests.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,25 @@ jobs:
2727
steps:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
30-
30+
31+
- name: Verify required secrets
32+
env:
33+
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
34+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
35+
run: |
36+
echo "Verifying required secrets..."
37+
if [ -z "$DEEPGRAM_API_KEY" ]; then
38+
echo "❌ ERROR: DEEPGRAM_API_KEY secret is not set"
39+
exit 1
40+
fi
41+
if [ -z "$OPENAI_API_KEY" ]; then
42+
echo "❌ ERROR: OPENAI_API_KEY secret is not set"
43+
exit 1
44+
fi
45+
echo "✓ DEEPGRAM_API_KEY is set (length: ${#DEEPGRAM_API_KEY})"
46+
echo "✓ OPENAI_API_KEY is set (length: ${#OPENAI_API_KEY})"
47+
echo "✓ All required secrets verified"
48+
3149
- name: Set up Docker Buildx
3250
uses: docker/setup-buildx-action@v3
3351

.github/workflows/robot-tests.yml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ jobs:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
2626

27+
- name: Verify required secrets
28+
env:
29+
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
30+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
31+
run: |
32+
echo "Verifying required secrets..."
33+
if [ -z "$DEEPGRAM_API_KEY" ]; then
34+
echo "❌ ERROR: DEEPGRAM_API_KEY secret is not set"
35+
exit 1
36+
fi
37+
if [ -z "$OPENAI_API_KEY" ]; then
38+
echo "❌ ERROR: OPENAI_API_KEY secret is not set"
39+
exit 1
40+
fi
41+
echo "✓ DEEPGRAM_API_KEY is set (length: ${#DEEPGRAM_API_KEY})"
42+
echo "✓ OPENAI_API_KEY is set (length: ${#OPENAI_API_KEY})"
43+
echo "✓ All required secrets verified"
44+
2745
- name: Set up Docker Buildx
2846
uses: docker/setup-buildx-action@v3
2947
with:
@@ -161,6 +179,26 @@ jobs:
161179
162180
echo "✓ All services ready!"
163181
182+
- name: Verify checked out code
183+
working-directory: tests
184+
run: |
185+
echo "Current git commit:"
186+
git log -1 --oneline
187+
echo ""
188+
echo "Test files in current checkout:"
189+
find . -name "*.robot" -type f | head -10
190+
echo ""
191+
echo "Sample of tags in test files:"
192+
grep -h "\[Tags\]" endpoints/*.robot infrastructure/*.robot integration/*.robot 2>/dev/null | head -20 || echo "No tag files found"
193+
194+
- name: Clean previous test results
195+
working-directory: tests
196+
run: |
197+
echo "Cleaning any previous test results..."
198+
rm -rf results
199+
mkdir -p results
200+
echo "✓ Fresh results directory created"
201+
164202
- name: Run Robot Framework tests
165203
working-directory: tests
166204
env:
@@ -170,8 +208,11 @@ jobs:
170208
OPENAI_MODEL: gpt-4o-mini
171209
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
172210
run: |
173-
# Run all tests
174-
make all OUTPUTDIR=results || true
211+
# Run all tests (don't fail workflow to allow artifact upload)
212+
make all OUTPUTDIR=results
213+
TEST_EXIT_CODE=$?
214+
echo "test_exit_code=$TEST_EXIT_CODE" >> $GITHUB_ENV
215+
exit 0 # Don't fail here, we'll fail at the end after uploading artifacts
175216
176217
- name: Show service logs
177218
if: always()
@@ -343,3 +384,13 @@ jobs:
343384
working-directory: backends/advanced
344385
run: |
345386
docker compose -f docker-compose-test.yml down -v
387+
388+
- name: Fail workflow if tests failed
389+
if: always()
390+
run: |
391+
if [ "${{ env.test_exit_code }}" != "0" ]; then
392+
echo "❌ Tests failed with exit code ${{ env.test_exit_code }}"
393+
exit 1
394+
else
395+
echo "✅ All tests passed"
396+
fi

.github/workflows/speaker-recognition-tests.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,25 @@ jobs:
3232
steps:
3333
- name: Checkout code
3434
uses: actions/checkout@v4
35-
35+
36+
- name: Verify required secrets
37+
env:
38+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
39+
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
40+
run: |
41+
echo "Verifying required secrets..."
42+
if [ -z "$HF_TOKEN" ]; then
43+
echo "❌ ERROR: HF_TOKEN secret is not set"
44+
exit 1
45+
fi
46+
if [ -z "$DEEPGRAM_API_KEY" ]; then
47+
echo "❌ ERROR: DEEPGRAM_API_KEY secret is not set"
48+
exit 1
49+
fi
50+
echo "✓ HF_TOKEN is set (length: ${#HF_TOKEN})"
51+
echo "✓ DEEPGRAM_API_KEY is set (length: ${#DEEPGRAM_API_KEY})"
52+
echo "✓ All required secrets verified"
53+
3654
- name: Set up Docker Buildx
3755
uses: docker/setup-buildx-action@v3
3856

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,9 @@ extras/openmemory-mcp/data/*
7676
backends/advanced/nginx.conf
7777
backends/advanced/Caddyfile
7878

79+
app/ios/Pods
80+
results
81+
log.html
82+
output.xml
83+
report.html
84+
.secrets

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
repos:
2+
# Local hooks (project-specific checks)
3+
- repo: local
4+
hooks:
5+
# Run Robot Framework endpoint tests before push
6+
- id: robot-framework-tests
7+
name: Robot Framework Tests (Endpoints)
8+
entry: bash -c 'cd tests && make endpoints OUTPUTDIR=.pre-commit-results'
9+
language: system
10+
pass_filenames: false
11+
stages: [push]
12+
verbose: true
13+
14+
# Clean up test results after hook runs
15+
- id: cleanup-test-results
16+
name: Cleanup Test Results
17+
entry: bash -c 'cd tests && rm -rf .pre-commit-results'
18+
language: system
19+
pass_filenames: false
20+
stages: [push]
21+
always_run: true
22+
23+
# Code formatting
224
- repo: https://github.com/psf/black
325
rev: 24.4.2
426
hooks:
@@ -9,6 +31,8 @@ repos:
931
hooks:
1032
- id: isort
1133
files: ^backends/advanced-backend/src/.*\.py$
34+
35+
# File hygiene
1236
- repo: https://github.com/pre-commit/pre-commit-hooks
1337
rev: v4.5.0
1438
hooks:

CLAUDE.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ uv run pytest tests/test_memory_service.py # Single test file
3838
# Environment setup
3939
cp .env.template .env # Configure environment variables
4040

41-
# Setup test environment (optional, for running integration tests)
42-
uv run --with-requirements setup-requirements.txt python setup_test_env.py # Creates .env.test
43-
4441
# Reset data (development)
4542
sudo rm -rf backends/advanced/data/
4643
```
@@ -71,10 +68,6 @@ cd backends/advanced
7168
# Requires .env file with DEEPGRAM_API_KEY and OPENAI_API_KEY
7269
cp .env.template .env # Configure API keys
7370

74-
# Optional: Setup test environment with test-specific credentials
75-
# (wizard.py prompts for this, or run manually)
76-
uv run --with-requirements setup-requirements.txt python setup_test_env.py
77-
7871
# Run full integration test suite
7972
./run-test.sh
8073

@@ -408,6 +401,31 @@ For detailed technical documentation, see:
408401
- **[@docs/speaker-recognition.md](docs/speaker-recognition.md)**: Advanced analysis and live inference features
409402
- **[@docs/distributed-deployment.md](docs/distributed-deployment.md)**: Multi-machine deployment with Tailscale
410403

404+
## Robot Framework Testing
405+
406+
**IMPORTANT: When writing or modifying Robot Framework tests, you MUST follow the testing guidelines.**
407+
408+
Before writing any Robot Framework test:
409+
1. **Read [@tests/TESTING_GUIDELINES.md](tests/TESTING_GUIDELINES.md)** for comprehensive testing patterns and standards
410+
2. **Check [@tests/tags.md](tests/tags.md)** for approved tags - ONLY 11 tags are permitted
411+
3. **SCAN existing resource files** for keywords - NEVER write code that duplicates existing keywords
412+
4. **Follow the Arrange-Act-Assert pattern** with inline verifications (not abstracted to keywords)
413+
414+
Key Testing Rules:
415+
- **Check Existing Keywords FIRST**: Before writing ANY test code, scan relevant resource files (`websocket_keywords.robot`, `queue_keywords.robot`, `conversation_keywords.robot`, etc.) for existing keywords
416+
- **Tags**: ONLY use the 11 approved tags from tags.md, tab-separated (e.g., `[Tags] infra audio-streaming`)
417+
- **Verifications**: Write assertions directly in tests, not in resource keywords
418+
- **Keywords**: Only create keywords for reusable setup/action operations AFTER confirming no existing keyword exists
419+
- **Resources**: Always check existing resource files before creating new keywords or duplicating logic
420+
- **Naming**: Use descriptive names that explain business purpose, not technical implementation
421+
422+
**DO NOT:**
423+
- Write inline code without checking if a keyword already exists for that operation
424+
- Create custom tags (use only the 11 approved tags)
425+
- Abstract verifications into keywords (keep them inline in tests)
426+
- Use space-separated tags (must be tab-separated)
427+
- Skip reading the guidelines before writing tests
428+
411429
## Notes for Claude
412430
Check if the src/ is volume mounted. If not, do compose build so that code changes are reflected. Do not simply run `docker compose restart` as it will not rebuild the image.
413431
Check backends/advanced/Docs for up to date information on advanced backend.

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ menu: ## Show interactive menu (default)
2929
@echo "================================"
3030
@echo
3131
@echo "📋 Quick Actions:"
32+
@echo " setup-dev 🛠️ Setup development environment (git hooks, pre-commit)"
3233
@echo " setup-k8s 🏗️ Complete Kubernetes setup (registry + infrastructure + RBAC)"
3334
@echo " config 📝 Generate all configuration files"
3435
@echo " deploy 🚀 Deploy using configured mode ($(DEPLOYMENT_MODE))"
@@ -114,6 +115,29 @@ help: ## Show detailed help for all targets
114115
@echo "🧹 CLEANUP:"
115116
@echo " clean Clean up generated configuration files"
116117

118+
# ========================================
119+
# DEVELOPMENT SETUP
120+
# ========================================
121+
122+
setup-dev: ## Setup development environment (git hooks, pre-commit)
123+
@echo "🛠️ Setting up development environment..."
124+
@echo ""
125+
@echo "📦 Installing pre-commit..."
126+
@pip install pre-commit 2>/dev/null || pip3 install pre-commit
127+
@echo ""
128+
@echo "🔧 Installing git hooks..."
129+
@pre-commit install --hook-type pre-push
130+
@pre-commit install --hook-type pre-commit
131+
@echo ""
132+
@echo "✅ Development environment setup complete!"
133+
@echo ""
134+
@echo "💡 Hooks installed:"
135+
@echo " • Robot Framework tests run before push"
136+
@echo " • Black/isort format Python code on commit"
137+
@echo " • Code quality checks on commit"
138+
@echo ""
139+
@echo "⚙️ To skip hooks: git push --no-verify / git commit --no-verify"
140+
117141
# ========================================
118142
# KUBERNETES SETUP
119143
# ========================================

backends/advanced/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
!nginx.conf
1717
!nginx.conf.template
1818
!start.sh
19+
!start-k8s.sh
1920
!start-workers.sh
2021
!Caddyfile

0 commit comments

Comments
 (0)