Skip to content
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

Closed

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Apr 17, 2019

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.

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)
Copy link

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"))
Copy link

@oehme oehme Apr 17, 2019

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)
Copy link

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.

Copy link
Member

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

@AlecKazakova
Copy link
Collaborator

gonna close this out since its red and inactive, feel free to reopen if we'd like to revisit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants