lindong28 commented on code in PR #218: URL: https://github.com/apache/flink-ml/pull/218#discussion_r1133236486
########## flink-ml-core/src/test/java/org/apache/flink/ml/api/PipelineTest.java: ########## @@ -95,4 +109,59 @@ public void testPipeline() throws Exception { // Executes the loaded Pipeline and verifies that it produces the expected output. TestUtils.executeAndCheckOutput(env, loadedEstimator, inputs, output, null, null); } + + @Test + public void testSupportServable() { + SumEstimator estimatorA = new SumEstimator(); + UnionAlgoOperator algoOperatorA = new UnionAlgoOperator(); + SumModel modelA = new SumModel(); + SumModel modelB = new SumModel(); + + List<Stage<?>> stages = Arrays.asList(modelA, modelB); + PipelineModel pipelineModel = new PipelineModel(stages); + assertTrue(pipelineModel.supportServable()); + + stages = Arrays.asList(estimatorA, modelA); + pipelineModel = new PipelineModel(stages); + assertFalse(pipelineModel.supportServable()); + + stages = Arrays.asList(algoOperatorA, modelA); + pipelineModel = new PipelineModel(stages); + assertFalse(pipelineModel.supportServable()); + } + + @Test + public void testLoadServable() throws Exception { Review Comment: This test also covers the method `PipelineModelServable#transform` in addition to `PipelineModel#loadServable`. Which parts of the `PipelineModelServable` lifecycle is not tested? ########## flink-ml-core/src/test/java/org/apache/flink/ml/api/PipelineTest.java: ########## @@ -95,4 +109,59 @@ public void testPipeline() throws Exception { // Executes the loaded Pipeline and verifies that it produces the expected output. TestUtils.executeAndCheckOutput(env, loadedEstimator, inputs, output, null, null); } + + @Test + public void testSupportServable() { + SumEstimator estimatorA = new SumEstimator(); + UnionAlgoOperator algoOperatorA = new UnionAlgoOperator(); + SumModel modelA = new SumModel(); + SumModel modelB = new SumModel(); + + List<Stage<?>> stages = Arrays.asList(modelA, modelB); + PipelineModel pipelineModel = new PipelineModel(stages); + assertTrue(pipelineModel.supportServable()); + + stages = Arrays.asList(estimatorA, modelA); + pipelineModel = new PipelineModel(stages); + assertFalse(pipelineModel.supportServable()); + + stages = Arrays.asList(algoOperatorA, modelA); + pipelineModel = new PipelineModel(stages); + assertFalse(pipelineModel.supportServable()); + } + + @Test + public void testLoadServable() throws Exception { Review Comment: This test also covers the method `PipelineModelServable#transform` in addition to `PipelineModel#loadServable`. Which part of the `PipelineModelServable` lifecycle is not tested? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org