use of com.google.devtools.build.lib.exec.BlazeExecutor in project bazel by bazelbuild.
the class StandaloneSpawnStrategyTest method setUp.
@Before
public final void setUp() throws Exception {
Path testRoot = createTestRoot();
Path workspaceDir = testRoot.getRelative("workspace-name");
workspaceDir.createDirectory();
// setup output base & directories
Path outputBase = testRoot.getRelative("outputBase");
outputBase.createDirectory();
BlazeDirectories directories = new BlazeDirectories(outputBase, outputBase, workspaceDir, "mock-product-name");
// This call implicitly symlinks the integration bin tools into the exec root.
IntegrationMock.get().getIntegrationBinTools(directories);
OptionsParser optionsParser = OptionsParser.newOptionsParser(ExecutionOptions.class);
optionsParser.parse("--verbose_failures");
EventBus bus = new EventBus();
ResourceManager resourceManager = ResourceManager.instanceForTestingOnly();
resourceManager.setAvailableResources(ResourceSet.create(/*memoryMb=*/
1, /*cpuUsage=*/
1, /*ioUsage=*/
1, /*localTestCount=*/
1));
this.executor = new BlazeExecutor(directories.getExecRoot(), reporter, bus, BlazeClock.instance(), optionsParser, ImmutableList.<ActionContext>of(), ImmutableMap.<String, SpawnActionContext>of("", new StandaloneSpawnStrategy(directories.getExecRoot(), false, "mock-product-name", resourceManager)), ImmutableList.<ActionContextProvider>of());
executor.getExecRoot().createDirectory();
}
Aggregations