use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project che-server by eclipse-che.
the class MachineResolverTest method shouldSetDefaultCPULimitAndRequestIfSidecarDoesNotHaveOne.
@Test
public void shouldSetDefaultCPULimitAndRequestIfSidecarDoesNotHaveOne() throws InfrastructureException {
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(CPU_LIMIT_ATTRIBUTE), DEFAULT_CPU_LIMIT);
assertEquals(machineConfig.getAttributes().get(CPU_REQUEST_ATTRIBUTE), DEFAULT_CPU_REQUEST);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project che-server by eclipse-che.
the class MachineResolverTest method shouldSetMemoryLimitOfASidecarIfCorrespondingComponentFieldIsSet.
@Test(dataProvider = "memoryLimitAttributeProvider")
public void shouldSetMemoryLimitOfASidecarIfCorrespondingComponentFieldIsSet(String memoryLimit, String expectedMemLimit) throws InfrastructureException {
component.setMemoryLimit(memoryLimit);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE), expectedMemLimit);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project che-server by eclipse-che.
the class MachineResolverTest method shouldSetServersInMachineConfig.
@Test(dataProvider = "serverProvider")
public void shouldSetServersInMachineConfig(List<ChePluginEndpoint> containerEndpoints, Map<String, ServerConfig> expected) throws InfrastructureException {
endpoints.addAll(containerEndpoints);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getServers(), expected);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project che-server by eclipse-che.
the class MachineResolverTest method shouldAddProjectMountPointWhenMountSources.
@Test
public void shouldAddProjectMountPointWhenMountSources() throws InfrastructureException {
cheContainer.setMountSources(true);
InternalMachineConfig config = resolver.resolve();
assertEquals(1, config.getVolumes().size());
assertEquals(PROJECTS_MOUNT_PATH, config.getVolumes().get(Constants.PROJECTS_VOLUME_NAME).getPath());
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project che-server by eclipse-che.
the class MachineResolverTest method shouldOverrideMemoryLimitOfASidecarIfCorrespondingWSConfigAttributeIsSet.
@Test
public void shouldOverrideMemoryLimitOfASidecarIfCorrespondingWSConfigAttributeIsSet() throws InfrastructureException {
String memoryLimit = "300Mi";
String expectedMemLimit = toBytesString(memoryLimit);
Containers.addRamLimit(container, 123456789);
component.setMemoryLimit(memoryLimit);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE), expectedMemLimit);
}
Aggregations