Commit 275da455 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

docs(SonarQube): update doc urls

parent 2ede1eb3
Loading
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -118,8 +118,8 @@ Here is the required configuration if you're using [Karma](https://karma-runner.
| [karma-junit-reporter](https://github.com/karma-runner/karma-junit-reporter)                                                          | Yes                 | `reports/ng-test.xunit.xml`         | [GitLab unit tests integration](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html) _(JUnit format)_                                                         |
| [karma-coverage text-summary reporter](https://github.com/karma-runner/karma-coverage?tab=readme-ov-file#advanced-multiple-reporters) | No                  | N/A _(stdout)_                      | [GitLab MR test coverage results](https://docs.gitlab.com/ee/ci/testing/code_coverage.html#view-code-coverage-results-in-the-mr) _(GitLab grabs coverage from stdout)_ |
| [karma-coverage cobertura reporter](https://github.com/karma-runner/karma-coverage?tab=readme-ov-file#advanced-multiple-reporters)    | No                  | `reports/ng-coverage.cobertura.xml` | [GitLab code coverage integration](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) _(Cobertura format)_                                        |
| [karma-sonarqube-execution-reporter](https://github.com/lisrec/karma-sonarqube-execution-reporter)                                    | Yes                 | `reports/ng-test.sonar.xml`         | [SonarQube unit tests integration](https://docs.sonarqube.org/latest/analysis/generic-test/) _(generic SonarQube format)_                                              |
| [karma-coverage lcovonly reporter](https://github.com/karma-runner/karma-coverage?tab=readme-ov-file#advanced-multiple-reporters)     | No                  | `reports/ng-coverage.lcov.info`     | [SonarQube code coverage integration](https://docs.sonarqube.org/latest/analysis/test-coverage/javascript-typescript-test-coverage/) _(JS/TS LCOV format)_             |
| [karma-sonarqube-execution-reporter](https://github.com/lisrec/karma-sonarqube-execution-reporter)                                    | Yes                 | `reports/ng-test.sonar.xml`         | [SonarQube unit tests integration](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/generic-test-data/#generic-test-coverage) _(generic SonarQube format)_                                              |
| [karma-coverage lcovonly reporter](https://github.com/karma-runner/karma-coverage?tab=readme-ov-file#advanced-multiple-reporters)     | No                  | `reports/ng-coverage.lcov.info`     | [SonarQube code coverage integration](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/) _(JS/TS LCOV format)_             |

##### Code Coverage reports

@@ -149,7 +149,7 @@ the Angular template expects the following in your `karma.conf.js`:

   :warning: in case of multiple angular projects in the workspace, each project shall produce its coverage report in `reports/ng-coverage-<projectName>.cobertura.xml` (it can be in sub-folders but must follow the file name pattern).

3. Additionally, if using SonarQube, you may also want to generate [LCOV report](https://docs.sonarqube.org/latest/analysis/test-coverage/javascript-typescript-test-coverage/):
3. Additionally, if using SonarQube, you may also want to generate [LCOV report](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/):

   ```js
   coverageReporter: {
@@ -197,7 +197,7 @@ In order to be able to [integrate your test reports to GitLab](https://docs.gitl

   :warning: in case of multiple Angular projects in the workspace, each project shall produce its JUnit report either in `reports/ng-test-<projectName>.xunit.xml` or `reports/<projectName>/ng-test.xunit.xml`.

Additionally, if using **SonarQube**, you may also want to generate [SonarQube generic test report](https://docs.sonarqube.org/latest/analysis/generic-test/):
Additionally, if using **SonarQube**, you may also want to generate [SonarQube generic test report](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/generic-test-data/#generic-test-coverage):

1. Add [karma-sonarqube-execution-reporter](https://github.com/lisrec/karma-sonarqube-execution-reporter) to your project as a dev dependency:

@@ -241,8 +241,8 @@ Here is the required configuration if you're using [Jest](https://jestjs.io/) as
| [jest-junit](https://github.com/jest-community/jest-junit)                                   | Yes                 | `reports/ng-test.xunit.xml`         | [GitLab unit tests integration](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html) _(JUnit format)_                                                         |
| istanbul [text](https://istanbul.js.org/docs/advanced/alternative-reporters/#text)           | No                  | N/A _(stdout)_                      | [GitLab MR test coverage results](https://docs.gitlab.com/ee/ci/testing/code_coverage.html#view-code-coverage-results-in-the-mr) _(GitLab grabs coverage from stdout)_ |
| istanbul [cobertura](https://istanbul.js.org/docs/advanced/alternative-reporters/#cobertura) | No                  | `reports/ng-coverage.cobertura.xml` | [GitLab code coverage integration](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) _(Cobertura format)_                                        |
| [jest-sonar](https://github.com/sh33dafi/jest-sonar)                                         | Yes                 | `reports/ng-test.sonar.xml`         | [SonarQube unit tests integration](https://docs.sonarqube.org/latest/analysis/generic-test/) _(generic SonarQube format)_                                              |
| istanbul [lcovonly](https://istanbul.js.org/docs/advanced/alternative-reporters/#lcovonly)   | No                  | `reports/ng-coverage.lcov.info`     | [SonarQube code coverage integration](https://docs.sonarqube.org/latest/analysis/test-coverage/javascript-typescript-test-coverage/) _(JS/TS LCOV format)_             |
| [jest-sonar](https://github.com/sh33dafi/jest-sonar)                                         | Yes                 | `reports/ng-test.sonar.xml`         | [SonarQube unit tests integration](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/generic-test-data/#generic-test-coverage) _(generic SonarQube format)_                                              |
| istanbul [lcovonly](https://istanbul.js.org/docs/advanced/alternative-reporters/#lcovonly)   | No                  | `reports/ng-coverage.lcov.info`     | [SonarQube code coverage integration](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/) _(JS/TS LCOV format)_             |

The following packages will have to be installed to your project as a dev dependencies: [jest](https://www.npmjs.com/package/jest), [jest-junit](https://github.com/jest-community/jest-junit#readme), [jest-preset-angular](https://www.npmjs.com/package/jest-preset-angular), [@types/jest](https://www.npmjs.com/package/@types/jest) and [@angular-builders/jest](https://www.npmjs.com/package/@angular-builders/jest)

@@ -417,7 +417,7 @@ For more details see [Package naming convention](https://docs.gitlab.com/ee/user
If you're using the SonarQube template to analyse your Angular code, here is a sample `sonar-project.properties` file:

```properties
# see: https://docs.sonarqube.org/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/
# see: https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/
# set your source directory(ies) here (relative to the sonar-project.properties file)
sonar.sources=app
# exclude unwanted directories and files from being analysed
@@ -437,6 +437,6 @@ sonar.typescript.lcov.reportPaths=reports/ng-coverage.lcov.info

More info:

- [TypeScript language support](https://docs.sonarqube.org/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/)
- [test coverage & execution parameters](https://docs.sonarqube.org/latest/analysis/coverage/)
- [third-party issues](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/importing-external-issues/external-analyzer-reports/)
- [TypeScript language support](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/javascript-typescript-test-coverage/)
- [test coverage](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/test-coverage-parameters/) & [test execution](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/test-coverage/test-execution-parameters/) parameters
- [external analyzer reports](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/importing-external-issues/external-analyzer-reports/)