Skip to content

Commit 5b66363

Browse files
authored
Merge pull request #98 from rootcodelabs/wip
Pulling changes from wip to dev
2 parents 034c312 + b674b5e commit 5b66363

475 files changed

Lines changed: 77131 additions & 227 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Docker ignore file for LLM Orchestration Service
2+
# Exclude unnecessary files from Docker build context
3+
4+
# Git
5+
.git
6+
.gitignore
7+
8+
# Python
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
*.so
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# Virtual environments
32+
.env
33+
.venv
34+
env/
35+
venv/
36+
ENV/
37+
env.bak/
38+
venv.bak/
39+
40+
# IDE
41+
.vscode/
42+
.idea/
43+
*.swp
44+
*.swo
45+
*~
46+
47+
# OS
48+
.DS_Store
49+
.DS_Store?
50+
._*
51+
.Spotlight-V100
52+
.Trashes
53+
ehthumbs.db
54+
Thumbs.db
55+
56+
# Logs
57+
*.log
58+
logs/
59+
*.log.*
60+
61+
# Testing
62+
.pytest_cache/
63+
.coverage
64+
htmlcov/
65+
.tox/
66+
coverage.xml
67+
68+
# Documentation
69+
docs/
70+
*.md
71+
!README.md
72+
73+
# Config files (will be mounted)
74+
.env.local
75+
.env.development
76+
.env.test
77+
78+
# Cache directories
79+
.ruff_cache/
80+
.mypy_cache/
81+
.pyright_cache/
82+
83+
# Test files
84+
test_*.py
85+
*_test.py
86+
tests/
87+
88+
# Development scripts
89+
run_*.py
90+
test_*.py
91+
92+
# Temporary files
93+
*.tmp
94+
*.temp
95+
.temporary
96+
97+
# Node modules (if any)
98+
node_modules/
99+
100+
# Docker files (except the specific one being built)
101+
Dockerfile*
102+
!Dockerfile.llm_orchestration_service
103+
docker-compose*.yml
104+
105+
# Grafana configs (not needed for this service)
106+
grafana-configs/

.env.example

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: DeepEval RAG System Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- '.github/workflows/deepeval-tests.yml'
10+
11+
jobs:
12+
deepeval-tests:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 40
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: '.python-version'
24+
25+
- name: Set up uv
26+
uses: astral-sh/setup-uv@v6
27+
28+
- name: Install dependencies (locked)
29+
run: uv sync --frozen
30+
31+
- name: Run DeepEval tests
32+
id: run_tests
33+
env:
34+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
35+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
36+
run: uv run python -m pytest tests/deepeval_tests/standard_tests.py -v --tb=short
37+
38+
- name: Generate evaluation report
39+
if: always()
40+
run: python tests/deepeval_tests/report_generator.py
41+
42+
- name: Comment PR with test results
43+
if: always() && github.event_name == 'pull_request'
44+
uses: actions/github-script@v7
45+
with:
46+
script: |
47+
const fs = require('fs');
48+
49+
try {
50+
const reportContent = fs.readFileSync('test_report.md', 'utf8');
51+
52+
const comments = await github.rest.issues.listComments({
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
issue_number: context.issue.number
56+
});
57+
58+
const existingComment = comments.data.find(
59+
comment => comment.user.login === 'github-actions[bot]' &&
60+
comment.body.includes('RAG System Evaluation Report')
61+
);
62+
63+
if (existingComment) {
64+
await github.rest.issues.updateComment({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
comment_id: existingComment.id,
68+
body: reportContent
69+
});
70+
} else {
71+
await github.rest.issues.createComment({
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
issue_number: context.issue.number,
75+
body: reportContent
76+
});
77+
}
78+
79+
} catch (error) {
80+
console.error('Failed to post test results:', error);
81+
82+
await github.rest.issues.createComment({
83+
issue_number: context.issue.number,
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
body: `## RAG System Evaluation Report\n\n**Error generating test report**\n\nFailed to read or post test results. Check workflow logs for details.\n\nError: ${error.message}`
87+
});
88+
}
89+
90+
- name: Check test results and fail if needed
91+
if: always()
92+
run: |
93+
# Check if pytest ran (look at step output)
94+
if [ "${{ steps.run_tests.outcome }}" == "failure" ]; then
95+
echo "Tests ran but failed - this is expected if RAG performance is below threshold"
96+
fi
97+
if [ -f "pytest_captured_results.json" ]; then
98+
total_tests=$(jq '.total_tests // 0' pytest_captured_results.json)
99+
passed_tests=$(jq '.passed_tests // 0' pytest_captured_results.json)
100+
101+
if [ "$total_tests" -eq 0 ]; then
102+
echo "ERROR: No tests were executed"
103+
exit 1
104+
fi
105+
106+
pass_rate=$(awk "BEGIN {print ($passed_tests / $total_tests) * 100}")
107+
108+
echo "DeepEval Test Results:"
109+
echo "Total Tests: $total_tests"
110+
echo "Passed Tests: $passed_tests"
111+
echo "Pass Rate: $pass_rate%"
112+
113+
if (( $(echo "$pass_rate < 70" | bc -l) )); then
114+
echo "TEST FAILURE: Pass rate $pass_rate% is below threshold 70%"
115+
echo "RAG system performance is below acceptable standards."
116+
exit 1
117+
else
118+
echo "TEST SUCCESS: Pass rate $pass_rate% meets threshold 70%"
119+
fi
120+
else
121+
echo "ERROR: No test results file found"
122+
exit 1
123+
fi

0 commit comments

Comments
 (0)