Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7beccac
feat: Complete Task 5.1 - Comprehensive API endpoint unit tests
digital-thinking Feb 10, 2026
2a2623e
feat: Complete Vue.js migration from Streamlit
digital-thinking Feb 11, 2026
7a2a08f
docs: Complete migration documentation with PR #7 link
digital-thinking Feb 11, 2026
8206cc6
fix: update deprecated GitHub Actions to v4
digital-thinking Feb 11, 2026
7791027
Fix CI Python import issues for fin_trade module
digital-thinking Feb 11, 2026
095b690
Fix GitHub Actions CI/CD failures
digital-thinking Feb 11, 2026
0054a26
Fix performance tests: install pytest-benchmark with Poetry
digital-thinking Feb 11, 2026
cbeb2c0
Fix CI/CD workflows for PR #7: Integration tests, E2E tests, and pack…
digital-thinking Feb 11, 2026
22b7aa8
Fix all import paths and module structure issues
digital-thinking Feb 11, 2026
8c20d93
Fix API service imports and integration test method calls
digital-thinking Feb 11, 2026
feaf205
Replace complex integration test with working simple version
digital-thinking Feb 11, 2026
6673dd3
Fix API integration issues and implement portfolio management logic
digital-thinking Feb 11, 2026
df213b2
Fix GitHub Actions: Use existing test_service_integration_simple.py file
digital-thinking Feb 11, 2026
09ba228
Fix Playwright E2E config: enable server reuse + fix HTML reporter path
digital-thinking Feb 11, 2026
ee67658
Fix E2E tests: Convert require() to import statements for ES modules
digital-thinking Feb 11, 2026
f171db4
Fix integration test: Use portfolio.config.name instead of portfolio.…
digital-thinking Feb 11, 2026
5f3eaf7
Fix CI test failures: Add missing methods and models
digital-thinking Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"permissions": {
"allow": [
"Bash(poetry run streamlit:*)",
"Bash(poetry install:*)",
"Bash(poetry lock:*)",
"Bash(poetry run python:*)",
Expand All @@ -10,15 +9,13 @@
"Bash(git show:*)",
"Bash(git rev-parse:*)",
"Bash(sed -i:*)",
"Bash(*gh.exe* pr view *\")",
"Bash(*gh.exe* pr diff *\")",
"Bash(*gh.exe* pr list *\")",
"Bash(*gh.exe* issue *\")",
"Bash(*gh.exe* repo view *\")",
"Bash(Select-String -Pattern \"^diff --git *\")",
"Bash(del pr_comment.md)",
"Bash(grep:*)",
"Bash(wc:*)"
"Bash(wc:*)",
"Bash(gh api:*)",
"Bash(gh pr view:*)",
"Bash(gh pr diff:*)"
]
}
}
344 changes: 344 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,344 @@
name: E2E Tests

on:
push:
branches: [ main, frontend/vue-migration ]
pull_request:
branches: [ main, frontend/vue-migration ]
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'

jobs:
e2e-tests:
name: E2E Tests (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install

- name: Install Node.js dependencies
working-directory: ./frontend
run: npm ci

- name: Install Playwright browsers
working-directory: ./frontend
run: npx playwright install ${{ matrix.browser }} --with-deps

- name: Start backend server
run: |
poetry run python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000 &
# Wait for backend to be ready
timeout 30 bash -c 'until curl -f http://localhost:8000/health; do sleep 1; done'
env:
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/backend

- name: Start frontend server
working-directory: ./frontend
run: |
# Start frontend server with host binding for CI
npm run dev -- --host 0.0.0.0 --port 3000 &
FRONTEND_PID=$!
# Wait for frontend to be ready with better error handling
echo "Waiting for frontend server to start..."
for i in {1..30}; do
if curl -f http://localhost:3000 > /dev/null 2>&1; then
echo "Frontend server is ready!"
break
fi
if ! kill -0 $FRONTEND_PID > /dev/null 2>&1; then
echo "Frontend server process died, checking logs..."
exit 1
fi
echo "Attempt $i/30: Frontend not ready yet, waiting..."
sleep 2
done
# Final check
curl -f http://localhost:3000 || (echo "Frontend server failed to start" && exit 1)

- name: Run E2E tests
working-directory: ./frontend
run: npx playwright test --project=${{ matrix.browser }}
env:
CI: true

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results-${{ matrix.browser }}
path: |
frontend/test-results/
frontend/playwright-report/
retention-days: 7

e2e-mobile:
name: E2E Mobile Tests
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install

- name: Install Node.js dependencies
working-directory: ./frontend
run: npm ci

- name: Install Playwright browsers
working-directory: ./frontend
run: npx playwright install chromium --with-deps

- name: Start backend server
run: |
poetry run python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000 &
timeout 30 bash -c 'until curl -f http://localhost:8000/health; do sleep 1; done'
env:
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/backend

- name: Start frontend server
working-directory: ./frontend
run: |
npm run dev -- --host 0.0.0.0 --port 3000 &
FRONTEND_PID=$!
echo "Waiting for frontend server to start..."
for i in {1..30}; do
if curl -f http://localhost:3000 > /dev/null 2>&1; then
echo "Frontend server is ready!"
break
fi
if ! kill -0 $FRONTEND_PID > /dev/null 2>&1; then
echo "Frontend server process died, checking logs..."
exit 1
fi
echo "Attempt $i/30: Frontend not ready yet, waiting..."
sleep 2
done
curl -f http://localhost:3000 || (echo "Frontend server failed to start" && exit 1)

- name: Run Mobile E2E tests
working-directory: ./frontend
run: npx playwright test --project="Mobile Chrome" --project="Mobile Safari"
env:
CI: true

- name: Upload mobile test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results-mobile
path: |
frontend/test-results/
frontend/playwright-report/
retention-days: 7

performance-tests:
name: E2E Performance Tests
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
cd frontend && npm ci

- name: Install Playwright
working-directory: ./frontend
run: npx playwright install chromium --with-deps

- name: Start servers
run: |
# Start backend
poetry run python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000 &
echo "Starting backend server..."
timeout 30 bash -c 'until curl -f http://localhost:8000/health; do sleep 1; done'
echo "Backend server ready!"

# Start frontend
cd frontend
npm run dev -- --host 0.0.0.0 --port 3000 &
FRONTEND_PID=$!
echo "Starting frontend server..."
for i in {1..30}; do
if curl -f http://localhost:3000 > /dev/null 2>&1; then
echo "Frontend server ready!"
break
fi
if ! kill -0 $FRONTEND_PID > /dev/null 2>&1; then
echo "Frontend server process died"
exit 1
fi
sleep 2
done
curl -f http://localhost:3000 || exit 1
env:
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/backend

- name: Run performance tests
working-directory: ./frontend
run: npx playwright test cross-browser.spec.js --grep "Performance" --project=chromium
env:
CI: true

- name: Upload performance results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-performance-results
path: |
frontend/test-results/
frontend/playwright-report/
retention-days: 30

test-report:
name: Generate Test Report
runs-on: ubuntu-latest
needs: [e2e-tests, e2e-mobile]
if: always()

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/

- name: Merge test results
run: |
mkdir -p merged-results
find artifacts/ -name "*.json" -exec cp {} merged-results/ \;
find artifacts/ -name "*.xml" -exec cp {} merged-results/ \;

- name: Generate combined report
run: |
echo "# E2E Test Results" > test-summary.md
echo "" >> test-summary.md
echo "## Browser Test Results" >> test-summary.md

for browser in chromium firefox webkit mobile; do
if [ -d "artifacts/playwright-results-$browser" ]; then
echo "### $browser" >> test-summary.md
if [ -f "artifacts/playwright-results-$browser/results.json" ]; then
echo "βœ… Tests completed" >> test-summary.md
else
echo "❌ Tests failed or incomplete" >> test-summary.md
fi
fi
done

- name: Upload combined report
uses: actions/upload-artifact@v4
with:
name: combined-test-report
path: |
merged-results/
test-summary.md
retention-days: 30

- name: Comment PR with results
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
if (fs.existsSync('test-summary.md')) {
const summary = fs.readFileSync('test-summary.md', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '## 🎭 E2E Test Results\n\n' + summary
});
}

slack-notification:
name: Slack Notification
runs-on: ubuntu-latest
needs: [e2e-tests, e2e-mobile, performance-tests]
if: failure() && github.ref == 'refs/heads/main'

steps:
- name: Notify Slack on failure
uses: 8398a7/action-slack@v3
with:
status: failure
title: "🚨 E2E Tests Failed on Main Branch"
text: |
E2E tests failed on the main branch.

**Repository:** ${{ github.repository }}
**Commit:** ${{ github.sha }}
**Author:** ${{ github.actor }}
**Workflow:** ${{ github.workflow }}

Please check the test results and fix any issues.
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading
Loading