New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare test task inputs. #1304
Conversation
The gradle build cache is disabled for this project, but if it were enabled, the integration tests would be cached even when files and properties they depend on would be used.
@@ -46,6 +46,11 @@ dependencies { | |||
} | |||
|
|||
test { | |||
inputs.files("../gradle/dependencies.gradle").withPathSensitivity(PathSensitivity.RELATIVE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relative path sensitivity only makes sense for directories. What you want here is NONE, because you don't care about the path at all, only the contents.
@@ -46,6 +46,11 @@ dependencies { | |||
} | |||
|
|||
test { | |||
inputs.files("../gradle/dependencies.gradle").withPathSensitivity(PathSensitivity.RELATIVE) | |||
inputs.property("ANDROID_HOME", System.getenv("ANDROID_HOME")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent cache relocation, as you are using an absolute path. I'm sure you don't care about the path at all, but about what's installed there. So it's best to declare the actual files you care about in there as input files.
inputs.files("../gradle/dependencies.gradle").withPathSensitivity(PathSensitivity.RELATIVE) | ||
inputs.property("ANDROID_HOME", System.getenv("ANDROID_HOME")) | ||
inputs.property("TRAVIS_OS_NAME", System.getenv("TRAVIS_OS_NAME")) | ||
inputs.dir("../gradle/wrapper").withPathSensitivity(PathSensitivity.RELATIVE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using the wrapper as an input? Use TestKit to test plugins instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using it in this project
gonna close this out since its red and inactive, feel free to reopen if we'd like to revisit |
The gradle build cache is disabled for this project, but if it were enabled,
the integration tests would be cached even when files and properties
they depend on would be used.
See: gradle/gradle#9151 for more info.