diff options
author | Martin Polden <mpolden@mpolden.no> | 2023-07-26 16:23:50 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2023-07-26 16:30:14 +0200 |
commit | 8feeba1352d5e24819efe2a43b21368592ecc67a (patch) | |
tree | d500b5dfcfc1b3329ea7748ec4f587375593214a /configserver | |
parent | e3ba83a0fdd1e31036929c172836e9996f79f16d (diff) |
Remove active attribute
Diffstat (limited to 'configserver')
3 files changed, 19 insertions, 61 deletions
diff --git a/configserver/src/test/apps/zkapp/deployment.xml b/configserver/src/test/apps/zkapp/deployment.xml index c8b60f3aa8b..ba71f9c1e47 100644 --- a/configserver/src/test/apps/zkapp/deployment.xml +++ b/configserver/src/test/apps/zkapp/deployment.xml @@ -2,7 +2,7 @@ <!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> <deployment version='1.0'> <test/> - <prod global-service-id='mydisc'> - <region active='true'>us-east</region> + <prod> + <region>us-east</region> </prod> </deployment> diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java index 4f52eede4e8..ca2f9da3273 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java @@ -22,8 +22,6 @@ import com.yahoo.vespa.config.ConfigPayload; import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.model.VespaModel; import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import org.xml.sax.SAXException; import java.io.IOException; @@ -36,7 +34,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; -import java.util.stream.Collectors; import static com.yahoo.cloud.config.LbServicesConfig.Tenants.Applications.Endpoints.RoutingMethod.Enum.sharedLayer4; import static com.yahoo.cloud.config.LbServicesConfig.Tenants.Applications.Endpoints.Scope.Enum.application; @@ -46,12 +43,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; /** * @author Ulf Lilleengen */ -@RunWith(Parameterized.class) public class LbServicesProducerTest { private static final Set<ContainerEndpoint> endpoints = Set.of( @@ -61,16 +56,6 @@ public class LbServicesProducerTest { private static final List<String> zoneDnsSuffixes = List.of(".endpoint1.suffix", ".endpoint2.suffix"); private final InMemoryFlagSource flagSource = new InMemoryFlagSource(); - private final boolean useGlobalServiceId; - - @Parameterized.Parameters - public static Object[] useGlobalServiceId() { - return new Object[] { true, false }; - } - - public LbServicesProducerTest(boolean useGlobalServiceId) { - this.useGlobalServiceId = useGlobalServiceId; - } @Test public void testDeterministicGetConfig() { @@ -88,17 +73,9 @@ public class LbServicesProducerTest { @Test public void testConfigActiveRotation() { - { - RegionName regionName = RegionName.from("us-east-1"); - LbServicesConfig conf = createModelAndGetLbServicesConfig(regionName); - assertTrue(conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").activeRotation()); - } - - { - RegionName regionName = RegionName.from("us-east-2"); - LbServicesConfig conf = createModelAndGetLbServicesConfig(regionName); - assertFalse(conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").activeRotation()); - } + RegionName regionName = RegionName.from("us-east-1"); + LbServicesConfig conf = createModelAndGetLbServicesConfig(regionName); + assertTrue(conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").activeRotation()); } private LbServicesConfig createModelAndGetLbServicesConfig(RegionName regionName) { @@ -116,8 +93,6 @@ public class LbServicesProducerTest { @Test public void testConfigAliasesWithEndpoints() { - assumeFalse(useGlobalServiceId); - Map<TenantName, Set<ApplicationInfo>> testModel = createTestModel(new DeployState.Builder() .endpoints(endpoints) .properties(new TestProperties().setHostedVespa(true))); @@ -150,8 +125,6 @@ public class LbServicesProducerTest { @Test public void testRoutingConfigForTesterApplication() { - assumeFalse(useGlobalServiceId); - Map<TenantName, Set<ApplicationInfo>> testModel = createTestModel(new DeployState.Builder()); // No config for tester application @@ -227,32 +200,17 @@ public class LbServicesProducerTest { " </container>" + "</services>"; - String deploymentInfo; - - if (useGlobalServiceId) { - deploymentInfo ="<?xml version='1.0' encoding='UTF-8'?>" + - "<deployment version='1.0'>" + - " <test />" + - " <prod global-service-id='mydisc'>" + - " <region active='true'>us-east-1</region>" + - " <region active='false'>us-east-2</region>" + - " </prod>" + - "</deployment>"; - } else { - deploymentInfo ="<?xml version='1.0' encoding='UTF-8'?>" + - "<deployment version='1.0'>" + - " <test />" + - " <prod>" + - " <region active='true'>us-east-1</region>" + - " <region active='false'>us-east-2</region>" + - " </prod>" + - " <endpoints>" + - " <endpoint container-id='mydisc' />" + - " </endpoints>" + - "</deployment>"; - } - - + String deploymentInfo = "<?xml version='1.0' encoding='UTF-8'?>" + + "<deployment version='1.0'>" + + " <test />" + + " <prod>" + + " <region>us-east-1</region>" + + " <region>us-east-2</region>" + + " </prod>" + + " <endpoints>" + + " <endpoint container-id='mydisc' />" + + " </endpoints>" + + "</deployment>"; return new MockApplicationPackage.Builder().withServices(services).withDeploymentSpec(deploymentInfo).build(); } diff --git a/configserver/src/test/resources/deploy/hosted-app/deployment.xml b/configserver/src/test/resources/deploy/hosted-app/deployment.xml index f1ebbf7f968..cfd5c61069b 100644 --- a/configserver/src/test/resources/deploy/hosted-app/deployment.xml +++ b/configserver/src/test/resources/deploy/hosted-app/deployment.xml @@ -1,7 +1,7 @@ <!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> <deployment version='1.0'> - <prod global-service-id="qrs"> - <region active="true">us-north-1</region> - <region active="true">us-north-2</region> + <prod> + <region>us-north-1</region> + <region>us-north-2</region> </prod> </deployment> |