private void RunScrubberWithPipGraph( TestEnv env, PipGraph pipGraph, string[] pathsToScrub, MountPathExpander mountPathExpander = null) { var scrubber = new DirectoryScrubber( LoggingContext, m_loggingConfiguration, isPathInBuild: p => pipGraph.IsPathInBuild(env.Paths.CreateAbsolutePath(p)), pathsToScrub: pathsToScrub, blockedPaths: new string[0], nonDeletableRootDirectories: pipGraph.AllDirectoriesContainingOutputs().Select(p => env.Paths.Expand(p)), mountPathExpander: mountPathExpander, maxDegreeParallelism: 2); bool removed = scrubber.RemoveExtraneousFilesAndDirectories(new CancellationToken()); XAssert.IsTrue(removed); }