Search in sources :

Example 16 with TestCaseName

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);
}
Also used : PodTemplateBuilder(org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder) Container(io.fabric8.kubernetes.api.model.Container) Pod(io.fabric8.kubernetes.api.model.Pod) Parameters(junitparams.Parameters) Test(org.junit.Test) TestCaseName(junitparams.naming.TestCaseName)

Aggregations

Parameters (junitparams.Parameters)16 TestCaseName (junitparams.naming.TestCaseName)16 Test (org.junit.Test)16 Container (io.fabric8.kubernetes.api.model.Container)7 Pod (io.fabric8.kubernetes.api.model.Pod)7 PodTemplateBuilder (org.csanchez.jenkins.plugins.kubernetes.PodTemplateBuilder)7 FieldScope (com.github.victools.jsonschema.generator.FieldScope)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 AbstractTypeAwareTest (com.github.victools.jsonschema.generator.AbstractTypeAwareTest)2 ConfigFunction (com.github.victools.jsonschema.generator.ConfigFunction)2 JsonObject (io.vertx.core.json.JsonObject)2 IndividualResource (org.folio.rest.support.IndividualResource)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 MethodScope (com.github.victools.jsonschema.generator.MethodScope)1 SchemaCleanUpUtils (com.github.victools.jsonschema.generator.impl.SchemaCleanUpUtils)1 PodSecurityContext (io.fabric8.kubernetes.api.model.PodSecurityContext)1 Quantity (io.fabric8.kubernetes.api.model.Quantity)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 KeyValueEnvVar (org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar)1