Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ jobs:
env:
BUF_INPUT_HTTPS_USERNAME: opentdf-bot
BUF_INPUT_HTTPS_PASSWORD: ${{ secrets.PERSONAL_ACCESS_TOKEN_OPENTDF }}
run: mvn --batch-mode clean verify -P coverage
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -P coverage

platform-integration:
runs-on: ubuntu-22.04
Expand Down
62 changes: 52 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<grpc.version>1.68.0</grpc.version>
<protobuf.version>3.25.3</protobuf.version>
<sslcontext.version>8.3.5</sslcontext.version>
<jacoco.line.coverage>0.0</jacoco.line.coverage>
<sonar.organization>opentdf</sonar.organization>
<sonar.projectKey>opentdf_java-sdk</sonar.projectKey>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<licenses>
<license>
Expand Down Expand Up @@ -360,34 +365,71 @@
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
<goal>report-aggregate</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<id>jacoco-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<dataFile>${project.parent.basedir}/target/jacoco.exec</dataFile>
<formats>
<format>XML</format>
</formats>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.line.coverage}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
<execution>
<id>post-test-report</id>
<phase>prepare-package</phase>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.parent.basedir}/sdk/target/jacoco.exec</dataFile>
<outputDirectory>${project.parent.basedir}/sdk/target/site/jacoco/</outputDirectory>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<!--When using the maven-surefire-plugin or maven-failsafe-plugin you must not use a forkCount of 0 or set the forkMode to never as this would prevent the execution of the tests with the javaagent set and no coverage would be recorded.-->
<forkCount>1</forkCount>
<!-- this is required for test coverage-->
<argLine>${argLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
29 changes: 0 additions & 29 deletions sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,35 +275,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.parent.basedir}/target/jacoco.exec</destFile>
</configuration>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.parent.basedir}/target/jacoco.exec</dataFile>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading