android-testify
android-testify copied to clipboard
ISSUE-79: Support Gradle Configuration Cache
What does this change accomplish?
Fixes #79
How have you achieved it?
The Testify Gradle Plugin now supports Gradle Configuration Cache.
This required two main changes:
- Mark variables calculated that use
projectvalues as@Inputvalues and defer their initialization until the tasks are registered. This is required since the Project can not be accessed directly during configuration. - Defer initialization and usage of the
ADBcommands until task execution. Previously we would initialize ADB when the tasks were registered and this would cause an execution ofadb devicesto initialize the target list. This has been deferred until the task is actually executed.
Also, added new tests using the Gradle TestKit
Scope of Impact and Testing instructions
Use --configuration-cache with your gradle command to enable the Configuration Cache. Run the command multiple times to confirm that the cache is correctly used for subsequent calls.
You can run rm -rf .gradle/configuration-cache/ to clear the cache and start fresh.
$> ./gradlew FlixSample:testifyVersion --configuration-cache
Configuration cache is an incubating feature.
Calculating task graph as no configuration cache is available for tasks: FlixSample:testifyVersion
> Task :FlixSample:testifyVersion
------------------------------------------------------------
Displays the Testify plugin version
------------------------------------------------------------
Vendor = ndtp
Title = Testify
Version = local
0 problems were found storing the configuration cache.
BUILD SUCCESSFUL in 915ms
1 actionable task: 1 executed
Configuration cache entry stored.
$> ./gradlew FlixSample:testifyVersion --configuration-cache
Configuration cache is an incubating feature.
Reusing configuration cache.
> Task :FlixSample:testifyVersion
------------------------------------------------------------
Displays the Testify plugin version
------------------------------------------------------------
Vendor = ndtp
Title = Testify
Version = local
BUILD SUCCESSFUL in 424ms
1 actionable task: 1 executed
Configuration cache entry reused.
Notice
[!WARNING] This change must keep
mainin a shippable state; it may be shipped without further notice.
:white_check_mark: Success! - Legacy Sample screenshot test results
View build for commit bfe8c9128d2f4238951e6578fdec755124fe6ef8
:white_check_mark: Success! - Flix Sample screenshot test results
View build for commit bfe8c9128d2f4238951e6578fdec755124fe6ef8