Skip to content

Commit f8b39e3

Browse files
committed
Bumped version for runner/rules 0.4.1 hotfix release.
Added example of how to opt-out of analytics by passing a custom argument to the runner through build.gradle. Updated README to reflect latest changes for code coverage. Change-Id: I6d4841840f73e090432d3175039c17a38ea9167c
1 parent e2ea007 commit f8b39e3

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

AndroidTestingBlueprint/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,11 @@ From the command-line via Gradle, unit tests for the module-plain-java are gener
165165

166166
A HTML report will be available in `module-plain-java/build/reports/jacoco/test/html/index.html`
167167

168-
Note: Generating JaCoCo reports from command-line via Gradle for the `app` module is currently not working: [https://code.google.com/p/android/issues/detail?id=144664]
168+
Note: Generating JaCoCo reports from command-line via Gradle for the `app` module is currently only working for instrumentation but not for unit tests: [https://code.google.com/p/android/issues/detail?id=144664]
169169

170170
### Android tests
171171
Test coverage reports for Android tests can be found in `app/build/reports/coverage`.
172172

173-
Note: This will be enabled again with the ATSL Runner 0.4.
174-
175173
## ProGuard
176174
By default tests are run against a non-minified version of your production APK. In most cases, especially during development, this makes a lot of sense because it speeds up your build and therefore improves your cycle times. However it is important to know about breakages as a result of a minified production APK, thus it makes sense to run your tests against a minified version of your APK.
177175

AndroidTestingBlueprint/app/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ android {
2020
versionName '1.0'
2121

2222
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
23+
/*
24+
The Android Testing Support Library collects analytics to continuously improve the testing
25+
experience. More specifically, it uploads a hash of the package name of the application
26+
under test for each invocation. If you do not wish to upload this data, you can opt-out by
27+
passing the following argument to the test runner: disableAnalytics "true".
28+
*/
29+
//testInstrumentationRunnerArguments disableAnalytics: 'true'
2330

2431
/*
2532
Uncomment this to pass custom arguments to AndroidJUnitRunner. If uncommented the
@@ -31,9 +38,8 @@ android {
3138

3239
buildTypes {
3340
debug {
34-
// A bug in com.android.support.test:runner:0.3 prevents coverage reports generation.
35-
// TODO: Uncomment when 0.4 is out.
36-
//testCoverageEnabled = true
41+
// Run code coverage reports by default on debug builds.
42+
testCoverageEnabled = true
3743

3844
// Uncomment this to run test against a minified version of the production APK
3945
/*

AndroidTestingBlueprint/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ext {
2828
junitVersion = "4.12"
2929
mockitoVersion = "1.10.19"
3030
hamcrestVersion = "1.3"
31-
runnerVersion = "0.4"
32-
rulesVersion = "0.4"
31+
runnerVersion = "0.4.1"
32+
rulesVersion = "0.4.1"
3333
espressoVersion = "2.2.1"
3434
uiautomatorVersion = "2.1.2"
3535
}

0 commit comments

Comments
 (0)