Skip to content

Commit 5b23258

Browse files
committed
fix: simplify SonarQube workflow to run only unit tests
1 parent a3fc8db commit 5b23258

1 file changed

Lines changed: 5 additions & 58 deletions

File tree

.github/workflows/sonarqube.yml

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,17 @@ jobs:
1515
language: python
1616
languageVersion: '3.11'
1717

18-
# Override test execution to generate both Python and frontend coverage
18+
# Override test execution to generate Python coverage (unit tests only)
19+
# Running only unit tests since integration/perf/quality tests are currently failing
20+
# If tests error out, coverage.xml never gets created → Sonar sees 0%
1921
testCommand: |
2022
set -euxo pipefail
21-
22-
echo "===== Installing test dependencies ====="
23-
uv pip install pytest-asyncio
24-
25-
echo "===== Python tests + coverage ====="
26-
uv run pytest tests/ \
27-
--ignore=tests/integration \
28-
--ignore=tests/performance \
29-
--ignore=tests/quality \
30-
--ignore=tests/unit/test_chunking_demo.py \
31-
--ignore=tests/unit/test_db_connection.py \
32-
--ignore=tests/unit/test_document_pipeline.py \
33-
--ignore=tests/unit/test_enhanced_retrieval.py \
34-
--ignore=tests/unit/test_evidence_scoring_demo.py \
35-
--ignore=tests/unit/test_mcp_planner_integration.py \
36-
--ignore=tests/unit/test_mcp_system.py \
37-
--ignore=tests/unit/test_migration_system.py \
23+
uv run pytest tests/unit \
3824
--cov=src \
3925
--cov-report=xml:coverage.xml \
4026
--cov-report=term-missing
41-
42-
echo "===== Verify Python coverage ====="
4327
test -f coverage.xml
44-
head -n 5 coverage.xml || true
45-
46-
echo "===== Setting up Node.js ====="
47-
# Install Node.js 20 (LTS) directly - more reliable in CI
48-
if ! command -v node &> /dev/null; then
49-
NODE_VERSION="20.18.0"
50-
NODE_DISTRO="linux-x64"
51-
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${NODE_DISTRO}.tar.xz"
52-
53-
echo "Downloading Node.js ${NODE_VERSION}..."
54-
curl -fsSL "${NODE_URL}" -o /tmp/node.tar.xz
55-
56-
echo "Extracting Node.js..."
57-
tar -xJf /tmp/node.tar.xz -C /tmp
58-
59-
echo "Setting up Node.js PATH..."
60-
export PATH="/tmp/node-v${NODE_VERSION}-${NODE_DISTRO}/bin:$PATH"
61-
fi
62-
63-
# Verify Node.js installation
64-
node --version || (echo "Node.js installation failed" && exit 1)
65-
npm --version || (echo "npm installation failed" && exit 1)
66-
67-
echo "===== Frontend tests + coverage ====="
68-
cd src/ui/web
69-
70-
# Clean install to ensure compatibility (keep package-lock.json for npm ci)
71-
rm -rf node_modules
72-
npm ci
73-
74-
# Run tests with coverage
75-
npm test -- --coverage --watchAll=false
76-
77-
echo "===== Verify Frontend coverage ====="
78-
test -f coverage/lcov.info
79-
head -n 5 coverage/lcov.info || true
80-
81-
cd ../../..
28+
echo "coverage.xml created ✅"
8229
8330
# Project creation parameters
8431
organization: TEGRASW

0 commit comments

Comments
 (0)