diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java index a1a3b40a858..89f81dfdaef 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation; import com.yahoo.config.model.api.Quota; @@ -19,6 +19,7 @@ import static org.junit.jupiter.api.Assertions.fail; */ public class QuotaValidatorTest { + private static final String CONTAINER_CLUSTER = "testCluster.indexing"; private final Zone publicZone = new Zone(SystemName.Public, Environment.prod, RegionName.from("foo")); private final Zone publicCdZone = new Zone(SystemName.PublicCd, Environment.prod, RegionName.from("foo")); private final Zone devZone = new Zone(SystemName.Public, Environment.dev, RegionName.from("foo")); @@ -27,14 +28,14 @@ public class QuotaValidatorTest { @Test void test_deploy_under_quota() { var tester = new ValidationTester(8, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicZone)); - tester.deploy(null, getServices(4), Environment.prod, null); + tester.deploy(null, getServices(4), Environment.prod, null, CONTAINER_CLUSTER); } @Test void test_deploy_above_quota_clustersize() { var tester = new ValidationTester(14, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicZone)); try { - tester.deploy(null, getServices(11), Environment.prod, null); + tester.deploy(null, getServices(11), Environment.prod, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("Clusters testCluster exceeded max cluster size of 10", e.getMessage()); @@ -45,7 +46,7 @@ public class QuotaValidatorTest { void test_deploy_above_quota_budget() { var tester = new ValidationTester(13, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicZone)); try { - tester.deploy(null, getServices(10), Environment.prod, null); + tester.deploy(null, getServices(10), Environment.prod, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("The resources used cost $1.63 but your quota is $1.25: Contact support to upgrade your plan.", e.getMessage()); @@ -56,7 +57,7 @@ public class QuotaValidatorTest { void test_deploy_above_quota_budget_in_publiccd() { var tester = new ValidationTester(13, false, new TestProperties().setHostedVespa(true).setQuota(quota.withBudget(BigDecimal.ONE)).setZone(publicCdZone)); try { - tester.deploy(null, getServices(10), Environment.prod, null); + tester.deploy(null, getServices(10), Environment.prod, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("publiccd: The resources used cost $1.63 but your quota is $1.00: Contact support to upgrade your plan.", e.getMessage()); @@ -67,7 +68,7 @@ public class QuotaValidatorTest { void test_deploy_max_resources_above_quota() { var tester = new ValidationTester(13, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicCdZone)); try { - tester.deploy(null, getServices(10), Environment.prod, null); + tester.deploy(null, getServices(10), Environment.prod, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("publiccd: The resources used cost $1.63 but your quota is $1.25: Contact support to upgrade your plan.", e.getMessage()); @@ -82,7 +83,7 @@ public class QuotaValidatorTest { // There is downscaling to 1 node per cluster in dev try { - tester.deploy(null, getServices(2, false), Environment.dev, null); + tester.deploy(null, getServices(2, false), Environment.dev, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("The resources used cost $0.16 but your quota is $0.01: Contact support to upgrade your plan.", e.getMessage()); @@ -90,7 +91,7 @@ public class QuotaValidatorTest { // Override so that we will get 2 nodes in content cluster try { - tester.deploy(null, getServices(2, true), Environment.dev, null); + tester.deploy(null, getServices(2, true), Environment.dev, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("The resources used cost $0.33 but your quota is $0.01: Contact support to upgrade your plan.", e.getMessage()); @@ -102,7 +103,7 @@ public class QuotaValidatorTest { var quota = Quota.unlimited().withBudget(BigDecimal.valueOf(-1)); var tester = new ValidationTester(13, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicZone)); try { - tester.deploy(null, getServices(10), Environment.prod, null); + tester.deploy(null, getServices(10), Environment.prod, null, CONTAINER_CLUSTER); fail(); } catch (RuntimeException e) { assertEquals("The resources used cost $-.-- but your quota is $--.--: Please free up some capacity.", |