diff options
author | Lester Solbakken <lesters@oath.com> | 2021-08-19 09:22:13 +0200 |
---|---|---|
committer | Lester Solbakken <lesters@oath.com> | 2021-08-19 09:22:13 +0200 |
commit | 1008380a61d66d8c4b4805758d11395e4a81305d (patch) | |
tree | 84afe109b1d06fedcf65fc6e27e20942a0e53a0c /config-model/src/test/java/com/yahoo/vespa/model/ml | |
parent | 9777847f6f0d40f37c3bedbc0d5a34a1fdeab2e2 (diff) |
Add unit test for global rankprofile name collision from onnx models
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/ml')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/ml/StatelessOnnxEvaluationTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/ml/StatelessOnnxEvaluationTest.java b/config-model/src/test/java/com/yahoo/vespa/model/ml/StatelessOnnxEvaluationTest.java index 5c64dd9f8cd..7d3d36bf5b3 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/ml/StatelessOnnxEvaluationTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/ml/StatelessOnnxEvaluationTest.java @@ -38,6 +38,26 @@ import static org.junit.Assert.assertTrue; public class StatelessOnnxEvaluationTest { @Test + public void testStatelessOnnxModelNameCollision() throws IOException { + Path appDir = Path.fromString("src/test/cfg/application/onnx_name_collision"); + try { + ImportedModelTester tester = new ImportedModelTester("onnx", appDir); + VespaModel model = tester.createVespaModel(); + ApplicationContainerCluster cluster = model.getContainerClusters().get("container"); + RankProfilesConfig.Builder b = new RankProfilesConfig.Builder(); + cluster.getConfig(b); + RankProfilesConfig config = new RankProfilesConfig(b); + assertEquals(2, config.rankprofile().size()); + + Set<String> modelNames = config.rankprofile().stream().map(v -> v.name()).collect(Collectors.toSet()); + assertTrue(modelNames.contains("foobar")); + assertTrue(modelNames.contains("barfoo")); + } finally { + IOUtils.recursiveDeleteDir(appDir.append(ApplicationPackage.MODELS_GENERATED_DIR).toFile()); + } + } + + @Test public void testStatelessOnnxModelEvaluation() throws IOException { Path appDir = Path.fromString("src/test/cfg/application/onnx"); Path storedAppDir = appDir.append("copy"); |