From bdbc7feedfb1ee4767a37e5166a884b71221ba45 Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Tue, 8 Oct 2019 14:50:28 +0200 Subject: Indicate whether test runtime is CI or not, in TestConfig --- .../yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java | 1 + .../vespa/hosted/controller/deployment/TestConfigSerializer.java | 5 ++++- .../hosted/controller/restapi/application/ApplicationApiHandler.java | 1 + .../vespa/hosted/controller/deployment/TestConfigSerializerTest.java | 1 + .../hosted/controller/restapi/application/responses/test-config.json | 1 + controller-server/src/test/resources/testConfig.json | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) (limited to 'controller-server') diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 50af8bd8611..c07ae8f5571 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -465,6 +465,7 @@ public class InternalStepRunner implements StepRunner { TesterCloud.Suite.of(id.type()), testConfigSerializer.configJson(id.application(), id.type(), + true, endpoints, controller.applications().contentClustersByZone(id.application(), zones))); return Optional.of(running); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializer.java index e79692d34ed..c33c4681dd9 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializer.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializer.java @@ -30,6 +30,7 @@ public class TestConfigSerializer { public Slime configSlime(ApplicationId id, JobType type, + boolean isCI, Map> deployments, Map> clusters) { Slime slime = new Slime(); @@ -38,6 +39,7 @@ public class TestConfigSerializer { root.setString("application", id.serializedForm()); root.setString("zone", type.zone(system).value()); root.setString("system", system.value()); + root.setBool("isCI", isCI); Cursor endpointsObject = root.setObject("endpoints"); // TODO jvenstad: remove. deployments.forEach((zone, endpoints) -> { @@ -69,10 +71,11 @@ public class TestConfigSerializer { /** Returns the config for the tests to run for the given job. */ public byte[] configJson(ApplicationId id, JobType type, + boolean isCI, Map> deployments, Map> clusters) { try { - return SlimeUtils.toJsonBytes(configSlime(id, type, deployments, clusters)); + return SlimeUtils.toJsonBytes(configSlime(id, type, isCI, deployments, clusters)); } catch (IOException e) { throw new UncheckedIOException(e); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index e4ee858ab4c..b022fbcdd81 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -1523,6 +1523,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler { Set zones = controller.jobController().testedZoneAndProductionZones(id, type); return new SlimeJsonResponse(testConfigSerializer.configSlime(id, type, + false, controller.applications().clusterEndpoints(id, zones), controller.applications().contentClustersByZone(id, zones))); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializerTest.java index 2ddef642065..e28e5dab555 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/TestConfigSerializerTest.java @@ -27,6 +27,7 @@ public class TestConfigSerializerTest { ZoneId zone = JobType.systemTest.zone(SystemName.PublicCd); byte[] json = new TestConfigSerializer(SystemName.PublicCd).configJson(instanceId, JobType.systemTest, + true, Map.of(zone, Map.of(ClusterSpec.Id.from("ai"), URI.create("https://server/"))), Map.of(zone, List.of("facts"))); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json index 2338543b019..b3fa30ee975 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json @@ -2,6 +2,7 @@ "application": "tenant1:application1:instance1", "zone": "prod.us-central-1", "system": "main", + "isCI": false, "endpoints": { "prod.us-central-1": [ "http://old-endpoint.vespa.yahooapis.com:4080" diff --git a/controller-server/src/test/resources/testConfig.json b/controller-server/src/test/resources/testConfig.json index 4145d863995..3b01f7f39ca 100644 --- a/controller-server/src/test/resources/testConfig.json +++ b/controller-server/src/test/resources/testConfig.json @@ -2,6 +2,7 @@ "application": "tenant:application:default", "zone": "test.aws-us-east-1c", "system": "publiccd", + "isCI": true, "endpoints": { "test.aws-us-east-1c": [ "https://server/" -- cgit v1.2.3