use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.
the class ClusterSizeReductionValidatorTest method testSizeReductionValidation.
@Test
public void testSizeReductionValidation() throws IOException, SAXException {
ValidationTester tester = new ValidationTester(30);
VespaModel previous = tester.deploy(null, getServices(30), null).getFirst();
try {
tester.deploy(previous, getServices(14), null);
fail("Expected exception due to cluster size reduction");
} catch (IllegalArgumentException expected) {
assertEquals("cluster-size-reduction: Size reduction in 'default' is too large. Current size: 30, new size: 14. New size must be at least 50% of the current size", Exceptions.toMessageString(expected));
}
}
use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.
the class IndexingModeChangeValidatorTest method testChangingIndexMode.
@Test
public void testChangingIndexMode() throws IOException, SAXException {
ValidationTester tester = new ValidationTester();
VespaModel oldModel = tester.deploy(null, getServices(AbstractSearchCluster.IndexingMode.REALTIME), validationOverrides).getFirst();
List<ConfigChangeAction> changeActions = tester.deploy(oldModel, getServices(AbstractSearchCluster.IndexingMode.STREAMING), validationOverrides).getSecond();
assertRefeedChange(// allowed=true due to validation override
true, "Cluster 'default' changed indexing mode from 'indexed' to 'streaming'", changeActions);
}
use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.
the class ClusterSizeReductionValidatorTest method testOverridingSizereductionValidation.
/*
@Test
public void testSizeReductionTo50PercentIsAllowed() throws IOException, SAXException {
ValidationTester tester = new ValidationTester(30);
VespaModel previous = tester.deploy(null, getServices(30), null).getFirst();
tester.deploy(previous, getServices(15), null);
}
*/
@Test
public void testOverridingSizereductionValidation() throws IOException, SAXException {
ValidationTester tester = new ValidationTester(30);
VespaModel previous = tester.deploy(null, getServices(30), null).getFirst();
// Allowed due to override
tester.deploy(previous, getServices(14), sizeReductionOverride);
}
use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.
the class ClusterSizeReductionValidatorTest method testSizeReductionValidationMinimalDecreaseIsAllowed.
@Test
public void testSizeReductionValidationMinimalDecreaseIsAllowed() throws IOException, SAXException {
ValidationTester tester = new ValidationTester(30);
VespaModel previous = tester.deploy(null, getServices(3), null).getFirst();
tester.deploy(previous, getServices(2), null);
}
use of com.yahoo.vespa.model.application.validation.ValidationTester in project vespa by vespa-engine.
the class ContentClusterRemovalValidatorTest method testOverridingContentRemovalValidation.
@Test
public void testOverridingContentRemovalValidation() throws IOException, SAXException {
ValidationTester tester = new ValidationTester();
VespaModel previous = tester.deploy(null, getServices("contentClusterId"), null).getFirst();
// Allowed due to override
tester.deploy(previous, getServices("newContentClusterId"), removalOverride);
}
Aggregations