Skip to content

Commit

Permalink
LI-58415 - Remove jacoco
Browse files Browse the repository at this point in the history
  • Loading branch information
grmeyer-hw-dev committed Nov 30, 2024
1 parent b6a72e7 commit 4c7e376
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 84 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
uses: android-actions/setup-android@v2

- name: Build CORE SDK ${{ matrix.java-version }}
run: ./gradlew --scan clean lint testDebugUnitTest jacocoTestCoverageVerification
run: ./gradlew --scan clean lint testDebugUnitTest

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ allprojects {
mavenCentral()
mavenLocal()
}
project.version = "1.0.2-beta-3"
project.version = "1.0.2-beta-4"
}

task clean(type: Delete) {
Expand Down
79 changes: 0 additions & 79 deletions core/config/jacoco-settings.gradle
Original file line number Diff line number Diff line change
@@ -1,87 +1,8 @@
apply plugin: 'jacoco'

final def jacocoVersion = "0.8.8"

jacoco {
toolVersion = jacocoVersion
}

android {
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
unitTests.all {
jacoco {
includeNoLocationClasses = true
excludes = ['jdk.internal.*']
}
}
}
}


def fileFilter = ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'android/**/*.*',
'**/com/hyperwallet/android/Hyperwallet.class',
'**/com/hyperwallet/android/Hyperwallet$*.class',
'**/com/hyperwallet/android/util/Tls12SocketFactory*']
def debugClassPaths = [
'**/intermediates/javac/debug/*/classes/**'
]

final def coverageSourceDirs = ["$project.projectDir/src/main/java/*"]

task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {

group = 'Reporting'
description = 'Generate Jacoco coverage reports.'

reports {
html {
enabled = true
destination file("$buildDir/reports/jacoco")
}
}

classDirectories.from = fileTree(
dir: "${buildDir}",
includes: debugClassPaths,
excludes: fileFilter
)

additionalSourceDirs.from = files(coverageSourceDirs)
sourceDirectories.from = files(coverageSourceDirs)
executionData.from = files("${buildDir}/jacoco/testDebugUnitTest.exec")
}

task jacocoTestCoverageVerification(type: JacocoCoverageVerification, dependsOn: 'jacocoTestReport') {

group = 'Verification'
classDirectories.from = fileTree(
dir: "${buildDir}",
includes: debugClassPaths,
excludes: fileFilter
)
additionalSourceDirs.from = files(coverageSourceDirs)
sourceDirectories.from = files(coverageSourceDirs)
executionData.from = files("${buildDir}/jacoco/testDebugUnitTest.exec")

violationRules {
setFailOnViolation(true)

rule {
element = 'CLASS'
limit {
value = 'COVEREDRATIO'
counter = 'BRANCH'
minimum = 0.65
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testBuild_withRequiredParametersOnly() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testBuild_withJsonModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testBuild_withQueryModelOptionalParameter() throws JSONException {
assertThat(headers.get("Content-Type"), is("application/json"));
assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME +
"; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3"));
assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4"));
assertThat(headers.get("X-Sdk-Type"), is("android"));
assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue()));
assertThat(headers.get("X-Sdk-ContextId"), is(contextId));
Expand Down

0 comments on commit 4c7e376

Please sign in to comment.