diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-10-08 14:50:28 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-10-08 14:50:28 +0200 |
commit | bdbc7feedfb1ee4767a37e5166a884b71221ba45 (patch) | |
tree | 857aa730f482a420977426851af61ea662d781ee /controller-server | |
parent | 1be5a1edc8d308a6be8c4b43a72ce395fec04359 (diff) |
Indicate whether test runtime is CI or not, in TestConfig
Diffstat (limited to 'controller-server')
6 files changed, 9 insertions, 1 deletions
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<ZoneId, Map<ClusterSpec.Id, URI>> deployments, Map<ZoneId, List<String>> 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<ZoneId, Map<ClusterSpec.Id, URI>> deployments, Map<ZoneId, List<String>> 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<ZoneId> 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/" |