Search in sources :

Example 1 with ActionContext

use of com.google.devtools.build.lib.actions.Executor.ActionContext 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();
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) BlazeDirectories(com.google.devtools.build.lib.analysis.BlazeDirectories) BlazeExecutor(com.google.devtools.build.lib.exec.BlazeExecutor) EventBus(com.google.common.eventbus.EventBus) ResourceManager(com.google.devtools.build.lib.actions.ResourceManager) OptionsParser(com.google.devtools.common.options.OptionsParser) ActionContext(com.google.devtools.build.lib.actions.Executor.ActionContext) SpawnActionContext(com.google.devtools.build.lib.actions.SpawnActionContext) SpawnActionContext(com.google.devtools.build.lib.actions.SpawnActionContext) ActionContextProvider(com.google.devtools.build.lib.exec.ActionContextProvider) Before(org.junit.Before)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 ActionContext (com.google.devtools.build.lib.actions.Executor.ActionContext)1 ResourceManager (com.google.devtools.build.lib.actions.ResourceManager)1 SpawnActionContext (com.google.devtools.build.lib.actions.SpawnActionContext)1 BlazeDirectories (com.google.devtools.build.lib.analysis.BlazeDirectories)1 ActionContextProvider (com.google.devtools.build.lib.exec.ActionContextProvider)1 BlazeExecutor (com.google.devtools.build.lib.exec.BlazeExecutor)1 Path (com.google.devtools.build.lib.vfs.Path)1 OptionsParser (com.google.devtools.common.options.OptionsParser)1 Before (org.junit.Before)1