diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-05-13 10:25:31 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-05-13 10:25:31 +0200 |
commit | 288491a4f42e3167fa847bf39b193680671b6aa9 (patch) | |
tree | bbee4a18067d33bdc7611ba468f516ec380b6ea9 /config-model | |
parent | 31a2c57d196a8fe5f23a8f2a753940d165e0201b (diff) |
Test file constants in profiles
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/derived/schemainheritance/parent.sd | 4 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java | 13 |
2 files changed, 7 insertions, 10 deletions
diff --git a/config-model/src/test/derived/schemainheritance/parent.sd b/config-model/src/test/derived/schemainheritance/parent.sd index 4d247a570a6..41c2d89fff5 100644 --- a/config-model/src/test/derived/schemainheritance/parent.sd +++ b/config-model/src/test/derived/schemainheritance/parent.sd @@ -27,10 +27,6 @@ schema parent { parent_constant tensor<float>(x{},y{}): file:constants/my_constant_tensor_file.json } } -# constant parent_constant { (old syntax equivalent to the above) -# file: constants/my_constant_tensor_file.json -# type: tensor<float>(x{},y{}) -# } onnx-model parent_model { file: small_constants_and_functions.onnx } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java index eb9b6e3a733..65f4dab3650 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java @@ -122,10 +122,9 @@ public class SchemaTestCase { " indexing: input pf1 | lowercase | index | attribute | summary" + " }" + " rank-profile child1_profile inherits parent_profile {" + - " }" + - " constant child1_constant {" + - " file: constants/my_constant_tensor_file.json" + - " type: tensor<float>(x{},y{})" + + " constants {" + + " child1_constant tensor<float>(x{},y{}): file:constants/my_constant_tensor_file.json" + + " }" + " }" + " onnx-model child1_model {" + " file: models/my_model.onnx" + @@ -188,11 +187,13 @@ public class SchemaTestCase { assertNotNull(child1.getExtraField("child1_field")); assertNotNull(builder.getRankProfileRegistry().get(child1, "parent_profile")); assertNotNull(builder.getRankProfileRegistry().get(child1, "child1_profile")); + var child1profile = builder.getRankProfileRegistry().get(child1, "child1_profile"); assertEquals("parent_profile", builder.getRankProfileRegistry().get(child1, "child1_profile").inheritedNames().get(0)); assertNotNull(child1.constants().get(FeatureNames.asConstantFeature("parent_constant"))); - assertNotNull(child1.constants().get(FeatureNames.asConstantFeature("child1_constant"))); + assertNotNull(child1profile.constants().get(FeatureNames.asConstantFeature("child1_constant"))); assertTrue(child1.constants().containsKey(FeatureNames.asConstantFeature("parent_constant"))); - assertTrue(child1.constants().containsKey(FeatureNames.asConstantFeature("child1_constant"))); + assertTrue(child1profile.constants().containsKey(FeatureNames.asConstantFeature("child1_constant"))); + assertTrue(child1profile.constants().containsKey(FeatureNames.asConstantFeature("parent_constant"))); assertNotNull(child1.onnxModels().get("parent_model")); assertNotNull(child1.onnxModels().get("child1_model")); assertTrue(child1.onnxModels().asMap().containsKey("parent_model")); |