public void IncrementalBuildRunsPipsImpactedFromChangedSources() { SetupTestState(); EagerCleanBuild("Build #1"); // SourceFile2 is used by the second process, but not the first. Only the second process run. Paths buildPaths = GetBuildPaths(); File.WriteAllText(buildPaths.SourceFile2Path, "Hey! Look at this new input!"); BuildCounters counters = Build("Build #2"); counters.VerifyNumberOfPipsExecuted(1); counters.VerifyNumberOfProcessPipsCached(TotalPips - 1); VerifyNumberOfCachedOutputs(counters, totalUpToDate: 1, totalCopied: 0); // Despite being a partial build, results from the single pip run should have been cached for next time. EagerBuildWithoutChanges("Build #3"); }
public void IncrementalBuildCopiesContentWhenOutputsDeletedWithLazyOutputMaterialization() { SetupTestState(); Configuration.Engine.DefaultFilter = @"output='" + Path.Combine(Configuration.Layout.ObjectDirectory.ToString(PathTable), "combined") + Path.DirectorySeparatorChar + "*'"; EagerCleanBuild("Build #1"); Paths buildPaths = GetBuildPaths(); File.Delete(buildPaths.CopyOfSourceFile1Path); File.Delete(buildPaths.FinalOutputPath); BuildCounters counters = Build("Build #2"); counters.VerifyNumberOfPipsExecuted(0); counters.VerifyNumberOfProcessPipsCached(TotalPips); counters.VerifyNumberOfCachedOutputsUpToDate(0); // Although CopyOfSourceFile1Path is deleted, since output materialization is lazy, the file is not materialized. counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs - 1); }
public void IncrementalBuildCopiesContentWhenOutputsDeleted() { SetupTestState(); EagerCleanBuild("Build #1"); Paths buildPaths = GetBuildPaths(); File.Delete(buildPaths.CopyOfSourceFile1Path); File.Delete(buildPaths.FinalOutputPath); Configuration.Schedule.EnableLazyOutputMaterialization = false; BuildCounters counters = Build("Build #2"); counters.VerifyNumberOfPipsExecuted(0); counters.VerifyNumberOfProcessPipsCached(TotalPips); counters.VerifyNumberOfCachedOutputsUpToDate(0); counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs); // The next build should know that outputs are up to date, despite them having been re-deployed rather than re-computed last time. EagerBuildWithoutChanges("Build #3"); }