From 2e54bf4f15e2555a113c2ac1ff651cce1fe5caf2 Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Tue, 5 Mar 2024 11:24:11 +0100 Subject: [PATCH 1/4] test: added java to sonar --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 348eaff3..29bcba3e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,11 +7,11 @@ sonar.projectVersion=1.0 # Encoding of the source code. Default is default system encoding sonar.host.url=https://sonarcloud.io -sonar.language=js +sonar.language=js,java sonar.projectName=wiq_en2b sonar.coverage.exclusions=**/*.test.js,**/*.test.jsx -sonar.sources=webapp/src/components +sonar.sources=webapp/src/components,api/src/main/java sonar.sourceEncoding=UTF-8 sonar.exclusions=node_modules/** sonar.javascript.lcov.reportPaths=**/coverage/lcov.info \ No newline at end of file From 51df126ab05001e364ee9e577d1c8eeb972b5468 Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Tue, 5 Mar 2024 11:31:17 +0100 Subject: [PATCH 2/4] test: java binaries --- sonar-project.properties | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 29bcba3e..ed35df44 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,4 +14,7 @@ sonar.coverage.exclusions=**/*.test.js,**/*.test.jsx sonar.sources=webapp/src/components,api/src/main/java sonar.sourceEncoding=UTF-8 sonar.exclusions=node_modules/** -sonar.javascript.lcov.reportPaths=**/coverage/lcov.info \ No newline at end of file +sonar.javascript.lcov.reportPaths=**/coverage/lcov.info + +#Java specific config +sonar.java.binaries=**/target/classes \ No newline at end of file From 7f8511b178791befc3980a6ebeae2275ff5e00d3 Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Tue, 5 Mar 2024 11:34:31 +0100 Subject: [PATCH 3/4] test: java binaries path --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index ed35df44..980f0935 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,4 +17,4 @@ sonar.exclusions=node_modules/** sonar.javascript.lcov.reportPaths=**/coverage/lcov.info #Java specific config -sonar.java.binaries=**/target/classes \ No newline at end of file +sonar.java.binaries=api/target/classes \ No newline at end of file From 1164b62948a75aa7533757ece5b9205efd9e9b1e Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Tue, 5 Mar 2024 11:42:49 +0100 Subject: [PATCH 4/4] test: removed sonar from webapp --- .github/workflows/build.yml | 5 ----- sonar-project.properties | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0695bc6c..84d22c05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,11 +18,6 @@ jobs: - uses: actions/checkout@v4 - run: npm --prefix webapp ci - run: npm --prefix webapp test -- --coverage - - name: Analyze with SonarCloud - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} unit-tests-api: runs-on: ubuntu-latest steps: diff --git a/sonar-project.properties b/sonar-project.properties index 980f0935..097e51c4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -17,4 +17,5 @@ sonar.exclusions=node_modules/** sonar.javascript.lcov.reportPaths=**/coverage/lcov.info #Java specific config -sonar.java.binaries=api/target/classes \ No newline at end of file +sonar.java.binaries=api/target/classes +sonar.tests=api/src/test/java \ No newline at end of file