From 8c5b63dbdc0bdfdcc34842e84b33aff9cdad3b2b Mon Sep 17 00:00:00 2001 From: Federico Iosue Date: Tue, 22 Dec 2020 22:46:15 +0100 Subject: [PATCH] Code coverage merged and sent to SonarQube and reduced build log verbosity --- .github/workflows/main.yml | 2 +- README.md | 3 ++- omniNotes/build.gradle | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9189f5154..f83e1ece46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: avd-name: test emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim disable-animations: true - script: ./gradlew -Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.FlakyTest,androidx.test.filters.LargeTest jacocoTestReport --info + script: ./gradlew -Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.FlakyTest,androidx.test.filters.LargeTest jacocoTestReport --stacktrace - name: SonarCloud static code analysis run: ./gradlew sonar env: diff --git a/README.md b/README.md index a2a1cfd871..42c2ef7953 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Omni-Notes ![License](https://img.shields.io/badge/License-GPLv3-red.svg) [![CI workflow](https://github.com/federicoiosue/Omni-Notes/workflows/CI/badge.svg)](https://github.com/federicoiosue/Omni-Notes/actions?query=workflow%3ACI) [![CodeQL Workflow](https://github.com/federicoiosue/Omni-Notes/workflows/CodeQL/badge.svg)](https://github.com/federicoiosue/Omni-Notes/actions?query=workflow%3ACodeQL) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bd88260c6c5449edac6b18c834fffce5)](https://www.codacy.com/gh/federicoiosue/Omni-Notes/dashboard?utm_source=github.com&utm_medium=referral&utm_content=federicoiosue/Omni-Notes&utm_campaign=Badge_Grade) +[![Sonarcloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=omni-notes&metric=coverage)](https://sonarcloud.io/dashboard?id=omni-notes) +[![Sonarcloud Maintainability](https://sonarcloud.io/api/project_badges/measure?project=omni-notes&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=omni-notes) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/omni-notes/localized.png)](https://crowdin.com/project/omni-notes) [![GitHub release](https://img.shields.io/github/release/federicoiosue/omni-notes.svg)](https://github.com/federicoiosue/Omni-Notes/releases/latest) diff --git a/omniNotes/build.gradle b/omniNotes/build.gradle index 08e6b53c0b..cc5d740cec 100644 --- a/omniNotes/build.gradle +++ b/omniNotes/build.gradle @@ -241,7 +241,7 @@ android.productFlavors.each { flavor -> } apply plugin: 'jacoco' -task jacocoTestReport(type: JacocoReport, dependsOn: ['testAlphaDebugUnitTest', 'createAlphaDebugCoverageReport']) { +task jacocoTestReport(type: JacocoReport, dependsOn: ['testAlphaDebugUnitTest', 'createAlphaDebugCoverageReport', 'connectedPlayDebugAndroidTest']) { reports { xml.enabled = true @@ -256,7 +256,7 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testAlphaDebugUnitTest', classDirectories.from = files([debugTree]) executionData.from = fileTree(dir: "$buildDir", includes: [ "jacoco/testAlphaDebugUnitTest.exec", - "outputs/code-coverage/alphaDebugAndroidTest/connected/*coverage.ec" + "outputs/code_coverage/alphaDebugAndroidTest/connected/*coverage.ec" ]) } jacoco { @@ -265,6 +265,9 @@ jacoco { apply plugin: 'com.adarshr.test-logger' tasks.withType(Test) { + jacoco.includeNoLocationClasses = true + jacoco.excludes = ['jdk.internal.*'] + testLogging { events "standardOut", "standardError", "started", "passed", "skipped", "failed" exceptionFormat "full"