Skip to content

Commit bb209dd

Browse files
committed
Merge: resolve conflict in CLAUDE.md
- Keep both remote changes (MCP server recommendations) - Keep feature development quality standards - Combine both sections cleanly
2 parents d66a750 + e1675a3 commit bb209dd

File tree

121 files changed

+31454
-336
lines changed

Some content is hidden

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

121 files changed

+31454
-336
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: E2E Full Suite
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
e2e-full-suite:
10+
timeout-minutes: 60
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
project: [chromium-full, firefox-full, webkit-full]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
cache: 'npm'
27+
cache-dependency-path: apps/frontend/package-lock.json
28+
29+
- name: Install dependencies
30+
working-directory: apps/frontend
31+
run: npm ci
32+
33+
- name: Install Playwright Browsers
34+
working-directory: apps/frontend
35+
run: npx playwright install --with-deps chromium firefox webkit
36+
37+
- name: Run E2E Full Suite
38+
working-directory: apps/frontend
39+
run: npm run test:e2e:full -- --project=${{ matrix.project }}
40+
env:
41+
CI: true
42+
SKIP_AUTH: true # Use auth bypass in CI for now
43+
44+
- name: Upload test results
45+
if: failure()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: test-results-${{ matrix.project }}
49+
path: apps/frontend/test-results/
50+
retention-days: 30
51+
52+
- name: Upload Playwright report
53+
if: always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: playwright-report-${{ matrix.project }}
57+
path: apps/frontend/playwright-report/
58+
retention-days: 30
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Integration Tests
2+
3+
on:
4+
schedule:
5+
# Run nightly at 2 AM UTC
6+
- cron: '0 2 * * *'
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
integration-tests:
11+
name: Integration Tests
12+
timeout-minutes: 30
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install uv
25+
run: pip install uv
26+
27+
- name: Install dependencies
28+
working-directory: apps/backend
29+
run: uv sync
30+
31+
- name: Start test services
32+
working-directory: apps/backend
33+
run: docker compose -f docker-compose.test.yml up -d
34+
35+
- name: Wait for services to be ready
36+
run: |
37+
echo "Waiting for MongoDB..."
38+
timeout 60 bash -c 'until docker exec narrative-mongodb-test mongosh --eval "db.adminCommand(\"ping\")" > /dev/null 2>&1; do sleep 2; done'
39+
echo "Waiting for Redis..."
40+
timeout 60 bash -c 'until docker exec narrative-redis-test redis-cli ping > /dev/null 2>&1; do sleep 2; done'
41+
echo "Waiting for LocalStack..."
42+
timeout 60 bash -c 'until curl -f http://localhost:4566/_localstack/health > /dev/null 2>&1; do sleep 2; done'
43+
echo "All services ready!"
44+
45+
- name: Run integration tests with coverage
46+
working-directory: apps/backend
47+
run: |
48+
PYTHONPATH=. uv run pytest \
49+
tests/integration/ \
50+
-v \
51+
-m integration \
52+
--cov=app \
53+
--cov-report=xml \
54+
--cov-report=term-missing
55+
env:
56+
TEST_MONGODB_URI: mongodb://localhost:27018
57+
TEST_MONGODB_DB: narrative_test
58+
TEST_REDIS_URL: redis://localhost:6380/0
59+
S3_ENDPOINT_URL: http://localhost:4566
60+
AWS_ACCESS_KEY_ID: test
61+
AWS_SECRET_ACCESS_KEY: test
62+
AWS_DEFAULT_REGION: us-east-1
63+
OPENAI_API_KEY: sk-test-key-for-mocking
64+
65+
- name: Upload coverage to Codecov
66+
uses: codecov/codecov-action@v4
67+
with:
68+
files: apps/backend/coverage.xml
69+
flags: backend-integration
70+
name: integration-tests
71+
fail_ci_if_error: false
72+
env:
73+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
74+
75+
- name: Upload coverage artifact
76+
if: always()
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: integration-coverage
80+
path: apps/backend/coverage.xml
81+
retention-days: 30
82+
83+
- name: Upload test results
84+
if: failure()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: integration-test-results
88+
path: apps/backend/test-results/
89+
retention-days: 30
90+
91+
- name: Stop test services
92+
if: always()
93+
working-directory: apps/backend
94+
run: docker compose -f docker-compose.test.yml down -v

.github/workflows/unit-tests.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
backend-unit-tests:
11+
name: Backend Unit Tests
12+
timeout-minutes: 15
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install uv
25+
run: pip install uv
26+
27+
- name: Install dependencies
28+
working-directory: apps/backend
29+
run: uv sync
30+
31+
- name: Run unit tests with coverage
32+
working-directory: apps/backend
33+
run: |
34+
PYTHONPATH=. uv run pytest \
35+
tests/test_security/ \
36+
tests/test_processing/ \
37+
tests/test_utils/ \
38+
tests/test_model_training/test_problem_detector.py \
39+
tests/test_model_training/test_feature_engineer.py \
40+
-m "not integration" \
41+
--cov=app \
42+
--cov-report=xml \
43+
--cov-report=term-missing \
44+
-v
45+
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v4
48+
with:
49+
files: apps/backend/coverage.xml
50+
flags: backend-unit
51+
name: backend-unit-tests
52+
fail_ci_if_error: false
53+
env:
54+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
55+
56+
- name: Upload coverage artifact
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: backend-unit-coverage
61+
path: apps/backend/coverage.xml
62+
retention-days: 30
63+
64+
frontend-unit-tests:
65+
name: Frontend Unit Tests
66+
timeout-minutes: 10
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: 18
77+
cache: 'npm'
78+
cache-dependency-path: apps/frontend/package-lock.json
79+
80+
- name: Install dependencies
81+
working-directory: apps/frontend
82+
run: npm ci
83+
84+
- name: Run unit tests with coverage
85+
working-directory: apps/frontend
86+
run: npm test -- --coverage --watchAll=false
87+
env:
88+
CI: true
89+
90+
- name: Upload coverage to Codecov
91+
uses: codecov/codecov-action@v4
92+
with:
93+
files: apps/frontend/coverage/lcov.info
94+
flags: frontend-unit
95+
name: frontend-unit-tests
96+
fail_ci_if_error: false
97+
env:
98+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
99+
100+
- name: Upload coverage artifact
101+
if: always()
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: frontend-unit-coverage
105+
path: apps/frontend/coverage/
106+
retention-days: 30

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
.github
23

34
# dependencies
45
/node_modules
@@ -64,3 +65,6 @@ infrastructure/secrets/
6465

6566
# Large binary files
6667
scripts/awscliv2.zip
68+
69+
# Serena MCP server data
70+
.serena/

CLAUDE.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ This is a Narrative Modeling App - an AI-guided platform that democratizes machi
5252
- MCP: `cd apps/mcp && uv run pytest`
5353

5454
## Test Suite Status
55-
- Backend: 132/151 unit tests passing (87.4%)
56-
- Integration tests require MongoDB connection
57-
- See `apps/backend/TEST_STATUS.md` for details
55+
- Backend: 201/201 tests passing (100%) ✅
56+
- Unit tests: 190 passing (no database required)
57+
- Integration tests: 11 passing (require MongoDB)
58+
- Frontend: Jest tests configured
59+
- MCP: Pytest suite available
60+
- See `apps/backend/docs/TEST_INFRASTRUCTURE.md` for testing guide
61+
- See `apps/backend/docs/SPRINT_8_COMPLETION.md` for Sprint 8 details
5862

5963
## Environment Variables
6064
- Frontend: `.env.local`
@@ -69,21 +73,36 @@ This is a Narrative Modeling App - an AI-guided platform that democratizes machi
6973
4. Frontend displays results with visualizations
7074

7175
## Current Stage
72-
Sprint 6+ - Advanced features phase with 8-stage workflow system complete. Data transformation pipeline fully integrated between frontend and backend. NextAuth migration complete. Focus shifting to workflow persistence and advanced ML tools.
76+
**Sprint 8 Complete** ✅ - Resilience patterns and API versioning fully implemented. Circuit breakers protect critical services. Versioned API (v1) with backward compatibility. Test infrastructure overhauled with 100% passing tests. Production-ready with fault tolerance.
77+
78+
Previous: Sprint 7 - JWT authentication, health checks, 8-stage workflow, data transformation pipeline, NextAuth v5.
7379

7480
## MCP Server Setup
75-
When using Claude Desktop with this project, install the Context7 MCP server for better context management:
81+
This project includes a custom MCP server for advanced data processing. To use it with Claude Desktop:
82+
7683
```json
7784
{
7885
"mcpServers": {
79-
"context7": {
80-
"command": "npx",
81-
"args": ["-y", "@upstash/context7-mcp"]
86+
"narrative-modeling": {
87+
"command": "uv",
88+
"args": [
89+
"--directory",
90+
"/path/to/narrative-modeling-app/apps/mcp",
91+
"run",
92+
"mcp",
93+
"dev",
94+
"server.py"
95+
]
8296
}
8397
}
8498
}
8599
```
86-
Add this to `~/.config/claude/claude_desktop_config.json` and restart Claude Desktop.
100+
101+
Add this to `~/.config/claude/claude_desktop_config.json` and restart Claude Desktop. Replace `/path/to/narrative-modeling-app` with your actual project path.
102+
103+
Additional recommended MCP servers:
104+
- **Context7** - For library documentation lookup
105+
- **Serena** - For project memory and session management
87106

88107
## Feature Development Quality Standards
89108

0 commit comments

Comments
 (0)