use of junitparams.naming.TestCaseName in project kubernetes-plugin by jenkinsci.
the class PodTemplateBuilderTest method testOverridesFromYaml.
@Test
@TestCaseName("{method}(directConnection={0})")
@Parameters({ "true", "false" })
public void testOverridesFromYaml(boolean directConnection) throws Exception {
cloud.setDirectConnection(directConnection);
PodTemplate template = new PodTemplate();
template.setYaml(loadYamlFile("pod-overrides.yaml"));
setupStubs();
Pod pod = new PodTemplateBuilder(template, slave).build();
Map<String, Container> containers = toContainerMap(pod);
assertEquals(1, containers.size());
Container jnlp = containers.get("jnlp");
assertThat("Wrong number of volume mounts: " + jnlp.getVolumeMounts(), jnlp.getVolumeMounts(), hasSize(1));
PodTemplateUtilsTest.assertQuantity("2", jnlp.getResources().getLimits().get("cpu"));
PodTemplateUtilsTest.assertQuantity("2Gi", jnlp.getResources().getLimits().get("memory"));
PodTemplateUtilsTest.assertQuantity("200m", jnlp.getResources().getRequests().get("cpu"));
PodTemplateUtilsTest.assertQuantity("256Mi", jnlp.getResources().getRequests().get("memory"));
validateContainers(pod, slave, directConnection);
}
Aggregations