This documents code quality checks that are used to improve the quality of bugsnag-android. Most of these can be run all together using ./gradlew check.
Unit tests are implemented using Junit and can be run with the following:
./gradlew test
Unit tests run on the local JVM and cannot access Android OS classes.
Instrumentation tests are implemented using Junit and can be run with the following:
./gradlew connectedCheck
Instrumentation tests require an Android emulator or device to run, and they can access Android OS classes.
Several static analysis and code style checks are run against bugsnag-android to maintain the quality of the codebase. make check runs them all at once.
Android Lint Runs Android-specific static analysis checks. Warnings can be suppressed by following this guide.
./gradlew lintKtlint runs style checks on Kotlin code.
./gradlew ktlintCheckSome violations (but not all) can be automatically addressed by running the following task:
./gradlew ktlintFormatDetekt runs static analysis checks on Kotlin code.
./gradlew detektWarnings can be suppressed by running the following task:
./gradlew detektBaselineThis permanently disables all outstanding violations by writing to detekt-baseline.xml.
Checkstyle runs style checks on Java code.
./gradlew checkstyleCPP check runs code analysis on C++ code to detect bugs.
./scripts/run-cpp-check.shClangFormat formats C++ code to ensure a consistent code style.
./scripts/run-clang-format.shGWP-ASAN is an address sanitizer tool which is enabled on our E2E tests that target Android 11+. It randomly samples memory and aborts the process if memory was misused.
Gradle build scans are enabled on CI so that the project's build performance can be benchmarked when necessary.
The size impact of the bugsnag-android SDK is reported onto Github pull requests using this Dangerfile.
Please see the mazerunner docs for information on how to run E2E tests locally.