Skip to content

Commit dd18b86

Browse files
ci(sonar): fix coverage by overriding jacoco.skip and remove empty profile (#13178)
Sonar check has been reporting [0 coverage](https://sonarcloud.io/project/overview?id=googleapis_google-cloud-java_generator) for the last few weeks. This is because the sonar workflow incorrectly used a profile that skips jacoco. This PR fixes it by overriding the `jacoco.skip` setting (active by default under the `quick-build` Maven profile) and removing the empty/unused `full-project-coverage` profile. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 15467c8 commit dd18b86

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

.github/workflows/sdk-platform-java-sonar.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
8080
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_GENERATOR }}
8181
run: |
82-
mvn -B verify -Pquick-build \
83-
-DenableFullTestCoverage \
82+
mvn -B verify -Pquick-build -Djacoco.skip=false \
8483
-Penable-integration-tests \
8584
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
8685
-Dsonar.projectKey=googleapis_google-cloud-java_generator \
@@ -92,7 +91,7 @@ jobs:
9291
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
9392
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FOR_SHOWCASE }}
9493
run: |
95-
mvn -B clean verify -Pquick-build \
94+
mvn -B clean verify -Pquick-build -Djacoco.skip=false \
9695
-DskipUnitTests \
9796
-Penable-integration-tests \
9897
-DenableShowcaseTestCoverage \

sdk-platform-java/pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,6 @@
8282
</build>
8383
</profile>
8484

85-
<profile>
86-
<id>full-project-coverage</id>
87-
<activation>
88-
<property>
89-
<name>enableFullTestCoverage</name>
90-
</property>
91-
</activation>
92-
<modules>
93-
</modules>
94-
</profile>
95-
9685
<profile>
9786
<id>activate-showcase-coverage</id>
9887
<activation>

0 commit comments

Comments
 (0)