fix(ci): set DATABASE_TEST_URL + pin upload-artifact to v3 for Gitea Actions #150
@@ -43,6 +43,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache pip
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: pip-${{ runner.os }}-${{ hashFiles('backend/requirements.txt', 'backend/requirements-dev.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
pip-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
@@ -58,7 +66,11 @@ jobs:
|
|||||||
run: cd backend && python scripts/check_tenant_filters.py
|
run: cd backend && python scripts/check_tenant_filters.py
|
||||||
|
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: cd backend && python -m pytest --override-ini="addopts=" --cov=app --cov-report=term-missing --cov-report=json:coverage.json --cov-fail-under=50
|
# term-missing dropped — the custom "Display coverage summary" step
|
||||||
|
# below parses coverage.json and prints the same info more concisely.
|
||||||
|
# --maxfail=10 short-circuits on structural breakage so we don't burn
|
||||||
|
# 25 minutes when a fixture explodes.
|
||||||
|
run: cd backend && python -m pytest --override-ini="addopts=" --maxfail=10 --cov=app --cov-report=json:coverage.json --cov-fail-under=50
|
||||||
|
|
||||||
- name: Display coverage summary
|
- name: Display coverage summary
|
||||||
if: always()
|
if: always()
|
||||||
@@ -86,6 +98,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: npm-${{ runner.os }}-${{ hashFiles('frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
npm-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: cd frontend && npm ci
|
run: cd frontend && npm ci
|
||||||
|
|
||||||
@@ -136,6 +156,22 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache pip
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: pip-${{ runner.os }}-${{ hashFiles('backend/requirements.txt', 'backend/requirements-dev.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
pip-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: npm-${{ runner.os }}-${{ hashFiles('frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
npm-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install backend dependencies
|
- name: Install backend dependencies
|
||||||
run: pip install --break-system-packages -r backend/requirements.txt -r backend/requirements-dev.txt
|
run: pip install --break-system-packages -r backend/requirements.txt -r backend/requirements-dev.txt
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,18 @@ async def test_record_decision_persists_and_bumps_state_version(
|
|||||||
test_db.add(fix)
|
test_db.add(fix)
|
||||||
await test_db.commit()
|
await test_db.commit()
|
||||||
|
|
||||||
|
# The draft_template path calls TemplateExtractionService, which needs an
|
||||||
|
# AI provider configured. CI doesn't set ANTHROPIC_API_KEY/GOOGLE_AI_API_KEY,
|
||||||
|
# and this test isn't exercising the AI integration — patch the extractor
|
||||||
|
# with a minimal valid response so the rest of the decision flow runs.
|
||||||
|
extractor_stub = AsyncMock(return_value={
|
||||||
|
"templated_body": "Write-Output 'ok'",
|
||||||
|
"parameters": [],
|
||||||
|
})
|
||||||
|
with patch(
|
||||||
|
"app.api.endpoints.session_suggested_fixes._extract_template_parameters",
|
||||||
|
extractor_stub,
|
||||||
|
):
|
||||||
r = await client.post(
|
r = await client.post(
|
||||||
f"/api/v1/ai-sessions/{session.id}/suggested-fixes/{fix.id}/decision",
|
f"/api/v1/ai-sessions/{session.id}/suggested-fixes/{fix.id}/decision",
|
||||||
headers=auth_headers,
|
headers=auth_headers,
|
||||||
|
|||||||
Reference in New Issue
Block a user