mkovalyk / image-analyzer-android

Sample project to show how present code coverage of tests on multi-module Android project written in Kotlin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image-analyzer-android

Sample project to show how compute code coverage of tests on multi-module Android project written in Kotlin.

App it self contains several business modules to provide Google MLKit functionality.

Branch Status on CircleCI Status on TravisCI Code coverage
develop CircleCI Build Status codecov

Android MeetUp presentation

Look at slides from my talk on Android meetup:
STRV

Code Schema

Codebase is written using STRV code schema.

Preferences -> Editor -> Codestyle -> Kotlin -> extras/code-schema/strv.xml

Run application from source

Open source in Android Studio 3.3 Canary 13 (or newer)

Use mockDebug Build Variant.

Use MOCK flavour to run application without need to register app to fabric.
Use DEBUG variant to run application without need to configure app signing.

Run Code Coverage locally

Run sh jacoco.sh in the root of project. If you run it on MacOs it will open Chrome and display generated HTMLs.

Otherwise you will find html files in build directories:
./module-core/build/reports/jacocoUnitTestReport/html/index.html
./module-face-detection/build/reports/jacocoUnitTestReport/html/index.html
./module-text-recognition/build/reports/jacocoUnitTestReport/html/index.html
./mobile/build/reports/jacocoUnitTestReport/html/index.html

UI TEST COVERAGE still in progress

I have been working on adding UI testing for isolated fragments.
Then I would like to connect code coverage also for that UI tests.
Every work in progress is available in feature branches.

Special thanks to sources

Multi module navigation with the Android Architec¬ture component

About

Sample project to show how present code coverage of tests on multi-module Android project written in Kotlin.

License:Apache License 2.0


Languages

Language:Kotlin 93.7%Language:Java 4.6%Language:Shell 1.8%