Skip to content

Commit

Permalink
Add code coverage analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Aug 12, 2020
1 parent 8e4e167 commit d29f702
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=artemis-java-test-sandbox -Dsonar.organization=maisikoleni -Dsonar.host.url=https://sonarcloud.io
run: mvn -B -P coverage clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=artemis-java-test-sandbox -Dsonar.organization=maisikoleni -Dsonar.host.url=https://sonarcloud.io
deploy:
if: startsWith(github.event.ref, 'refs/tags/')
needs: test
Expand Down
31 changes: 30 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<jqwik-version>1.3.1</jqwik-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- if JaCoCo is not executed -->
<argLine></argLine>
<!-- full certificate fingerprint: B58E410970742EF7AD0FDD48D1A045E1DD48B876 -->
<gpg.key.id>D1A045E1DD48B876</gpg.key.id>
</properties>
Expand Down Expand Up @@ -149,7 +151,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
<argLine>@{argLine} -Dfile.encoding=UTF-8</argLine>
<runOrder>alphabetical</runOrder>
</configuration>
</plugin>
Expand Down Expand Up @@ -186,6 +188,33 @@
</build>

<profiles>
<!-- For code coverage using JaCoCo -->
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- This is only for GitHub -->
<profile>
<id>github</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ public final class SecurityConstants {

static final Set<String> STACK_WHITELIST = Set.of("java.", "org.junit.", "jdk.", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"org.eclipse.", "com.intellij", "org.assertj", "org.opentest4j.", // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"com.sun.", "sun.", "org.apache.", "de.tum.in.test.", "net.jqwik", "ch.qos.logback", SECURITY_PACKAGE_NAME); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
"com.sun.", "sun.", "org.apache.", "de.tum.in.test.", "net.jqwik", "ch.qos.logback", "org.jacoco", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
SECURITY_PACKAGE_NAME);
static final Set<String> STACK_BLACKLIST = Set.of(BlacklistedInvoker.class.getName());

static final Set<String> PACKAGE_USE_BLACKLIST = Set.of(SECURITY_PACKAGE_NAME, "java.lang.reflect",
"de.tum.in.test.api.internal", "jdk.internal");

private SecurityConstants() {

}
}

0 comments on commit d29f702

Please sign in to comment.