forked from PatrickJS/PatrickJS-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional support for SonarQube Integration (PatrickJS#1881)
* PR for 1859 fix * SonarCube Integration * Sonar Unit Test results support * SonarQube readme instructions updated * Update README.md * TS lint should use the local application specific version instead of expecting a global version , also added tslint support independent of SonarQube Server providing the linting * Reverting to SonarQube handling the linting * updated angular 5 * upstream merge * Fix for Webpack warning ./node_modules/@angular/core/esm5/core.js error in tests * Made SonarQube optional * Updated based on review comments from @gdi2290 * Minor readme update * README Fix * Update README.md * Added back package lock * added yarn lock
- Loading branch information
Showing
8 changed files
with
21,325 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,7 @@ Once you have those, you should install these globals with `npm install --global | |
* `karma` (`npm install --global karma-cli`) | ||
* `protractor` (`npm install --global protractor`) | ||
* `typescript` (`npm install --global typescript`) | ||
* `tslint` (`npm install --global [email protected]`) | ||
|
||
## Installing | ||
* `fork` this repo | ||
|
@@ -466,6 +467,38 @@ starter kit in production on [Netlify](https://www.netlify.com/): | |
|
||
[](https://app.netlify.com/start/deploy?repository=https://github.com/AngularClass/angular-starter) | ||
|
||
### Optional Integration with SonarQube (for continous code quality) | ||
Assuming you have SonarQube 5.5.6 (LTS) installed | ||
* Setup SonarQube with the [Sonar Typescript plugin](https://github.com/Pablissimo/SonarTsPlugin#installation) and the Generic Test Coverage plugin https://docs.sonarqube.org/display/PLUG/Generic+Test+Coverage | ||
* Install sonar-scanner globally | ||
```bash | ||
npm install --global sonar-scanner | ||
``` | ||
* Install the [Karma plugin for sonarqube](https://www.npmjs.com/package/karma-sonarqube-unit-reporter) as a dev dependency | ||
```bash | ||
npm install karma-sonarqube-unit-reporter --save-dev | ||
``` | ||
* Sonar Host URL configuration: | ||
Update [`sonar-project.properties`](sonar-project.properties) file for the property `sonar.host.url` to point to your SonarQube server. By default this assumes that the SonarQube server is running locally using the default port | ||
``` | ||
sonar.host.url=<Sonar Host URL and Port> | ||
``` | ||
* Run the unit tests with sonar reporter enabled | ||
```bash | ||
npm run test:sonar | ||
``` | ||
* The test results collected in the results folder in the sonar compatible format | ||
* Push results to SonarCube | ||
```bash | ||
sonar-scanner | ||
``` | ||
* If working with SonarQube 6.x it supports [Generic Test Data](https://docs.sonarqube.org/display/SONAR/Generic+Test+Data) | ||
* Modify the [karma.conf.js](config/karma.config.js) to set the appropriate version of the sonarQube | ||
```es6 | ||
sonarQubeUnitReporter: { | ||
sonarQubeVersion: '6.x', | ||
} | ||
``` | ||
___ | ||
|
||
enjoy — [**PatrickJS**](https://twitter.com/gdi2290) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.