aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/pkgcache
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-09-13 16:46:10 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-09-14 09:35:04 +0000
commit6f33a1c54e517d7343c36d0479713655a19f3224 (patch)
tree3e4920aa44a9ad54a06d2b6a574127fee8829e7b /src/test/java/com/google/devtools/build/lib/pkgcache
parent4d94984c61892749315a6c98a3b1facf84762653 (diff)
Track client environment in Skyframe
...to determine which actions have to be recomputed based on changes to the client environment. Note that this change does it the simple way and reconsideres all actions on a changed client environment, while still only reexecuting those, where the part that was inherited from the environment actually did change. -- Change-Id: Ie1116d094642165e5e959447a6fcf49d19b37d6e Reviewed-on: https://bazel-review.googlesource.com/#/c/5431 MOS_MIGRATED_REVID=133010705
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/pkgcache')
-rw-r--r--src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java17
-rw-r--r--src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java15
3 files changed, 20 insertions, 18 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java
index 3a2798f240..3069a1d12c 100644
--- a/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java
+++ b/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java
@@ -55,20 +55,17 @@ import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
import com.google.devtools.build.skyframe.SkyFunction;
import com.google.devtools.build.skyframe.SkyFunctionName;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
-
import javax.annotation.Nullable;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
/**
* Tests for incremental loading; these cover both normal operation and diff awareness, for which a
@@ -488,7 +485,8 @@ public class IncrementalLoadingTest {
skyframeExecutor.preparePackageLoading(
new PathPackageLocator(outputBase, ImmutableList.of(workspace)),
ConstantRuleVisibility.PUBLIC, true, 7, "",
- UUID.randomUUID(), new TimestampGranularityMonitor(BlazeClock.instance()));
+ UUID.randomUUID(), ImmutableMap.of(),
+ new TimestampGranularityMonitor(BlazeClock.instance()));
}
Path addFile(String fileName, String... content) throws IOException {
@@ -567,7 +565,8 @@ public class IncrementalLoadingTest {
skyframeExecutor.preparePackageLoading(
new PathPackageLocator(outputBase, ImmutableList.of(workspace)),
ConstantRuleVisibility.PUBLIC, true, 7, "",
- UUID.randomUUID(), new TimestampGranularityMonitor(BlazeClock.instance()));
+ UUID.randomUUID(), ImmutableMap.of(),
+ new TimestampGranularityMonitor(BlazeClock.instance()));
skyframeExecutor.invalidateFilesUnderPathForTesting(
new Reporter(), modifiedFileSet, workspace);
((SequencedSkyframeExecutor) skyframeExecutor).handleDiffs(new Reporter());
diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java
index afa781ae84..ceb26a1da3 100644
--- a/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java
@@ -26,6 +26,7 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.eventbus.EventBus;
@@ -620,9 +621,10 @@ public class LoadingPhaseRunnerTest {
7,
analysisMock.getDefaultsPackageContent(),
UUID.randomUUID(),
+ ImmutableMap.of(),
new TimestampGranularityMonitor(clock));
- loadingPhaseRunner = skyframeExecutor.getLoadingPhaseRunner(
- pkgFactory.getRuleClassNames(), useNewImpl);
+ loadingPhaseRunner =
+ skyframeExecutor.getLoadingPhaseRunner(pkgFactory.getRuleClassNames(), useNewImpl);
this.options = Options.getDefaults(LoadingOptions.class);
}
diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java
index 9afcce146f..5735458b10 100644
--- a/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java
+++ b/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider;
@@ -55,17 +56,15 @@ import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsParsingException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
/**
* Tests for package loading.
@@ -112,8 +111,10 @@ public class PackageCacheTest extends FoundationTestCase {
7,
analysisMock.getDefaultsPackageContent(),
UUID.randomUUID(),
+ ImmutableMap.of(),
new TimestampGranularityMonitor(BlazeClock.instance()));
- skyframeExecutor.setDeletedPackages(ImmutableSet.copyOf(packageCacheOptions.getDeletedPackages()));
+ skyframeExecutor.setDeletedPackages(
+ ImmutableSet.copyOf(packageCacheOptions.getDeletedPackages()));
}
private PackageCacheOptions parsePackageCacheOptions(String... options) throws Exception {