Skip to content

Commit

Permalink
Merge pull request #10833 from pascalgrimaud/10822/vue-core-update-vi…
Browse files Browse the repository at this point in the history
…test-config

Update vue-core vitest configuration and sonar properties for front
  • Loading branch information
pascalgrimaud committed Sep 14, 2024
2 parents 42bf32c + 1b43990 commit 4ed33cc
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) {
.add(SOURCE.template("Dummy.spec.ts"), to("src/test/webapp/unit/Dummy.spec.ts"))
.add(APP_SOURCE.template("test/webapp/unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts.mustache"), TEST_DESTINATION.append("unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts"))
.add(APP_SOURCE.template("test/webapp/unit/shared/http/infrastructure/secondary/AxiosStub.ts.mustache"), TEST_DESTINATION.append("unit/shared/http/infrastructure/secondary/AxiosStub.ts"))
.add(APP_SOURCE.template("test/webapp/unit/router/HomeRouter.spec.ts.mustache"), TEST_DESTINATION.append("unit/router/HomeRouter.spec.ts"))
.add(APP_SOURCE.template("test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts.mustache"), TEST_DESTINATION.append("unit/router/infrastructure/primary/HomeRouter.spec.ts"))
.and()
.build();
//@formatter:on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,24 @@ export default defineConfig({
exclude: [
...configDefaults.coverage.exclude as string[],
'src/main/webapp/app/main.ts',
'src/main/webapp/app/injections.ts',
'src/main/webapp/app/router.ts',
'src/main/webapp/**/*.component.ts',
],
provider: 'istanbul',
reportsDirectory: '{{projectBuildDirectory}}/test-results/',
reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover']
reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'],
thresholds: {
perFile: true,
autoUpdate: true,
100: true,
},
watermarks: {
statements: [100, 100],
branches: [100, 100],
functions: [100, 100],
lines: [100, 100],
},
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ sonar.testExecutionReportPaths={{projectBuildDirectory}}/test-results/TESTS-resu
sonar.javascript.lcov.reportPaths={{projectBuildDirectory}}/test-results/lcov.info

sonar.sourceEncoding=UTF-8
sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, {{projectBuildDirectory}}/classes/static/**/*.*, src/main/webapp/app/index.tsx
sonar.exclusions=\
src/main/webapp/app/home/infrastructure/primary/*.*,\
src/main/webapp/app/*.ts,\
src/main/webapp/content/**/*.*,\
{{projectBuildDirectory}}/classes/static/**/*.*,\
src/main/webapp/app/index.tsx,\
src/main/webapp/main.ts

sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6437,S6564,UndocumentedApi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ sonar.java.codeCoveragePlugin=jacoco
sonar.junit.reportPaths={{projectBuildDirectory}}/surefire-reports,{{projectBuildDirectory}}/failsafe-reports

sonar.sourceEncoding=UTF-8
sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, {{projectBuildDirectory}}/classes/static/**/*.*, src/main/webapp/app/index.tsx
sonar.exclusions=\
src/main/webapp/app/*.ts,\
src/main/webapp/content/**/*.*,\
{{projectBuildDirectory}}/classes/static/**/*.*,\
src/main/webapp/app/index.tsx,\
src/main/webapp/main.ts

sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6548,S6437,S6471,UndocumentedApi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void shouldCreateVueModule() {
.hasFiles("src/test/webapp/unit/Dummy.spec.ts")
.hasFiles("src/test/webapp/unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts")
.hasFiles("src/test/webapp/unit/shared/http/infrastructure/secondary/AxiosStub.ts")
.hasFiles("src/test/webapp/unit/router/HomeRouter.spec.ts");
.hasFiles("src/test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts");
//@formatter:on
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ void shouldBuildBackendModule() {
.hasFile("sonar-project.properties")
.containing("sonar.coverage.jacoco.xmlReportPaths=target/jacoco/jacoco.xml")
.containing("sonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports")
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, target/classes/static/**/*.*, src/main/webapp/app/index.tsx"
)
.containing("sonar.exclusions=\\")
.notContaining("sonar.testExecutionReportPaths=target/test-results/TESTS-results-sonar.xml");
}

Expand All @@ -54,9 +52,7 @@ void shouldBuildBackendFrontendModule() {

assertCommonModule(module)
.hasFile("sonar-project.properties")
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, target/classes/static/**/*.*, src/main/webapp/app/index.tsx"
)
.containing("sonar.exclusions=\\")
.containing("sonar.testExecutionReportPaths=target/test-results/TESTS-results-sonar.xml")
.containing("sonar.javascript.lcov.reportPaths=target/test-results/lcov.info");
}
Expand Down Expand Up @@ -134,9 +130,7 @@ void shouldBuildBackendModule() {

assertCommonModule(module)
.hasFile("sonar-project.properties")
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, build/classes/static/**/*.*, src/main/webapp/app/index.tsx"
)
.containing("sonar.exclusions=\\")
.notContaining("sonar.testExecutionReportPaths=build/test-results/TESTS-results-sonar.xml");
}

Expand All @@ -148,9 +142,7 @@ void shouldBuildBackendFrontendModule() {

assertCommonModule(module)
.hasFile("sonar-project.properties")
.containing(
"sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, build/classes/static/**/*.*, src/main/webapp/app/index.tsx"
)
.containing("sonar.exclusions=\\")
.containing("sonar.testExecutionReportPaths=build/test-results/TESTS-results-sonar.xml")
.containing("sonar.javascript.lcov.reportPaths=build/test-results/lcov.info");
}
Expand Down

0 comments on commit 4ed33cc

Please sign in to comment.