From 1f659590898e919e85c4ae70daee55b03a8074fa Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Thu, 23 Feb 2023 12:27:26 +0100 Subject: [PATCH 01/16] try setup --- build.gradle | 4 +++- gradle/dependencies.gradle | 6 ++++-- gradle/pitest.gradle | 23 +++++++++++++++++++++++ libnavigation-copilot/build.gradle | 3 ++- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 gradle/pitest.gradle diff --git a/build.gradle b/build.gradle index e959361d65c..1102072f75f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { apply from: "${rootDir}/gradle/dependencies.gradle" repositories { - google() mavenCentral() + google() maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { @@ -15,6 +15,7 @@ buildscript { } gradlePluginPortal() } + dependencies { classpath pluginDependencies.gradle classpath pluginDependencies.kotlin @@ -29,6 +30,7 @@ buildscript { classpath pluginDependencies.dokka classpath pluginDependencies.firebaseCrashlytics classpath pluginDependencies.googleServices + classpath pluginDependencies.pitest } } diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 3cd0b874ca7..9eb9a827818 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -191,7 +191,8 @@ ext { mapboxSdkRegistry : '0.7.0', mapboxAccessToken : '0.2.1', mapboxNativeDownload : '0.2.2', - firebaseCrashlytics : '2.5.1' + firebaseCrashlytics : '2.5.1', + pitest : '0.2.12' ] pluginDependencies = [ @@ -208,6 +209,7 @@ ext { mapboxSdkRegistry : "com.mapbox.gradle.plugins:sdk-registry:${pluginVersion.mapboxSdkRegistry}", mapboxAccessToken : "com.mapbox.gradle.plugins:access-token:${pluginVersion.mapboxAccessToken}", mapboxNativeDownload : "com.mapbox.gradle.plugins:native-download:${pluginVersion.mapboxNativeDownload}", - firebaseCrashlytics : "com.google.firebase:firebase-crashlytics-gradle:${pluginVersion.firebaseCrashlytics}" + firebaseCrashlytics : "com.google.firebase:firebase-crashlytics-gradle:${pluginVersion.firebaseCrashlytics}", + pitest : "pl.droidsonroids.gradle:gradle-pitest-plugin:${pluginVersion.pitest}" ] } diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle new file mode 100644 index 00000000000..650207f59bc --- /dev/null +++ b/gradle/pitest.gradle @@ -0,0 +1,23 @@ +apply plugin: 'pl.droidsonroids.pitest' + +pitest { + targetClasses = ['com.mapbox.navigation.**'] + targetTests = ['**Test**'] + pitestVersion = '1.11.0' + avoidCallsTo = ['kotlin.jvm.internal'] + threads = Runtime.getRuntime().availableProcessors() + outputFormats = ['XML', 'HTML'] + timestampedReports = false + jvmArgs = ['-Xmx4096m'] + verbose = true + exportLineCoverage = true + + // https://pitest.org/quickstart/mutators/ + mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', + 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] + + excludedClasses = [] + + // Use feature EXPORT for debug + // features = ["+EXPORT"] +} diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index a7468d87c02..5390fca5820 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -53,4 +53,5 @@ dokkaHtmlPartial { apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" +apply from: "../gradle/pitest.gradle" \ No newline at end of file From fc68e67e35dc822a59ddf066423966b2ff544c51 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Thu, 23 Feb 2023 15:27:29 +0100 Subject: [PATCH 02/16] wip --- build.gradle | 5 ++++- gradle/pitest.gradle | 22 ++++++++++++---------- libnavigation-copilot/build.gradle | 8 ++++++-- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 1102072f75f..6a241f85e44 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,7 @@ buildscript { classpath pluginDependencies.gradle classpath pluginDependencies.kotlin classpath pluginDependencies.dependencyUpdates + classpath "pl.droidsonroids.gradle:gradle-pitest-plugin:0.2.9" classpath pluginDependencies.jacoco classpath pluginDependencies.googleServices classpath pluginDependencies.license @@ -30,9 +31,11 @@ buildscript { classpath pluginDependencies.dokka classpath pluginDependencies.firebaseCrashlytics classpath pluginDependencies.googleServices - classpath pluginDependencies.pitest } } +//plugins { +// id "pl.droidsonroids.pitest" version "0.2.9" apply false +//} apply plugin: 'jacoco' apply plugin: 'org.jetbrains.dokka' diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 650207f59bc..0e3c572f580 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -2,21 +2,23 @@ apply plugin: 'pl.droidsonroids.pitest' pitest { targetClasses = ['com.mapbox.navigation.**'] - targetTests = ['**Test**'] - pitestVersion = '1.11.0' - avoidCallsTo = ['kotlin.jvm.internal'] - threads = Runtime.getRuntime().availableProcessors() +// targetTests = ['**Test**'] + pitestVersion = '1.11.1' +// avoidCallsTo = ['kotlin.jvm.internal'] +// threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] - timestampedReports = false - jvmArgs = ['-Xmx4096m'] +// timestampedReports = false +// jvmArgs = ['-Xmx4096m'] verbose = true - exportLineCoverage = true +// exportLineCoverage = true + excludeMockableAndroidJar = true + mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ - mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', - 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] +// mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', +// 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] - excludedClasses = [] + excludedTestClasses = [] // Use feature EXPORT for debug // features = ["+EXPORT"] diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index 5390fca5820..f08086d7c34 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -1,7 +1,11 @@ +plugins { + id("pl.droidsonroids.pitest") +} apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' apply plugin: 'com.jaredsburrows.license' +apply from: "../gradle/pitest.gradle" apply from: "../gradle/ktlint.gradle" apply from: "../gradle/kdoc-settings.gradle" @@ -34,6 +38,7 @@ dependencies { testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') apply from: "../gradle/unit-testing-dependencies.gradle" + implementation 'org.pitest:pitest:1.11.1' } dokkaHtmlPartial { @@ -53,5 +58,4 @@ dokkaHtmlPartial { apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" -apply from: "../gradle/pitest.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" \ No newline at end of file From db3a15cc591afda421053c573f94987db1a95fdc Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Thu, 23 Feb 2023 17:57:59 +0100 Subject: [PATCH 03/16] wip --- build.gradle | 5 +---- gradle/dependencies.gradle | 2 +- gradle/pitest.gradle | 18 ++++++++++-------- libnavigation-copilot/build.gradle | 12 +++++++++--- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 6a241f85e44..a11dd6ae6e6 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ buildscript { classpath pluginDependencies.gradle classpath pluginDependencies.kotlin classpath pluginDependencies.dependencyUpdates - classpath "pl.droidsonroids.gradle:gradle-pitest-plugin:0.2.9" + classpath pluginDependencies.pitest classpath pluginDependencies.jacoco classpath pluginDependencies.googleServices classpath pluginDependencies.license @@ -33,9 +33,6 @@ buildscript { classpath pluginDependencies.googleServices } } -//plugins { -// id "pl.droidsonroids.pitest" version "0.2.9" apply false -//} apply plugin: 'jacoco' apply plugin: 'org.jetbrains.dokka' diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 9eb9a827818..5c873bd73ec 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -192,7 +192,7 @@ ext { mapboxAccessToken : '0.2.1', mapboxNativeDownload : '0.2.2', firebaseCrashlytics : '2.5.1', - pitest : '0.2.12' + pitest : '0.2.9' ] pluginDependencies = [ diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 0e3c572f580..42a5142c672 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -2,18 +2,20 @@ apply plugin: 'pl.droidsonroids.pitest' pitest { targetClasses = ['com.mapbox.navigation.**'] -// targetTests = ['**Test**'] - pitestVersion = '1.11.1' -// avoidCallsTo = ['kotlin.jvm.internal'] -// threads = Runtime.getRuntime().availableProcessors() + targetTests = ['**MapboxCopilotTest**'] + pitestVersion = '1.7.0' + avoidCallsTo = ['kotlin.jvm.internal'] + threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] -// timestampedReports = false -// jvmArgs = ['-Xmx4096m'] + timestampedReports = false + jvmArgs = ['-Xmx4096m'] verbose = true -// exportLineCoverage = true + exportLineCoverage = true excludeMockableAndroidJar = true + failWhenNoMutations = false - mutators = ['DEFAULTS'] + mutators = ['CONSTRUCTOR_CALLS'] +// mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', // 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index f08086d7c34..efcd2b480b3 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -1,11 +1,11 @@ plugins { - id("pl.droidsonroids.pitest") + id("pl.droidsonroids.pitest") apply(false) } +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' apply plugin: 'com.jaredsburrows.license' -apply from: "../gradle/pitest.gradle" apply from: "../gradle/ktlint.gradle" apply from: "../gradle/kdoc-settings.gradle" @@ -37,6 +37,8 @@ dependencies { testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') + testImplementation dependenciesList.mockk + testImplementation dependenciesList.kotlinReflect apply from: "../gradle/unit-testing-dependencies.gradle" implementation 'org.pitest:pitest:1.11.1' } @@ -58,4 +60,8 @@ dokkaHtmlPartial { apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" + +task pitestRun(type: Exec, dependsOn: ':libnavigation-copilot:pitestDebug') { + +} \ No newline at end of file From 540715da0fd68bdeda17c0996b061aade1b49aba Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Thu, 23 Feb 2023 17:58:15 +0100 Subject: [PATCH 04/16] temp circle ci config --- .circleci/config.yml | 81 ++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc9e22614ae..ddb5aa0b8bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,42 +70,43 @@ workflows: ignore: /.*/ default: jobs: - - prepare-and-assemble - - changelog-verification: - filters: - branches: - ignore: /^(main|release-.*)/ - - static-analysis: - requires: - - prepare-and-assemble - - unit-tests-core: - requires: - - prepare-and-assemble - - unit-tests-ui: - requires: - - prepare-and-assemble - - unit-tests-androidauto: - requires: - - prepare-and-assemble - - ui-robo-tests: - requires: - - prepare-and-assemble - - internal-instrumentation-tests: - requires: - - prepare-and-assemble - - instrumentation-tests: - requires: - - prepare-and-assemble - - androidauto-test - - mobile-metrics-dry-run: - type: approval - - mobile-metrics-benchmarks: - requires: - - mobile-metrics-dry-run - - codecov-upload: - requires: - - unit-tests-ui - - unit-tests-core + - run-pitest +# - prepare-and-assemble +# - changelog-verification: +# filters: +# branches: +# ignore: /^(main|release-.*)/ +# - static-analysis: +# requires: +# - prepare-and-assemble +# - unit-tests-core: +# requires: +# - prepare-and-assemble +# - unit-tests-ui: +# requires: +# - prepare-and-assemble +# - unit-tests-androidauto: +# requires: +# - prepare-and-assemble +# - ui-robo-tests: +# requires: +# - prepare-and-assemble +# - internal-instrumentation-tests: +# requires: +# - prepare-and-assemble +# - instrumentation-tests: +# requires: +# - prepare-and-assemble +# - androidauto-test +# - mobile-metrics-dry-run: +# type: approval +# - mobile-metrics-benchmarks: +# requires: +# - mobile-metrics-dry-run +# - codecov-upload: +# requires: +# - unit-tests-ui +# - unit-tests-core #------------------------------ #---------- COMMANDS ---------- @@ -522,6 +523,14 @@ commands: #---------- JOBS ---------- #-------------------------- jobs: + run-pitest: + executor: ndk-r22-latest-executor + steps: + - checkout + - run: + name: Run pitests + command: ./gradlew :libnavigation-copilot:pitestDebug --info + prepare-and-assemble: executor: ndk-r22-latest-executor steps: From fe7577413d2de77dedd74dea8d1090e72c89c243 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Thu, 23 Feb 2023 18:34:46 +0100 Subject: [PATCH 05/16] wip --- libnavigation-copilot/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index efcd2b480b3..459fcf8a55b 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -39,6 +39,7 @@ dependencies { testImplementation project(':libtesting-utils') testImplementation dependenciesList.mockk testImplementation dependenciesList.kotlinReflect + testImplementation ("io.mockk:mockk-agent-jvm:1.12.1") apply from: "../gradle/unit-testing-dependencies.gradle" implementation 'org.pitest:pitest:1.11.1' } From 665c1a1c6aab5a08512289552a7bcd3d91640742 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Fri, 24 Feb 2023 00:13:30 +0100 Subject: [PATCH 06/16] wip --- gradle/dependencies.gradle | 4 +++- libnavigation-copilot/build.gradle | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 5c873bd73ec..89d057503da 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -44,7 +44,7 @@ ext { junit : '4.12', constraintLayout : '1.1.3', mockito : '2.23.4', - mockkVersion : '1.12.1', + mockkVersion : '1.12.3', leakCanaryVersion : '2.9.1', commonsIO : '2.6', robolectric : '4.7.3', @@ -154,6 +154,8 @@ ext { junit : "junit:junit:${version.junit}", mockito : "org.mockito:mockito-core:${version.mockito}", mockk : "io.mockk:mockk:${version.mockkVersion}", + mockkAgentApi : "io.mockk:mockk-agent-api:${version.mockkVersion}", + mockkAgentJvm : "io.mockk:mockk-agent-jvm:${version.mockkVersion}", mockkAndroid : "io.mockk:mockk-android:${version.mockkVersion}", commonsIO : "commons-io:commons-io:${version.commonsIO}", robolectric : "org.robolectric:robolectric:${version.robolectric}", diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index 459fcf8a55b..6fb3c27d868 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -37,11 +37,10 @@ dependencies { testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') - testImplementation dependenciesList.mockk testImplementation dependenciesList.kotlinReflect - testImplementation ("io.mockk:mockk-agent-jvm:1.12.1") + testImplementation dependenciesList.mockkAgentJvm + testImplementation dependenciesList.mockkAgentApi apply from: "../gradle/unit-testing-dependencies.gradle" - implementation 'org.pitest:pitest:1.11.1' } dokkaHtmlPartial { From 5c1117c9a3c447bd4ca391352a49d0a5cd2394b6 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Fri, 24 Feb 2023 00:24:12 +0100 Subject: [PATCH 07/16] wip --- gradle/pitest.gradle | 13 ++++++------- libnavigation-copilot/build.gradle | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 42a5142c672..e7d4a90fb56 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -1,20 +1,19 @@ apply plugin: 'pl.droidsonroids.pitest' pitest { - targetClasses = ['com.mapbox.navigation.**'] - targetTests = ['**MapboxCopilotTest**'] - pitestVersion = '1.7.0' + pitestVersion = '1.11.1' avoidCallsTo = ['kotlin.jvm.internal'] + targetClasses = ['com.mapbox.maps.**'] + targetTests = ['com.mapbox.maps.**Test**'] threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] timestampedReports = false - jvmArgs = ['-Xmx4096m'] + jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true - excludeMockableAndroidJar = true - failWhenNoMutations = false +// excludeMockableAndroidJar = true - mutators = ['CONSTRUCTOR_CALLS'] + mutators = ['DEFAULTS'] // mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index 6fb3c27d868..849b73d727c 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -35,9 +35,10 @@ dependencies { implementation dependenciesList.androidXWorkManager implementation dependenciesList.androidXLifecycleProcess - testImplementation project(':libtesting-navigation-util') +// testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') testImplementation dependenciesList.kotlinReflect + testImplementation dependenciesList.mockk testImplementation dependenciesList.mockkAgentJvm testImplementation dependenciesList.mockkAgentApi apply from: "../gradle/unit-testing-dependencies.gradle" From be8a42a46a6cf691c782bead0c36223bc42a5618 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Fri, 24 Feb 2023 00:40:42 +0100 Subject: [PATCH 08/16] temp ci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ddb5aa0b8bd..1ad6786f287 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -529,7 +529,7 @@ jobs: - checkout - run: name: Run pitests - command: ./gradlew :libnavigation-copilot:pitestDebug --info + command: ./gradlew :libnavigation-util:pitestDebug --info prepare-and-assemble: executor: ndk-r22-latest-executor From 2fb9bbab54a8655e3d3569031c910c228cc0fdd4 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Fri, 24 Feb 2023 00:40:54 +0100 Subject: [PATCH 09/16] wip --- gradle/pitest.gradle | 8 ++++---- libnavigation-util/build.gradle | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index e7d4a90fb56..b3776de7357 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -1,20 +1,20 @@ apply plugin: 'pl.droidsonroids.pitest' pitest { + targetClasses = ['com.mapbox.navigation.**'] + targetTests = ['com.mapbox.navigation.**Test**'] pitestVersion = '1.11.1' avoidCallsTo = ['kotlin.jvm.internal'] - targetClasses = ['com.mapbox.maps.**'] - targetTests = ['com.mapbox.maps.**Test**'] threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] timestampedReports = false jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true -// excludeMockableAndroidJar = true + excludeMockableAndroidJar = true + failWhenNoMutations = false mutators = ['DEFAULTS'] -// mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', // 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] diff --git a/libnavigation-util/build.gradle b/libnavigation-util/build.gradle index dbadaa79c7a..8523e8f3e6b 100644 --- a/libnavigation-util/build.gradle +++ b/libnavigation-util/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' @@ -34,10 +38,18 @@ dependencies { api dependenciesList.mapboxAndroidCommon implementation dependenciesList.mapboxAnnotations + testImplementation dependenciesList.mockk + testImplementation dependenciesList.mockkAgentJvm + testImplementation dependenciesList.mockkAgentApi + apply from: "../gradle/unit-testing-dependencies.gradle" testImplementation project(':libtesting-utils') } apply from: "../gradle/track-public-apis.gradle" apply from: "../gradle/publish.gradle" -apply from: "../gradle/jacoco.gradle" \ No newline at end of file +apply from: "../gradle/jacoco.gradle" + +task pitestRunUtils(type: Copy, dependsOn: ':libnavigation-util:pitestDebug') { + +} \ No newline at end of file From 1ea7ca4c77f1d7c73d966202d4c55ba3307b6e21 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Fri, 24 Feb 2023 11:53:46 +0100 Subject: [PATCH 10/16] wip --- .circleci/config.yml | 2 +- gradle/pitest.gradle | 5 +++-- libnavigation-base/build.gradle | 4 ++++ libnavigation-util/build.gradle | 4 ---- libnavigator/build.gradle | 6 +++++- libtesting-utils/build.gradle | 4 +++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ad6786f287..d6bd1aff338 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -529,7 +529,7 @@ jobs: - checkout - run: name: Run pitests - command: ./gradlew :libnavigation-util:pitestDebug --info + command: ./gradlew :libnavigation-base:pitestDebug --info prepare-and-assemble: executor: ndk-r22-latest-executor diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index b3776de7357..e5f985538df 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -14,7 +14,8 @@ pitest { excludeMockableAndroidJar = true failWhenNoMutations = false - mutators = ['DEFAULTS'] + mutators = ['EMPTY_RETURNS'] +// mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', // 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] @@ -22,5 +23,5 @@ pitest { excludedTestClasses = [] // Use feature EXPORT for debug - // features = ["+EXPORT"] +// features = ["+EXPORT"] } diff --git a/libnavigation-base/build.gradle b/libnavigation-base/build.gradle index 60b0c36ebcb..72e74ab83a3 100644 --- a/libnavigation-base/build.gradle +++ b/libnavigation-base/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' diff --git a/libnavigation-util/build.gradle b/libnavigation-util/build.gradle index 8523e8f3e6b..323aa785d94 100644 --- a/libnavigation-util/build.gradle +++ b/libnavigation-util/build.gradle @@ -38,10 +38,6 @@ dependencies { api dependenciesList.mapboxAndroidCommon implementation dependenciesList.mapboxAnnotations - testImplementation dependenciesList.mockk - testImplementation dependenciesList.mockkAgentJvm - testImplementation dependenciesList.mockkAgentApi - apply from: "../gradle/unit-testing-dependencies.gradle" testImplementation project(':libtesting-utils') } diff --git a/libnavigator/build.gradle b/libnavigator/build.gradle index 15f9d08a4bc..5e1f9b16e2e 100644 --- a/libnavigator/build.gradle +++ b/libnavigator/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'com.jaredsburrows.license' @@ -52,7 +56,7 @@ dependencies { // instrumentation tests androidTestImplementation project(':libtesting-ui') androidTestImplementation dependenciesList.testRunner - androidTestUtil dependenciesList.testOrchestrator +// androidTestUtil dependenciesList.testOrchestrator } apply from: "../gradle/track-public-apis.gradle" diff --git a/libtesting-utils/build.gradle b/libtesting-utils/build.gradle index ba4e6179d90..ce068027101 100644 --- a/libtesting-utils/build.gradle +++ b/libtesting-utils/build.gradle @@ -22,8 +22,10 @@ dependencies { implementation dependenciesList.junit implementation dependenciesList.androidXAnnotation implementation dependenciesList.coroutinesTestAndroid - implementation dependenciesList.kotlinReflect implementation dependenciesList.mapboxCommonNative + api dependenciesList.kotlinReflect implementation dependenciesList.mockk + api dependenciesList.mockkAgentJvm + api dependenciesList.mockkAgentApi implementation 'org.json:json:20210307' } \ No newline at end of file From 6b862c9ffa2e31b02016ee254e0e18acd0962945 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Sun, 26 Feb 2023 10:21:35 +0100 Subject: [PATCH 11/16] wip --- Makefile | 6 ++ android-auto-app/build.gradle | 4 + gradle/pitest.gradle | 114 ++++++++++++++++++++++++++++- libnavigation-android/build.gradle | 4 + libnavigation-core/build.gradle | 4 + libnavigation-metrics/build.gradle | 4 + libnavigation-router/build.gradle | 4 + libnavigator/build.gradle | 2 +- libnavui-androidauto/build.gradle | 4 + libnavui-app/build.gradle | 4 + libnavui-base/build.gradle | 4 + libnavui-dropin/build.gradle | 4 + libnavui-maneuver/build.gradle | 4 + libnavui-maps/build.gradle | 4 + libnavui-resources/build.gradle | 4 + libnavui-shield/build.gradle | 4 + libnavui-speedlimit/build.gradle | 4 + libnavui-status/build.gradle | 4 + libnavui-tripprogress/build.gradle | 4 + libnavui-util/build.gradle | 4 + libnavui-voice/build.gradle | 4 + libtesting-utils/build.gradle | 3 + libtrip-notification/build.gradle | 5 ++ 23 files changed, 198 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8520de11e97..43a016456a5 100644 --- a/Makefile +++ b/Makefile @@ -239,3 +239,9 @@ update-metalava: car: adb forward tcp:5277 tcp:5277 cd $(ANDROID_HOME)/extras/google/auto/ && ./desktop-head-unit + +.PHONY: pitest +pitest: + $(call run-gradle-tasks,$(CORE_MODULES),pitestDebug) \ + && $(call run-gradle-tasks,$(UI_MODULES),pitestDebug) \ +# && $(call run-gradle-tasks,$(ANDROIDAUTO_MODULES),pitestDebug) \ diff --git a/android-auto-app/build.gradle b/android-auto-app/build.gradle index d4761344b65..1e1fc6590ff 100644 --- a/android-auto-app/build.gradle +++ b/android-auto-app/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'com.mapbox.maps.token' diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index e5f985538df..9fe0bc77d0c 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -11,7 +11,7 @@ pitest { jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true - excludeMockableAndroidJar = true + excludeMockableAndroidJar = true // remove for debug failWhenNoMutations = false mutators = ['EMPTY_RETURNS'] @@ -20,8 +20,116 @@ pitest { // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', // 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] - excludedTestClasses = [] + excludedTestClasses = + [ + // libnavigation-metrics + + // libnavigation-router + + // libnavigation-android + + // libnavigator + + // libnavigation-util + + // libnavui-util + + // libnavui-resources + + // libnavui-shield + + // libnavui-androidauto + + + // libnavigation-base + 'com.mapbox.navigation.base.utils.route.RouteProgressExTest**', + 'com.mapbox.navigation.base.route.RouteExclusionsTest**', + 'com.mapbox.navigation.base.route.NavigationRouteTest**', + 'com.mapbox.navigation.base.internal.extensions.LocaleExTest**', + 'com.mapbox.navigation.base.internal.route.RouteCompatibilityCacheTest**', + 'com.mapbox.navigation.base.internal.route.RouteProgressExTest**', + 'com.mapbox.navigation.base.internal.utils.DirectionsRouteExTest**', + 'com.mapbox.navigation.base.internal.utils.DirectionsRouteMissingConditionsCheckTest**', + 'com.mapbox.navigation.base.route.RouteExclusionsJavaTest**', + // libnavigation-core + 'com.mapbox.navigation.core.routerefresh.RouteRefreshControllerTest', + 'com.mapbox.navigation.core.formatter.MapboxDistanceFormatterTest', + 'com.mapbox.navigation.core.formatter.MapboxDistanceUtilTest', + // libnavigation-copilot + 'com.mapbox.navigation.copilot.MapboxCopilotTest', + 'com.mapbox.navigation.copilot.HistoryAttachmentsUtilsTest', + 'com.mapbox.navigation.copilot.MapboxCopilotImplTest', + // libtrip-notification + + 'com.mapbox.navigation.trip.notification.internal.TimeFormatterTest', + // libnavui-base + 'com.mapbox.navigation.ui.base.view.MapboxExtendableButtonTest', + // libnavui-maps + 'com.mapbox.navigation.ui.maps.view.MapboxCameraModeButtonTest', + 'com.mapbox.navigation.ui.maps.route.arrow.RouteArrowUtilsRoboTest', + 'com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApiTest', + 'com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApiRoboTest', + 'com.mapbox.navigation.ui.maps.roadname.view.MapboxRoadNameLabelViewTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteLineComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteArrowComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RouteAlternativeComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.NavigationCameraComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.MapboxRecenterButtonComponentContractTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.ui.RecenterButtonComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.LocationPuckComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.ui.LocationComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsTest', + 'com.mapbox.navigation.ui.maps.PredictiveCacheControllerTest', + 'com.mapbox.navigation.ui.maps.internal.ui.BuildingHighlightComponentTest', + 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsRoboTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest,', + 'com.mapbox.navigation.ui.maps.camera.view.MapboxRouteOverviewButtonTest', + 'com.mapbox.navigation.ui.maps.camera.view.MapboxRecenterButtonTest', + // libnavui-tripprogress + 'com.mapbox.navigation.ui.tripprogress.view.MapboxTripProgressViewTest', + 'com.mapbox.navigation.ui.tripprogress.model.TripProgressUpdateFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.TimeRemainingFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.DistanceRemainingFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.internal.ui.TripProgressComponentTest', + 'com.mapbox.navigation.ui.tripprogress.api.MapboxTripProgressApiTest', + 'com.mapbox.navigation.ui.tripprogress.TripProgressProcessorTest,', + // libnavui-maneuver + 'com.mapbox.navigation.ui.maneuver.api.MapboxManeuverApiTest', + 'com.mapbox.navigation.ui.maneuver.internal.ManeuverComponentTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxExitTextTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxLaneGuidanceTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest,', + 'com.mapbox.navigation.ui.maneuver.ManeuverProcessorTest', + // libnavui-voice + 'com.mapbox.navigation.ui.voice.view.MapboxSoundButtonTest', + 'com.mapbox.navigation.ui.voice.model.SpeechAnnouncementTest', + 'com.mapbox.navigation.ui.voice.internal.ui.AudioGuidanceButtonComponentTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxVoiceInstructionsTest', + 'com.mapbox.navigation.ui.voice.api.VoiceInstructionsPrefetcherTest', + 'com.mapbox.navigation.ui.voice.api.MapboxAudioGuidanceTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxAudioGuidanceServicesTest', + // libnavui-speedlimit + 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedLimitViewTest', + 'com.mapbox.navigation.ui.speedlimit.internal.SpeedInfoComponentTest', + 'com.mapbox.navigation.ui.speedlimit.internal.SpeedLimitComponentTest', + 'com.mapbox.navigation.ui.speedlimit.model.MapboxSpeedInfoOptionsTest', + 'com.mapbox.navigation.ui.speedlimit.model.SpeedLimitFormatterTest', + 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedInfoViewTest', + // libnavui-status + 'com.mapbox.navigation.ui.status.view.MapboxStatusViewTest', + // libnavui-dropin + 'com.mapbox.navigation.dropin.analytics.AnalyticsComponentTest', + 'com.mapbox.navigation.dropin.camera.CameraComponentTest', + 'com.mapbox.navigation.dropin.map.geocoding.GeocodingComponentTest', + 'com.mapbox.navigation.dropin.map.longpress.FreeDriveLongPressMapComponentTest', + 'com.mapbox.navigation.dropin.map.longpress.RoutePreviewLongPressMapComponentTest', + 'com.mapbox.navigation.dropin.navigationview.MapboxNavigationViewApiTest', + 'com.mapbox.navigation.dropin.arrival.ArrivalTextComponentTest', + // libnavui-app + 'com.mapbox.navigation.ui.app.internal.routefetch.RouteOptionsProviderTest', + 'com.mapbox.navigation.ui.app.internal.controller.CameraStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.LocationStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.NavigationStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.RouteAlternativeComponentImplTest', + 'com.mapbox.navigation.ui.app.internal.controller.RoutePreviewStateControllerTest', + 'com.mapbox.navigation.ui.app.internal.controller.RouteStateControllerTest', + '', + '', + '', + ] // Use feature EXPORT for debug -// features = ["+EXPORT"] + // features = ["+EXPORT"] } diff --git a/libnavigation-android/build.gradle b/libnavigation-android/build.gradle index 22795f76ce2..a397b84aea8 100644 --- a/libnavigation-android/build.gradle +++ b/libnavigation-android/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigation-core/build.gradle b/libnavigation-core/build.gradle index 45df7ab9071..bdfed3fef2e 100644 --- a/libnavigation-core/build.gradle +++ b/libnavigation-core/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigation-metrics/build.gradle b/libnavigation-metrics/build.gradle index 6dfb149daea..571f248934a 100644 --- a/libnavigation-metrics/build.gradle +++ b/libnavigation-metrics/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'org.jetbrains.dokka' diff --git a/libnavigation-router/build.gradle b/libnavigation-router/build.gradle index 5cd5c85613d..de0d206db67 100644 --- a/libnavigation-router/build.gradle +++ b/libnavigation-router/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavigator/build.gradle b/libnavigator/build.gradle index 5e1f9b16e2e..b52b49a4a4a 100644 --- a/libnavigator/build.gradle +++ b/libnavigator/build.gradle @@ -56,7 +56,7 @@ dependencies { // instrumentation tests androidTestImplementation project(':libtesting-ui') androidTestImplementation dependenciesList.testRunner -// androidTestUtil dependenciesList.testOrchestrator + androidTestUtil dependenciesList.testOrchestrator } apply from: "../gradle/track-public-apis.gradle" diff --git a/libnavui-androidauto/build.gradle b/libnavui-androidauto/build.gradle index f8ec05eae61..aec9452a65a 100644 --- a/libnavui-androidauto/build.gradle +++ b/libnavui-androidauto/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-app/build.gradle b/libnavui-app/build.gradle index 61c2ff0d412..345261d094e 100644 --- a/libnavui-app/build.gradle +++ b/libnavui-app/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-base/build.gradle b/libnavui-base/build.gradle index c5227d511a4..ee7cd890ee1 100644 --- a/libnavui-base/build.gradle +++ b/libnavui-base/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-dropin/build.gradle b/libnavui-dropin/build.gradle index 93bc336a334..2f2a1eef188 100644 --- a/libnavui-dropin/build.gradle +++ b/libnavui-dropin/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-maneuver/build.gradle b/libnavui-maneuver/build.gradle index 6fde9bdafe7..bcdfdec1a93 100644 --- a/libnavui-maneuver/build.gradle +++ b/libnavui-maneuver/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-maps/build.gradle b/libnavui-maps/build.gradle index ba22359421b..edb982cb5a9 100644 --- a/libnavui-maps/build.gradle +++ b/libnavui-maps/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-resources/build.gradle b/libnavui-resources/build.gradle index 5986e8dce95..3b3df9a20ee 100644 --- a/libnavui-resources/build.gradle +++ b/libnavui-resources/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-shield/build.gradle b/libnavui-shield/build.gradle index 79ffbcb505a..6ed2df8e66b 100644 --- a/libnavui-shield/build.gradle +++ b/libnavui-shield/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-speedlimit/build.gradle b/libnavui-speedlimit/build.gradle index 9f4cadf6eb7..d40dd03543d 100644 --- a/libnavui-speedlimit/build.gradle +++ b/libnavui-speedlimit/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-status/build.gradle b/libnavui-status/build.gradle index 877c0769f56..498715b20b0 100644 --- a/libnavui-status/build.gradle +++ b/libnavui-status/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-tripprogress/build.gradle b/libnavui-tripprogress/build.gradle index 05222ce61c1..9b7eb3e5530 100644 --- a/libnavui-tripprogress/build.gradle +++ b/libnavui-tripprogress/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-util/build.gradle b/libnavui-util/build.gradle index e1271b074f7..a88622c5988 100644 --- a/libnavui-util/build.gradle +++ b/libnavui-util/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libnavui-voice/build.gradle b/libnavui-voice/build.gradle index 22bcbe8bbc3..3c309a7bf7d 100644 --- a/libnavui-voice/build.gradle +++ b/libnavui-voice/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' diff --git a/libtesting-utils/build.gradle b/libtesting-utils/build.gradle index ce068027101..3097d9306b2 100644 --- a/libtesting-utils/build.gradle +++ b/libtesting-utils/build.gradle @@ -28,4 +28,7 @@ dependencies { api dependenciesList.mockkAgentJvm api dependenciesList.mockkAgentApi implementation 'org.json:json:20210307' + + // need for pitest + api "com.mapbox.mapboxsdk:auto-value-gson:0.0.1" } \ No newline at end of file diff --git a/libtrip-notification/build.gradle b/libtrip-notification/build.gradle index ada649bc4d4..bf7740f5cdb 100644 --- a/libtrip-notification/build.gradle +++ b/libtrip-notification/build.gradle @@ -1,3 +1,7 @@ +plugins { + id("pl.droidsonroids.pitest") apply(false) +} +apply from: "../gradle/pitest.gradle" apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' @@ -39,6 +43,7 @@ dependencies { implementation dependenciesList.coroutinesAndroid apply from: "../gradle/unit-testing-dependencies.gradle" + testImplementation(project(':libtesting-utils')) } apply from: "../gradle/track-public-apis.gradle" From c77356e38659b339298c23fe10afa69900f8fb8e Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Sun, 26 Feb 2023 17:19:44 +0100 Subject: [PATCH 12/16] wip --- .circleci/config.yml | 8 +- Makefile | 8 +- gradle/dependencies.gradle | 4 +- gradle/pitest.gradle | 178 +++++++++++++++++++++++++---- libnavigation-copilot/build.gradle | 7 +- 5 files changed, 170 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d6bd1aff338..56bb8c81684 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ workflows: ignore: /.*/ default: jobs: - - run-pitest + - run-pitest-core # - prepare-and-assemble # - changelog-verification: # filters: @@ -523,13 +523,15 @@ commands: #---------- JOBS ---------- #-------------------------- jobs: - run-pitest: + run-pitest-core: executor: ndk-r22-latest-executor steps: - checkout - run: name: Run pitests - command: ./gradlew :libnavigation-base:pitestDebug --info + command: make pitest-core + - store_artifacts: + path: libnavigation-core/build/reports/pitest prepare-and-assemble: executor: ndk-r22-latest-executor diff --git a/Makefile b/Makefile index 43a016456a5..74f9e07ece0 100644 --- a/Makefile +++ b/Makefile @@ -240,8 +240,6 @@ car: adb forward tcp:5277 tcp:5277 cd $(ANDROID_HOME)/extras/google/auto/ && ./desktop-head-unit -.PHONY: pitest -pitest: - $(call run-gradle-tasks,$(CORE_MODULES),pitestDebug) \ - && $(call run-gradle-tasks,$(UI_MODULES),pitestDebug) \ -# && $(call run-gradle-tasks,$(ANDROIDAUTO_MODULES),pitestDebug) \ +.PHONY: pitest-libnavigation-core +pitest-core: + ./gradlew :libnavigation-core:pitestDebug diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 89d057503da..e8136fe710e 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -41,13 +41,13 @@ ext { materialDesignVersion : '1.1.0', autoValue : '1.5.4', autoValueParcel : '0.2.5', - junit : '4.12', + junit : '4.13.2', constraintLayout : '1.1.3', mockito : '2.23.4', mockkVersion : '1.12.3', leakCanaryVersion : '2.9.1', commonsIO : '2.6', - robolectric : '4.7.3', + robolectric : '4.8.1', mockwebserver : '4.9.0', gmsLocation : '17.0.0', ktlint : '0.47.1', diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 9fe0bc77d0c..f4f61ee656f 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -14,46 +14,87 @@ pitest { excludeMockableAndroidJar = true // remove for debug failWhenNoMutations = false - mutators = ['EMPTY_RETURNS'] -// mutators = ['DEFAULTS'] +// mutators = ['EMPTY_RETURNS'] + mutators = ['DEFAULTS'] // https://pitest.org/quickstart/mutators/ // mutators = ['DEFAULTS', 'CONSTRUCTOR_CALLS', 'EMPTY_RETURNS', 'FALSE_RETURNS', // 'NULL_RETURNS', 'REMOVE_CONDITIONALS', 'REMOVE_INCREMENTS', 'EXPERIMENTAL_SWITCH'] excludedTestClasses = [ - // libnavigation-metrics + - // libnavigation-router + - // libnavigation-android + - // libnavigator + - // libnavigation-util + - // libnavui-util + - // libnavui-resources + - // libnavui-shield + - // libnavui-androidauto + - // libnavigation-base 'com.mapbox.navigation.base.utils.route.RouteProgressExTest**', 'com.mapbox.navigation.base.route.RouteExclusionsTest**', 'com.mapbox.navigation.base.route.NavigationRouteTest**', 'com.mapbox.navigation.base.internal.extensions.LocaleExTest**', - 'com.mapbox.navigation.base.internal.route.RouteCompatibilityCacheTest**', + 'com.mapbox.navigation.base.internal.route.RouteCompatibilityCacheTest', 'com.mapbox.navigation.base.internal.route.RouteProgressExTest**', 'com.mapbox.navigation.base.internal.utils.DirectionsRouteExTest**', 'com.mapbox.navigation.base.internal.utils.DirectionsRouteMissingConditionsCheckTest**', 'com.mapbox.navigation.base.route.RouteExclusionsJavaTest**', + 'com.mapbox.navigation.base.formatter.DistanceFormatterOptionsTest', + 'com.mapbox.navigation.base.options.NavigationOptionsTest', + 'com.mapbox.navigation.base.internal.extensions.ContextExTest', // libnavigation-core 'com.mapbox.navigation.core.routerefresh.RouteRefreshControllerTest', 'com.mapbox.navigation.core.formatter.MapboxDistanceFormatterTest', 'com.mapbox.navigation.core.formatter.MapboxDistanceUtilTest', + 'com.mapbox.navigation.core.trip.session.MapboxTripSessionTest', + 'com.mapbox.navigation.core.trip.session.TripSessionLocationEngineTest', + 'com.mapbox.navigation.core.trip.session.NavigationSessionTest', + 'com.mapbox.navigation.core.history.MapboxHistoryRecorderTest', + 'com.mapbox.navigation.core.RoutesCacheClearerTest', + 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', + 'com.mapbox.navigation.core.accounts.BillingControllerTest', + 'com.mapbox.navigation.core.accounts.BillingControllerWaypointsComparisonTest', + 'com.mapbox.navigation.core.arrival.ArrivalProgressObserverTest', + 'com.mapbox.navigation.core.arrival.AutoArrivalControllerTest', + 'com.mapbox.navigation.core.arrival.RouteStateObserverParametrizedTest', + 'com.mapbox.navigation.core.directions.session.MapboxDirectionsSessionTest', + 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerCopilotTest', + 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerObserverRegisterTest', + 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerTest', + 'com.mapbox.navigation.core.preview.RoutesPreviewControllerTest', + 'com.mapbox.navigation.core.replay.history.MapboxReplayerTest', + 'com.mapbox.navigation.core.replay.history.ReplayHistoryMapperTest', + 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionOptionsTest', + 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionTest', + 'com.mapbox.navigation.core.replay.route.ReplayProgressObserverTest', + 'com.mapbox.navigation.core.replay.route.ReplayRouteMapperTest', + 'com.mapbox.navigation.core.replay.route.ReplayRouteInterpolatorTest', + 'com.mapbox.navigation.core.reroute.MapboxRerouteControllerTest', + 'com.mapbox.navigation.core.routealternatives.AlternativeRouteProgressDataProviderTest', + 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterParameterizedTest', + 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterTest**', + 'com.mapbox.navigation.core.routerefresh.DirectionsRouteDiffProviderTest', + 'com.mapbox.navigation.core.routerefresh.RouteRefreshStubTest', + 'com.mapbox.navigation.core.telemetry.LocationsCollectorTes', + 'com.mapbox.navigation.core.telemetry.NavigationFeedbackEventTest', + 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataTest', + 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataWrapperTest', + 'com.mapbox.navigation.core.trip.MapboxTripStarterTest', + 'com.mapbox.navigation.core.trip.session.BannerInstructionEventTest', + 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', + 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewHistoryRecordingSessionStateTest', + 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewNavigationSessionStateTest', + 'com.mapbox.navigation.core.telemetry.LocationsCollectorTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationCustomEventTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationArriveEventTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationCancelEventTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationDepartEventTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationFeedbackEventTest', + 'com.mapbox.navigation.core.telemetry.events.NavigationRerouteEventTest', + '**MapboxNavigation**Test**', // libnavigation-copilot 'com.mapbox.navigation.copilot.MapboxCopilotTest', 'com.mapbox.navigation.copilot.HistoryAttachmentsUtilsTest', + 'com.mapbox.navigation.copilot.HistoryUploadWorkerTest', 'com.mapbox.navigation.copilot.MapboxCopilotImplTest', // libtrip-notification + 'com.mapbox.navigation.trip.notification.internal.TimeFormatterTest', // libnavui-base 'com.mapbox.navigation.ui.base.view.MapboxExtendableButtonTest', + 'com.mapbox.navigation.ui.base.lifecycle.UICoordinatorTest', // libnavui-maps 'com.mapbox.navigation.ui.maps.view.MapboxCameraModeButtonTest', 'com.mapbox.navigation.ui.maps.route.arrow.RouteArrowUtilsRoboTest', @@ -65,18 +106,43 @@ pitest { 'com.mapbox.navigation.ui.maps.internal.ui.RouteAlternativeComponentTest', 'com.mapbox.navigation.ui.maps.internal.ui.NavigationCameraComponentTest', 'com.mapbox.navigation.ui.maps.internal.ui.MapboxRecenterButtonComponentContractTest', - 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest', 'com.mapbox.navigation.ui.maps.internal.ui.RecenterButtonComponentTest', - 'com.mapbox.navigation.ui.maps.internal.ui.LocationPuckComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.ui.LocationPuckComponentTest', 'com.mapbox.navigation.ui.maps.internal.ui.LocationComponentTest', - 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest,', + 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest', 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsTest', 'com.mapbox.navigation.ui.maps.PredictiveCacheControllerTest', 'com.mapbox.navigation.ui.maps.internal.ui.BuildingHighlightComponentTest', 'com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtilsRoboTest', - 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest,', + 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest', 'com.mapbox.navigation.ui.maps.camera.view.MapboxRouteOverviewButtonTest', 'com.mapbox.navigation.ui.maps.camera.view.MapboxRecenterButtonTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.view.MapboxSignboardViewTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.api.MapboxExternalFileResolverTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.view.MapboxJunctionViewTest', + 'com.mapbox.navigation.ui.maps.guidance.restarea.view.MapboxRestAreaGuideMapViewTest', + 'com.mapbox.navigation.ui.maps.internal.ui.CameraModeButtonComponentTest', + 'com.mapbox.navigation.ui.maps.internal.ui.RoadNameComponentTest', + 'com.mapbox.navigation.ui.maps.roadname.view.MapboxRoadNameViewTest', + 'com.mapbox.navigation.ui.maps.route.line.model.RouteLineResourcesTest', + 'com.mapbox.navigation.ui.maps.route.line.model.RouteLineColorResourcesTest', + 'com.mapbox.navigation.ui.maps.internal.ui.MapboxCameraModeButtonComponentContractTest', + 'com.mapbox.navigation.ui.maps.building.BuildingProcessorTest', + 'com.mapbox.navigation.ui.maps.building.api.MapboxBuildingsApiTest', + 'com.mapbox.navigation.ui.maps.building.model.BuildingHighlightOptionsTest', + 'com.mapbox.navigation.ui.maps.building.view.MapboxBuildingViewTest', + 'com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessorTest', + 'com.mapbox.navigation.ui.maps.camera.lifecycle.BasicNavigationCameraLifecycleControllerTest', + 'com.mapbox.navigation.ui.maps.camera.lifecycle.NavigationScaleGestureHandlerOptionsTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.JunctionProcessorTest', + 'com.mapbox.navigation.ui.maps.guidance.junction.api.MapboxRasterToBitmapParserTest', + 'com.mapbox.navigation.ui.maps.guidance.restarea.RestAreaProcessorTest', + 'com.mapbox.navigation.ui.maps.guidance.signboard.SignboardProcessorTest', + 'com.mapbox.navigation.ui.maps.internal.extensions.MapboxStyleExtensionsKtTest', + 'com.mapbox.navigation.ui.maps.location.NavigationLocationProviderTest', + 'com.mapbox.navigation.ui.maps.internal.extensions.NavigationCameraFlowableTest', + '', // libnavui-tripprogress 'com.mapbox.navigation.ui.tripprogress.view.MapboxTripProgressViewTest', 'com.mapbox.navigation.ui.tripprogress.model.TripProgressUpdateFormatterTest', @@ -84,14 +150,27 @@ pitest { 'com.mapbox.navigation.ui.tripprogress.model.DistanceRemainingFormatterTest', 'com.mapbox.navigation.ui.tripprogress.internal.ui.TripProgressComponentTest', 'com.mapbox.navigation.ui.tripprogress.api.MapboxTripProgressApiTest', - 'com.mapbox.navigation.ui.tripprogress.TripProgressProcessorTest,', + 'com.mapbox.navigation.ui.tripprogress.TripProgressProcessorTest', + 'com.mapbox.navigation.ui.tripprogress.model.EstimatedTimeToArrivalFormatterTest', + 'com.mapbox.navigation.ui.tripprogress.model.TripProgressViewOptionsTest', // libnavui-maneuver 'com.mapbox.navigation.ui.maneuver.api.MapboxManeuverApiTest', 'com.mapbox.navigation.ui.maneuver.internal.ManeuverComponentTest', 'com.mapbox.navigation.ui.maneuver.view.MapboxExitTextTest', 'com.mapbox.navigation.ui.maneuver.view.MapboxLaneGuidanceTest', - 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest,', + 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest', 'com.mapbox.navigation.ui.maneuver.ManeuverProcessorTest', + 'com.mapbox.navigation.ui.maneuver.model.ManeuverInstructionGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.model.RoadShieldGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.model.ExitStyleGeneratorTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxPrimaryManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxTurnIconManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxStepDistanceTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxLaneGuidanceAdapterTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxSecondaryManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxSubManeuverTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxManeuverViewTest', + 'com.mapbox.navigation.ui.maneuver.view.MapboxUpcomingManeuverAdapterTest', // libnavui-voice 'com.mapbox.navigation.ui.voice.view.MapboxSoundButtonTest', 'com.mapbox.navigation.ui.voice.model.SpeechAnnouncementTest', @@ -100,6 +179,10 @@ pitest { 'com.mapbox.navigation.ui.voice.api.VoiceInstructionsPrefetcherTest', 'com.mapbox.navigation.ui.voice.api.MapboxAudioGuidanceTest', 'com.mapbox.navigation.ui.voice.internal.impl.MapboxAudioGuidanceServicesTest', + 'com.mapbox.navigation.ui.voice.api.MapboxSpeechApiTest', + 'com.mapbox.navigation.ui.voice.api.PreOreoAudioFocusDelegateTest', + 'com.mapbox.navigation.ui.voice.api.VoiceInstructionsPlayerAttributesTest', + 'com.mapbox.navigation.ui.voice.internal.impl.MapboxAudioGuidanceVoiceTest', // libnavui-speedlimit 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedLimitViewTest', 'com.mapbox.navigation.ui.speedlimit.internal.SpeedInfoComponentTest', @@ -107,16 +190,60 @@ pitest { 'com.mapbox.navigation.ui.speedlimit.model.MapboxSpeedInfoOptionsTest', 'com.mapbox.navigation.ui.speedlimit.model.SpeedLimitFormatterTest', 'com.mapbox.navigation.ui.speedlimit.view.MapboxSpeedInfoViewTest', + 'com.mapbox.navigation.ui.speedlimit.SpeedLimitProcessorTest', + 'com.mapbox.navigation.ui.speedlimit.api.MapboxSpeedInfoApiTest', + '', // libnavui-status 'com.mapbox.navigation.ui.status.view.MapboxStatusViewTest', // libnavui-dropin 'com.mapbox.navigation.dropin.analytics.AnalyticsComponentTest', 'com.mapbox.navigation.dropin.camera.CameraComponentTest', + 'com.mapbox.navigation.dropin.camera.CameraModeButtonComponentContractImplTest', 'com.mapbox.navigation.dropin.map.geocoding.GeocodingComponentTest', 'com.mapbox.navigation.dropin.map.longpress.FreeDriveLongPressMapComponentTest', 'com.mapbox.navigation.dropin.map.longpress.RoutePreviewLongPressMapComponentTest', 'com.mapbox.navigation.dropin.navigationview.MapboxNavigationViewApiTest', 'com.mapbox.navigation.dropin.arrival.ArrivalTextComponentTest', + 'com.mapbox.navigation.dropin.camera.CameraLayoutObserverTest', + 'com.mapbox.navigation.dropin.actionbutton.CameraModeButtonBinderTest', + 'com.mapbox.navigation.dropin.actionbutton.CompassButtonBinderTest', + 'com.mapbox.navigation.dropin.EmptyBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelEndNavigationButtonBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderActiveGuidanceBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderArrivalBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderDestinationPreviewBinderTest', + 'com.mapbox.navigation.dropin.actionbutton.AudioGuidanceButtonBinderTest', + 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsCoordinatorTest', + 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsBinderTest', + 'com.mapbox.navigation.dropin.actionbutton.RecenterButtonBinderTest', + 'com.mapbox.navigation.dropin.navigationview.NavigationViewStylesTest', + 'com.mapbox.navigation.dropin.navigationview.NavigationViewOptionsTest', + 'com.mapbox.navigation.dropin.tripprogress.TripProgressBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderRoutesPreviewBinderTest', + 'com.mapbox.navigation.dropin.infopanel.MapboxInfoPanelBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelStartNavigationButtonBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelPoiNameBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelRoutePreviewButtonBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelArrivalTextBinderTest', + 'com.mapbox.navigation.dropin.infopanel.InfoPanelCoordinatorTest', + 'com.mapbox.navigation.dropin.maneuver.ManeuverCoordinatorTest', + 'com.mapbox.navigation.dropin.maneuver.ManeuverViewBinderTest', + 'com.mapbox.navigation.dropin.map.scalebar.ScalebarPlaceholderBinderTest', + 'com.mapbox.navigation.dropin.map.scalebar.ScalebarComponentTest', + 'com.mapbox.navigation.dropin.map.geocoding.POINameComponentTest', + 'com.mapbox.navigation.dropin.map.MapLayoutCoordinatorTest', + 'com.mapbox.navigation.dropin.map.MapViewBinderTest', + 'com.mapbox.navigation.dropin.map.marker.MapMarkerFactoryTest', + 'com.mapbox.navigation.dropin.speedlimit.SpeedInfoViewBinderTest', + 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitCoordinatorTest', + 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitViewBinderTest', + 'com.mapbox.navigation.dropin.roadname.RoadNameCoordinatorTest', + 'com.mapbox.navigation.dropin.roadname.RoadNameViewBinderTest', + '', + '', + '', // libnavui-app 'com.mapbox.navigation.ui.app.internal.routefetch.RouteOptionsProviderTest', 'com.mapbox.navigation.ui.app.internal.controller.CameraStateControllerTest', @@ -125,9 +252,20 @@ pitest { 'com.mapbox.navigation.ui.app.internal.controller.RouteAlternativeComponentImplTest', 'com.mapbox.navigation.ui.app.internal.controller.RoutePreviewStateControllerTest', 'com.mapbox.navigation.ui.app.internal.controller.RouteStateControllerTest', + // libnavui-androidauto + 'com.mapbox.androidauto.settings.CarSettingsScreenTest', + 'com.mapbox.androidauto.navigation.maneuver.CarManeuverIconOptionsTest', + 'com.mapbox.androidauto.placeslistonmap.PlacesListOnMapLayerUtilTest', + // libnavui-shield + + 'com.mapbox.navigation.ui.shield.model.RouteShieldTest', + 'com.mapbox.navigation.ui.shield.RoadShieldContentManagerImplTest', + 'com.mapbox.navigation.ui.shield.ShieldSpritesCacheTest', '', '', - '', + // libnavigation-router + + 'com.mapbox.navigation.route.internal.RouterWrapperTests', + // libnavui-util + 'com.mapbox.navigation.ui.utils.internal.lifecycle.ViewLifecycleRegistryTest', ] // Use feature EXPORT for debug diff --git a/libnavigation-copilot/build.gradle b/libnavigation-copilot/build.gradle index 849b73d727c..6f3b5a8347c 100644 --- a/libnavigation-copilot/build.gradle +++ b/libnavigation-copilot/build.gradle @@ -35,12 +35,9 @@ dependencies { implementation dependenciesList.androidXWorkManager implementation dependenciesList.androidXLifecycleProcess -// testImplementation project(':libtesting-navigation-util') + testImplementation project(':libtesting-navigation-util') testImplementation project(':libtesting-utils') - testImplementation dependenciesList.kotlinReflect - testImplementation dependenciesList.mockk - testImplementation dependenciesList.mockkAgentJvm - testImplementation dependenciesList.mockkAgentApi + implementation dependenciesList.androidXAppCompat apply from: "../gradle/unit-testing-dependencies.gradle" } From 56b940172e72509d7c71d21bb91e8c08bbc95a6c Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Sun, 26 Feb 2023 21:02:28 +0100 Subject: [PATCH 13/16] try --- gradle/pitest.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index f4f61ee656f..7a5656b8c40 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -11,7 +11,7 @@ pitest { jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true - excludeMockableAndroidJar = true // remove for debug +// excludeMockableAndroidJar = true // remove for debug failWhenNoMutations = false // mutators = ['EMPTY_RETURNS'] From 3639d30334134e215621ace62d0e38673cc93dd0 Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Sun, 26 Feb 2023 22:13:04 +0100 Subject: [PATCH 14/16] try --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56bb8c81684..9b4f0dd6b5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -525,6 +525,7 @@ commands: jobs: run-pitest-core: executor: ndk-r22-latest-executor + resource_class: 2xlarge steps: - checkout - run: From 42afde5d08c7c4b0be60dd376d4d463f19bc427a Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Sun, 26 Feb 2023 22:15:43 +0100 Subject: [PATCH 15/16] wip --- gradle/pitest.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 7a5656b8c40..655823e6701 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -8,7 +8,7 @@ pitest { threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] timestampedReports = false - jvmArgs = ['-Xmx8192m'] +// jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true // excludeMockableAndroidJar = true // remove for debug From 321fd8fd6fc0e015c7811e8a759c3b41784aa33b Mon Sep 17 00:00:00 2001 From: Yury Kanetski Date: Mon, 27 Feb 2023 11:58:10 +0100 Subject: [PATCH 16/16] wip --- Makefile | 10 +++ gradle/pitest.gradle | 187 +++++++++++++++++++++---------------------- 2 files changed, 101 insertions(+), 96 deletions(-) diff --git a/Makefile b/Makefile index 74f9e07ece0..d945d233672 100644 --- a/Makefile +++ b/Makefile @@ -240,6 +240,16 @@ car: adb forward tcp:5277 tcp:5277 cd $(ANDROID_HOME)/extras/google/auto/ && ./desktop-head-unit +.PHONY: pitest +pitest: + $(call run-gradle-tasks,$(CORE_MODULES),pitestDebug) \ + && $(call run-gradle-tasks,$(UI_MODULES),pitestDebug) \ + && $(call run-gradle-tasks,$(ANDROIDAUTO_MODULES),pitestDebug) \ + .PHONY: pitest-libnavigation-core pitest-core: ./gradlew :libnavigation-core:pitestDebug + +.PHONY: pitest-libnavui-dropin +pitest-libnavui-dropin: + ./gradlew :libnavui-dropin:pitestDebug diff --git a/gradle/pitest.gradle b/gradle/pitest.gradle index 655823e6701..5f5ee71595e 100644 --- a/gradle/pitest.gradle +++ b/gradle/pitest.gradle @@ -8,10 +8,8 @@ pitest { threads = Runtime.getRuntime().availableProcessors() outputFormats = ['XML', 'HTML'] timestampedReports = false -// jvmArgs = ['-Xmx8192m'] verbose = true exportLineCoverage = true -// excludeMockableAndroidJar = true // remove for debug failWhenNoMutations = false // mutators = ['EMPTY_RETURNS'] @@ -39,52 +37,52 @@ pitest { 'com.mapbox.navigation.core.routerefresh.RouteRefreshControllerTest', 'com.mapbox.navigation.core.formatter.MapboxDistanceFormatterTest', 'com.mapbox.navigation.core.formatter.MapboxDistanceUtilTest', - 'com.mapbox.navigation.core.trip.session.MapboxTripSessionTest', - 'com.mapbox.navigation.core.trip.session.TripSessionLocationEngineTest', - 'com.mapbox.navigation.core.trip.session.NavigationSessionTest', - 'com.mapbox.navigation.core.history.MapboxHistoryRecorderTest', - 'com.mapbox.navigation.core.RoutesCacheClearerTest', - 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', - 'com.mapbox.navigation.core.accounts.BillingControllerTest', - 'com.mapbox.navigation.core.accounts.BillingControllerWaypointsComparisonTest', - 'com.mapbox.navigation.core.arrival.ArrivalProgressObserverTest', - 'com.mapbox.navigation.core.arrival.AutoArrivalControllerTest', - 'com.mapbox.navigation.core.arrival.RouteStateObserverParametrizedTest', - 'com.mapbox.navigation.core.directions.session.MapboxDirectionsSessionTest', - 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerCopilotTest', - 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerObserverRegisterTest', - 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerTest', - 'com.mapbox.navigation.core.preview.RoutesPreviewControllerTest', - 'com.mapbox.navigation.core.replay.history.MapboxReplayerTest', - 'com.mapbox.navigation.core.replay.history.ReplayHistoryMapperTest', - 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionOptionsTest', - 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionTest', - 'com.mapbox.navigation.core.replay.route.ReplayProgressObserverTest', - 'com.mapbox.navigation.core.replay.route.ReplayRouteMapperTest', - 'com.mapbox.navigation.core.replay.route.ReplayRouteInterpolatorTest', - 'com.mapbox.navigation.core.reroute.MapboxRerouteControllerTest', - 'com.mapbox.navigation.core.routealternatives.AlternativeRouteProgressDataProviderTest', - 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterParameterizedTest', - 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterTest**', - 'com.mapbox.navigation.core.routerefresh.DirectionsRouteDiffProviderTest', - 'com.mapbox.navigation.core.routerefresh.RouteRefreshStubTest', - 'com.mapbox.navigation.core.telemetry.LocationsCollectorTes', - 'com.mapbox.navigation.core.telemetry.NavigationFeedbackEventTest', - 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataTest', - 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataWrapperTest', - 'com.mapbox.navigation.core.trip.MapboxTripStarterTest', - 'com.mapbox.navigation.core.trip.session.BannerInstructionEventTest', - 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', - 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewHistoryRecordingSessionStateTest', - 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewNavigationSessionStateTest', - 'com.mapbox.navigation.core.telemetry.LocationsCollectorTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationCustomEventTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationArriveEventTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationCancelEventTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationDepartEventTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationFeedbackEventTest', - 'com.mapbox.navigation.core.telemetry.events.NavigationRerouteEventTest', - '**MapboxNavigation**Test**', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionTest', +// 'com.mapbox.navigation.core.trip.session.TripSessionLocationEngineTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionTest', +// 'com.mapbox.navigation.core.history.MapboxHistoryRecorderTest', +// 'com.mapbox.navigation.core.RoutesCacheClearerTest', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', +// 'com.mapbox.navigation.core.accounts.BillingControllerTest', +// 'com.mapbox.navigation.core.accounts.BillingControllerWaypointsComparisonTest', +// 'com.mapbox.navigation.core.arrival.ArrivalProgressObserverTest', +// 'com.mapbox.navigation.core.arrival.AutoArrivalControllerTest', +// 'com.mapbox.navigation.core.arrival.RouteStateObserverParametrizedTest', +// 'com.mapbox.navigation.core.directions.session.MapboxDirectionsSessionTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerCopilotTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerObserverRegisterTest', +// 'com.mapbox.navigation.core.internal.HistoryRecordingStateHandlerTest', +// 'com.mapbox.navigation.core.preview.RoutesPreviewControllerTest', +// 'com.mapbox.navigation.core.replay.history.MapboxReplayerTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistoryMapperTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionOptionsTest', +// 'com.mapbox.navigation.core.replay.history.ReplayHistorySessionTest', +// 'com.mapbox.navigation.core.replay.route.ReplayProgressObserverTest', +// 'com.mapbox.navigation.core.replay.route.ReplayRouteMapperTest', +// 'com.mapbox.navigation.core.replay.route.ReplayRouteInterpolatorTest', +// 'com.mapbox.navigation.core.reroute.MapboxRerouteControllerTest', +// 'com.mapbox.navigation.core.routealternatives.AlternativeRouteProgressDataProviderTest', +// 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterParameterizedTest', +// 'com.mapbox.navigation.core.routeoptions.RouteOptionsUpdaterTest**', +// 'com.mapbox.navigation.core.routerefresh.DirectionsRouteDiffProviderTest', +// 'com.mapbox.navigation.core.routerefresh.RouteRefreshStubTest', +// 'com.mapbox.navigation.core.telemetry.LocationsCollectorTes', +// 'com.mapbox.navigation.core.telemetry.NavigationFeedbackEventTest', +// 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataTest', +// 'com.mapbox.navigation.core.telemetry.events.FeedbackMetadataWrapperTest', +// 'com.mapbox.navigation.core.trip.MapboxTripStarterTest', +// 'com.mapbox.navigation.core.trip.session.BannerInstructionEventTest', +// 'com.mapbox.navigation.core.trip.session.MapboxTripSessionNoSetupTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewHistoryRecordingSessionStateTest', +// 'com.mapbox.navigation.core.trip.session.NavigationSessionUtilsGetNewNavigationSessionStateTest', +// 'com.mapbox.navigation.core.telemetry.LocationsCollectorTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationCustomEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationArriveEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationCancelEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationDepartEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationFeedbackEventTest', +// 'com.mapbox.navigation.core.telemetry.events.NavigationRerouteEventTest', +// '**MapboxNavigation**Test**', // libnavigation-copilot 'com.mapbox.navigation.copilot.MapboxCopilotTest', 'com.mapbox.navigation.copilot.HistoryAttachmentsUtilsTest', @@ -196,54 +194,51 @@ pitest { // libnavui-status 'com.mapbox.navigation.ui.status.view.MapboxStatusViewTest', // libnavui-dropin - 'com.mapbox.navigation.dropin.analytics.AnalyticsComponentTest', - 'com.mapbox.navigation.dropin.camera.CameraComponentTest', - 'com.mapbox.navigation.dropin.camera.CameraModeButtonComponentContractImplTest', - 'com.mapbox.navigation.dropin.map.geocoding.GeocodingComponentTest', - 'com.mapbox.navigation.dropin.map.longpress.FreeDriveLongPressMapComponentTest', - 'com.mapbox.navigation.dropin.map.longpress.RoutePreviewLongPressMapComponentTest', - 'com.mapbox.navigation.dropin.navigationview.MapboxNavigationViewApiTest', - 'com.mapbox.navigation.dropin.arrival.ArrivalTextComponentTest', - 'com.mapbox.navigation.dropin.camera.CameraLayoutObserverTest', - 'com.mapbox.navigation.dropin.actionbutton.CameraModeButtonBinderTest', - 'com.mapbox.navigation.dropin.actionbutton.CompassButtonBinderTest', - 'com.mapbox.navigation.dropin.EmptyBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelEndNavigationButtonBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderActiveGuidanceBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderArrivalBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderDestinationPreviewBinderTest', - 'com.mapbox.navigation.dropin.actionbutton.AudioGuidanceButtonBinderTest', - 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsCoordinatorTest', - 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsBinderTest', - 'com.mapbox.navigation.dropin.actionbutton.RecenterButtonBinderTest', - 'com.mapbox.navigation.dropin.navigationview.NavigationViewStylesTest', - 'com.mapbox.navigation.dropin.navigationview.NavigationViewOptionsTest', - 'com.mapbox.navigation.dropin.tripprogress.TripProgressBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderRoutesPreviewBinderTest', - 'com.mapbox.navigation.dropin.infopanel.MapboxInfoPanelBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelStartNavigationButtonBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelPoiNameBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelRoutePreviewButtonBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelArrivalTextBinderTest', - 'com.mapbox.navigation.dropin.infopanel.InfoPanelCoordinatorTest', - 'com.mapbox.navigation.dropin.maneuver.ManeuverCoordinatorTest', - 'com.mapbox.navigation.dropin.maneuver.ManeuverViewBinderTest', - 'com.mapbox.navigation.dropin.map.scalebar.ScalebarPlaceholderBinderTest', - 'com.mapbox.navigation.dropin.map.scalebar.ScalebarComponentTest', - 'com.mapbox.navigation.dropin.map.geocoding.POINameComponentTest', - 'com.mapbox.navigation.dropin.map.MapLayoutCoordinatorTest', - 'com.mapbox.navigation.dropin.map.MapViewBinderTest', - 'com.mapbox.navigation.dropin.map.marker.MapMarkerFactoryTest', - 'com.mapbox.navigation.dropin.speedlimit.SpeedInfoViewBinderTest', - 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitCoordinatorTest', - 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitViewBinderTest', - 'com.mapbox.navigation.dropin.roadname.RoadNameCoordinatorTest', - 'com.mapbox.navigation.dropin.roadname.RoadNameViewBinderTest', - '', - '', - '', +// 'com.mapbox.navigation.dropin.analytics.AnalyticsComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraModeButtonComponentContractImplTest', +// 'com.mapbox.navigation.dropin.map.geocoding.GeocodingComponentTest', +// 'com.mapbox.navigation.dropin.map.longpress.FreeDriveLongPressMapComponentTest', +// 'com.mapbox.navigation.dropin.map.longpress.RoutePreviewLongPressMapComponentTest', +// 'com.mapbox.navigation.dropin.navigationview.MapboxNavigationViewApiTest', +// 'com.mapbox.navigation.dropin.arrival.ArrivalTextComponentTest', +// 'com.mapbox.navigation.dropin.camera.CameraLayoutObserverTest', +// 'com.mapbox.navigation.dropin.actionbutton.CameraModeButtonBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.CompassButtonBinderTest', +// 'com.mapbox.navigation.dropin.EmptyBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelEndNavigationButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderActiveGuidanceBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderArrivalBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderDestinationPreviewBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.AudioGuidanceButtonBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsCoordinatorTest', +// 'com.mapbox.navigation.dropin.actionbutton.ActionButtonsBinderTest', +// 'com.mapbox.navigation.dropin.actionbutton.RecenterButtonBinderTest', +// 'com.mapbox.navigation.dropin.navigationview.NavigationViewStylesTest', +// 'com.mapbox.navigation.dropin.navigationview.NavigationViewOptionsTest', +// 'com.mapbox.navigation.dropin.tripprogress.TripProgressBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelHeaderRoutesPreviewBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.MapboxInfoPanelBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelStartNavigationButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelPoiNameBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelRoutePreviewButtonBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelArrivalTextBinderTest', +// 'com.mapbox.navigation.dropin.infopanel.InfoPanelCoordinatorTest', +// 'com.mapbox.navigation.dropin.maneuver.ManeuverCoordinatorTest', +// 'com.mapbox.navigation.dropin.maneuver.ManeuverViewBinderTest', +// 'com.mapbox.navigation.dropin.map.scalebar.ScalebarPlaceholderBinderTest', +// 'com.mapbox.navigation.dropin.map.scalebar.ScalebarComponentTest', +// 'com.mapbox.navigation.dropin.map.geocoding.POINameComponentTest', +// 'com.mapbox.navigation.dropin.map.MapLayoutCoordinatorTest', +// 'com.mapbox.navigation.dropin.map.MapViewBinderTest', +// 'com.mapbox.navigation.dropin.map.marker.MapMarkerFactoryTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedInfoViewBinderTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitCoordinatorTest', +// 'com.mapbox.navigation.dropin.speedlimit.SpeedLimitViewBinderTest', +// 'com.mapbox.navigation.dropin.roadname.RoadNameCoordinatorTest', +// 'com.mapbox.navigation.dropin.roadname.RoadNameViewBinderTest', // libnavui-app 'com.mapbox.navigation.ui.app.internal.routefetch.RouteOptionsProviderTest', 'com.mapbox.navigation.ui.app.internal.controller.CameraStateControllerTest',