You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/09 07:06:27 UTC

[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #114: [FLINK-27542] Refactor E2eTestBase with docker compose

JingsongLi commented on code in PR #114:
URL: https://github.com/apache/flink-table-store/pull/114#discussion_r867694545


##########
flink-table-store-e2e-tests/src/test/java/org/apache/flink/table/store/tests/E2eTestBase.java:
##########
@@ -55,95 +51,70 @@ public abstract class E2eTestBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(E2eTestBase.class);
 
-    // ------------------------------------------------------------------------------------------
-    // Flink Variables
-    // ------------------------------------------------------------------------------------------
-    private static final String FLINK_IMAGE_TAG;
-
-    static {
-        Properties properties = new Properties();
-        try {
-            properties.load(
-                    E2eTestBase.class.getClassLoader().getResourceAsStream("project.properties"));
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-        // TODO change image tag to official flink image after 1.15 is released
-        FLINK_IMAGE_TAG = "tsreaper/flink-test:" + properties.getProperty("flink.version");
+    private final boolean withKafka;
+
+    protected E2eTestBase() {
+        this(false);
+    }
+
+    protected E2eTestBase(boolean withKafka) {
+        this.withKafka = withKafka;
     }
 
-    private static final String INTER_CONTAINER_JM_ALIAS = "jobmanager";
-    private static final String INTER_CONTAINER_TM_ALIAS = "taskmanager";
-    private static final int JOB_MANAGER_REST_PORT = 8081;
-    private static final String FLINK_PROPERTIES =
-            String.join(
-                    "\n",
-                    Arrays.asList(
-                            "jobmanager.rpc.address: jobmanager",
-                            "taskmanager.numberOfTaskSlots: 9",
-                            "parallelism.default: 3",
-                            "sql-client.execution.result-mode: TABLEAU"));
-
-    // ------------------------------------------------------------------------------------------
-    // Additional Jars
-    // ------------------------------------------------------------------------------------------
     private static final String TABLE_STORE_JAR_NAME = "flink-table-store.jar";
     private static final String BUNDLED_HADOOP_JAR_NAME = "bundled-hadoop.jar";
-
-    protected static final String TEST_DATA_DIR = "/opt/flink/test-data";
-
-    @ClassRule public static final Network NETWORK = Network.newNetwork();
-    private GenericContainer<?> jobManager;
-    protected GenericContainer<?> taskManager;
+    protected static final String TEST_DATA_DIR = "/test-data";
 
     private static final String PRINT_SINK_IDENTIFIER = "table-store-e2e-result";
     private static final int CHECK_RESULT_INTERVAL_MS = 1000;
     private static final int CHECK_RESULT_RETRIES = 60;
     private final List<String> currentResults = new ArrayList<>();
 
+    private DockerComposeContainer<?> environment;
+    private static final Object environmentStartLock = new Object();

Review Comment:
   I'm a little curious as to why checkstyle didn't fail, it looks like the name `environmentStartLock` should be upper here.
   Maybe we can just `synchronized(E2eTestBase.class)`



##########
flink-table-store-e2e-tests/src/test/resources-filtered/docker-compose.yaml:
##########
@@ -0,0 +1,99 @@
+################################################################################
+#  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.
+################################################################################
+
+version: "3"
+
+services:
+
+  # ----------------------------------------
+  # Flink services
+  # ----------------------------------------
+
+  jobmanager:
+    # TODO change image tag to official flink image after 1.15 is released
+    image: tsreaper/flink-test:${flink.version}

Review Comment:
   Can we use flink 1.15.0? I think it has been released.



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org