diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-11-19 16:50:35 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-11-19 16:53:50 +0100 |
commit | 128b1d270aaca00b958350718a928335f5381b78 (patch) | |
tree | 85b76c8900a1565064c437511593d6cd9a94d8bd /config-model | |
parent | 025248c5690e1f1c5189d53e80d302b1d7369542 (diff) |
Verify that DocumentTypeChangeValidator detects tensor type changes
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java index 190c2c8c645..8416cb459ac 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java @@ -208,6 +208,33 @@ public class DocumentTypeChangeValidatorTest { action.toString()); } + @Test + public void changing_tensor_type_of_tensor_field_requires_refeed() throws Exception { + new Fixture( + "field f1 type tensor(x[2]) { indexing: attribute }", + "field f1 type tensor(x[3]) { indexing: attribute }") + .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), + "field-type-change", + ValidationOverrides.empty, + "Field 'f1' changed: data type: 'tensor(x[2])' -> 'tensor(x[3])'", Instant.now())); + + new Fixture( + "field f1 type tensor(x[5]) { indexing: attribute }", + "field f1 type tensor(x[3]) { indexing: attribute }") + .assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), + "field-type-change", + ValidationOverrides.empty, + "Field 'f1' changed: data type: 'tensor(x[5])' -> 'tensor(x[3])'", Instant.now())); + } + + @Test + public void not_changing_tensor_type_of_tensor_field_is_ok() throws Exception { + new Fixture( + "field f1 type tensor(x[2]) { indexing: attribute }", + "field f1 type tensor(x[2]) { indexing: attribute }") + .assertValidation(); + } + private static NewDocumentType createDocumentTypeWithReferenceField(String nameReferencedDocumentType) { StructDataType headerfields = new StructDataType("headerfields"); headerfields.addField(new Field("ref", new ReferenceDataType(new DocumentType(nameReferencedDocumentType), 0))); |