xintongsong commented on code in PR #20574: URL: https://github.com/apache/flink/pull/20574#discussion_r947665643
########## flink-runtime/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTestUtils.java: ########## @@ -0,0 +1,262 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.rest.compatibility; + +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.runtime.rest.util.DocumentingRestEndpoint; +import org.apache.flink.runtime.rest.versioning.RestAPIVersion; +import org.apache.flink.util.jackson.JacksonMapperFactory; + +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultIndenter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultPrettyPrinter; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode; + +import org.junit.jupiter.api.Assertions; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** The util of stability test and snapshot generator for the REST API. */ +public final class RestAPIStabilityTestUtils { + + private static final ObjectMapper OBJECT_MAPPER = JacksonMapperFactory.createObjectMapper(); + + public static void testStability( + String notifyMessagePrefix, Review Comment: I'm not sure why do we need this prefix. I think upon test failures, there should already be enough information that tells which tests (runtime/sql-gateway) the failure comes from. ########## flink-runtime-web/src/test/java/org/apache/flink/runtime/rest/compatibility/RestAPIStabilityTest.java: ########## @@ -18,52 +18,35 @@ package org.apache.flink.runtime.rest.compatibility; -import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.runtime.rest.util.DocumentingDispatcherRestEndpoint; -import org.apache.flink.runtime.rest.util.DocumentingRestEndpoint; import org.apache.flink.runtime.rest.versioning.RuntimeRestAPIVersion; import org.apache.flink.util.ConfigurationException; -import org.apache.flink.util.jackson.JacksonMapperFactory; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultIndenter; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.util.DefaultPrettyPrinter; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode; - -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; -import java.io.File; import java.io.IOException; -import java.net.URL; import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; import java.util.stream.Stream; -/** Stability test and snapshot generator for the REST API. */ +import static org.apache.flink.runtime.rest.compatibility.RestAPIStabilityTestUtils.testStability; + +/** Stability test and snapshot generator for the Runtime REST API. */ final class RestAPIStabilityTest { Review Comment: ```suggestion final class RuntimeRestAPIStabilityTest { ``` ########## flink-table/flink-sql-gateway/pom.xml: ########## @@ -98,6 +98,13 @@ <artifactId>okhttp</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-runtime</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> Review Comment: Not sure if we need this. I think currently `flink-sql-gateway` already (indirectly) depends on `flink-runtime`. ########## flink-runtime/pom.xml: ########## @@ -179,6 +179,11 @@ under the License. <artifactId>flink-test-utils-junit</artifactId> </dependency> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-shaded-jackson-module-jsonSchema</artifactId> + </dependency> Review Comment: And if we move this dependency here, do we still need it in flink-runtime-web? ########## flink-runtime/pom.xml: ########## @@ -179,6 +179,11 @@ under the License. <artifactId>flink-test-utils-junit</artifactId> </dependency> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-shaded-jackson-module-jsonSchema</artifactId> + </dependency> Review Comment: Shouldn't this be a test scope dependency? -- 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