Skip to content

Commit e080cd3

Browse files
committed
ci: report dashboard smoke coverage to sonar
Signed-off-by: huangruiteng <huangrt01@163.com>
1 parent d4a1b03 commit e080cd3

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎.github/workflows/python-tests.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
npm ci --ignore-scripts
8989
npm run typecheck:control-plane
9090
npm run test:control-plane:coverage
91+
npm run test:dashboard:coverage
9192
9293
- name: Upload TypeScript control-plane coverage
9394
uses: actions/upload-artifact@v7
@@ -97,6 +98,14 @@ jobs:
9798
if-no-files-found: error
9899
retention-days: 3
99100

101+
- name: Upload dashboard coverage
102+
uses: actions/upload-artifact@v7
103+
with:
104+
name: dashboard-coverage
105+
path: coverage/dashboard/lcov.info
106+
if-no-files-found: error
107+
retention-days: 3
108+
100109
- name: Lint test suite
101110
run: >-
102111
python -m ruff check

‎.github/workflows/sonarcloud.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ jobs:
4949
name: typescript-control-plane-coverage
5050
path: coverage/control-plane
5151

52+
- name: Download this run's dashboard coverage
53+
if: steps.sonar-token.outputs.available == 'true'
54+
uses: actions/download-artifact@v7
55+
with:
56+
name: dashboard-coverage
57+
path: coverage/dashboard
58+
5259
- name: SonarCloud scan
5360
if: steps.sonar-token.outputs.available == 'true'
5461
# Analysis-only: findings are reported to the PR/dashboard but never

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"test:control-plane": "node --no-warnings --experimental-strip-types --test tests/control_plane_ts/*.test.ts",
1212
"test:control-plane:coverage": "c8 --all --include=loopx/control_plane/**/*.ts --exclude=loopx/control_plane/**/*.generated.ts --reporter=lcov --reporter=text --reports-dir=coverage/control-plane node --no-warnings --experimental-strip-types --test tests/control_plane_ts/*.test.ts",
13+
"test:dashboard:coverage": "tsc --ignoreConfig --target ES2022 --module ES2022 --moduleResolution Bundler --skipLibCheck --strict --sourceMap --inlineSources --outDir apps/presentation/dashboard/node_modules/.cache/loopx-agent-family apps/presentation/dashboard/src/features/personal-workspace/agent-family.ts && c8 --exclude-node-modules=false --include=apps/presentation/dashboard/node_modules/.cache/loopx-agent-family/agent-family.js --reporter=lcov --reporter=text --reports-dir=coverage/dashboard node apps/presentation/dashboard/src/features/personal-workspace/agent-family.test.mjs",
1314
"test:postgresql-authority-store": "node --no-warnings --experimental-strip-types --test tests/control_plane_ts/postgresql_authority_store.integration.test.ts",
1415
"typecheck:control-plane": "tsc --project tsconfig.control-plane.json --noEmit"
1516
},

‎sonar-project.properties‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ sonar.sourceEncoding=UTF-8
1414
sonar.sources=loopx,apps,scripts
1515
sonar.tests=tests
1616
sonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/src-tauri/**,loopx/web/chat/assets/**,**/*.min.js,deprecate/**
17+
sonar.coverage.exclusions=apps/**/*.test.*,apps/**/smoke/**
1718

1819
# Python
1920
sonar.python.version=3.11
2021
sonar.python.coverage.reportPaths=coverage.xml
2122

22-
# TypeScript control plane
23-
sonar.javascript.lcov.reportPaths=coverage/control-plane/lcov.info
23+
# TypeScript/JavaScript product coverage
24+
sonar.javascript.lcov.reportPaths=coverage/control-plane/lcov.info,coverage/dashboard/lcov.info
2425

2526
# Non-blocking by default: report findings, never gate the workflow.
2627
sonar.qualitygate.wait=false

0 commit comments

Comments
 (0)