Skip to content

Commit 004f825

Browse files
committed
Add sonarqube support
1 parent 44a67ff commit 004f825

File tree

5 files changed

+50
-7
lines changed

5 files changed

+50
-7
lines changed

.travis.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ addons:
88
apt:
99
packages:
1010
- libsecret-1-dev
11+
sonarcloud:
12+
organization: $SONAR_ORG
13+
token:
14+
secure: $SONAR_TOKEN
1115

12-
# env:
13-
# - TEST_RESULTS_FILE=test-results.xml
16+
env:
17+
- TEST_RESULTS_FILE=test-results.xml
1418

1519
before_install:
1620
- export DISPLAY=:99.0
@@ -20,6 +24,8 @@ install:
2024
- npm install
2125

2226
script:
23-
- npm run build
24-
- npm test
25-
- npm run package
27+
- npm run build:debug
28+
- npm test
29+
- npm run lint -- -o tslint-report.json --format json
30+
- sonar-scanner
31+
- npm run package

package-lock.json

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
"mocha-html-reporter": "0.0.1",
262262
"mocha-junit-reporter": "^1.18.0",
263263
"mocha-simple-html-reporter": "^1.1.0",
264+
"mocha-sonarqube-reporter": "^1.0.1",
264265
"mock-fs": "^4.7.0",
265266
"modclean": "^3.0.0-beta.1",
266267
"moment": "^2.23.0",

sonar-project.properties

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Standard properties
3+
sonar.projectKey=curlybracket.vlocode
4+
sonar.projectName=Vlocity development tools for Visual Studio Code
5+
sonar.projectVersion=1.0
6+
7+
sonar.sources=src
8+
sonar.exclusions=test/**,views/**
9+
10+
sonar.testExecutionReportPaths=test-results.xml
11+
12+
# Meta-data for the project
13+
sonar.links.homepage=https://github.com/Codeneos/vlocode
14+
sonar.links.ci=https://github.com/Codeneos/vlocode
15+
sonar.links.scm=https://github.com/Codeneos/vlocode
16+
sonar.links.issue=https://github.com/Codeneos/vlocode/issues
17+
18+
# Properties specific to TypeScript plugin
19+
#sonar.typescript.lcov.reportPaths=coverage/lcov.info
20+
sonar.typescript.tslint.reportPaths=tslint-report.json

src/test/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import * as testRunner from 'vscode/lib/testrunner';
1717
const testRunnerConfig = {
1818
ui: 'bdd',
1919
useColors: true,
20-
reporter: process.env.TEST_RESULTS_FILE ? 'mocha-junit-reporter' : null,
20+
reporter: process.env.TEST_RESULTS_FILE ? 'mocha-sonarqube-reporter' : null,
2121
reporterOptions: {
22-
mochaFile: process.env.TEST_RESULTS_FILE
22+
output: process.env.TEST_RESULTS_FILE
2323
}
2424
};
2525

0 commit comments

Comments
 (0)