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

Don't cache test tasks #694

Merged
merged 4 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/@unreleased/pr-694.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: improvement
improvement:
description: |
Don't cache test tasks in the build cache by default.
It's possible to restore caching by adding `com.palantir.baseline.restore-test-cache = true` to your `gradle.properties`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the readme too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, didn't see in time :)

links:
- https://github.com/palantir/gradle-baseline/pull/694
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ public final class BaselineTesting implements Plugin<Project> {

@Override
public void apply(Project project) {
project.getTasks().withType(Test.class).all(task -> {
project.getTasks().withType(Test.class).configureEach(task -> {
task.jvmArgs("-XX:+HeapDumpOnOutOfMemoryError", "-XX:+CrashOnOutOfMemoryError");

if (!Objects.equals("true", project.findProperty("com.palantir.baseline.restore-test-cache"))) {
// Never cache test tasks, until we work out the correct inputs for ETE / integration tests
task.getOutputs().cacheIf(t -> false);
}
});

project.getPlugins().withType(JavaPlugin.class, p -> {
Expand Down