This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new fb304498e76 Add PipelineE2ECondition (#24625)
fb304498e76 is described below

commit fb304498e76c98a6a493befb71c9a781663cd4f6
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Mar 15 20:37:08 2023 +0800

    Add PipelineE2ECondition (#24625)
---
 .../data/pipeline/cases/PipelineE2ECondition.java  | 46 ++++++++++++++++++++++
 .../test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java |  4 +-
 .../createtable/CreateTableSQLGeneratorIT.java     | 12 +++---
 .../general/MySQLMigrationGeneralE2EIT.java        |  4 +-
 .../general/PostgreSQLMigrationGeneralE2EIT.java   |  8 ++--
 .../migration/general/RulesMigrationE2EIT.java     |  4 +-
 .../primarykey/IndexesMigrationE2EIT.java          |  6 +--
 .../primarykey/MariaDBMigrationE2EIT.java          |  4 +-
 .../primarykey/TextPrimaryKeyMigrationE2EIT.java   |  7 +---
 9 files changed, 66 insertions(+), 29 deletions(-)

diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineE2ECondition.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineE2ECondition.java
new file mode 100644
index 00000000000..73120babd1e
--- /dev/null
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/PipelineE2ECondition.java
@@ -0,0 +1,46 @@
+/*
+ * 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.shardingsphere.test.e2e.data.pipeline.cases;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
+
+import java.util.Arrays;
+
+/**
+ * Pipeline E2E condition.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PipelineE2ECondition {
+    
+    /**
+     * Judge whether pipeline E2E is enabled.
+     * 
+     * @param databaseTypes database types
+     * @return enabled or not
+     */
+    public static boolean isEnabled(final DatabaseType... databaseTypes) {
+        if (PipelineEnvTypeEnum.NONE == 
PipelineE2EEnvironment.getInstance().getItEnvType()) {
+            return false;
+        }
+        return 0 == databaseTypes.length || 
Arrays.stream(databaseTypes).anyMatch(each -> 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(each).isEmpty());
+    }
+}
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java
index c375ef0fb1b..4935de1de36 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/CDCE2EIT.java
@@ -40,9 +40,9 @@ import 
org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
 import 
org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.task.E2EIncrementalTask;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.util.DataSourceExecuteUtil;
@@ -198,7 +198,7 @@ public final class CDCE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType();
+        return PipelineE2ECondition.isEnabled();
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java
index b878e009b1a..b7efcfd1703 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java
@@ -23,11 +23,11 @@ import 
org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
 import 
org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseType;
 import 
org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.entity.CreateTableSQLGeneratorAssertionEntity;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.entity.CreateTableSQLGeneratorAssertionsRootEntity;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.entity.CreateTableSQLGeneratorOutputEntity;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.util.DockerImageVersion;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.storage.DockerStorageContainer;
@@ -78,8 +78,6 @@ public final class CreateTableSQLGeneratorIT {
     
     private static final Pattern REPLACE_LINE_SPACE = 
Pattern.compile("\\s*|\t|\r|\n");
     
-    private static final PipelineE2EEnvironment ENV = 
PipelineE2EEnvironment.getInstance();
-    
     private DockerStorageContainer storageContainer;
     
     @AfterEach
@@ -144,7 +142,7 @@ public final class CreateTableSQLGeneratorIT {
     }
     
     private static boolean isEnabled() {
-        return ENV.getItEnvType() != PipelineEnvTypeEnum.NONE && 
(!ENV.getMysqlVersions().isEmpty() || !ENV.getPostgresqlVersions().isEmpty() || 
!ENV.getOpenGaussVersions().isEmpty());
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType(), new 
PostgreSQLDatabaseType(), new OpenGaussDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
@@ -152,13 +150,13 @@ public final class CreateTableSQLGeneratorIT {
         @Override
         public Stream<? extends Arguments> provideArguments(final 
ExtensionContext extensionContext) {
             Collection<PipelineTestParameter> result = new LinkedList<>();
-            for (String each : ENV.getMysqlVersions()) {
+            for (String each : 
PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType())) {
                 result.add(new PipelineTestParameter(new MySQLDatabaseType(), 
each, String.join("/", PARENT_PATH, MYSQL_CASE_FILE_PATH)));
             }
-            for (String each : ENV.getPostgresqlVersions()) {
+            for (String each : 
PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
PostgreSQLDatabaseType())) {
                 result.add(new PipelineTestParameter(new 
PostgreSQLDatabaseType(), each, String.join("/", PARENT_PATH, 
POSTGRES_CASE_FILE_PATH)));
             }
-            for (String each : ENV.getOpenGaussVersions()) {
+            for (String each : 
PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
OpenGaussDatabaseType())) {
                 result.add(new PipelineTestParameter(new 
OpenGaussDatabaseType(), each, String.join("/", PARENT_PATH, 
OPEN_GAUSS_CASE_FILE_PATH)));
             }
             return result.stream().map(Arguments::of);
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java
index 61d9663d5f3..b95fddfc186 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/MySQLMigrationGeneralE2EIT.java
@@ -24,10 +24,10 @@ import 
org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobTy
 import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.task.E2EIncrementalTask;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.util.DataSourceExecuteUtil;
@@ -107,7 +107,7 @@ public final class MySQLMigrationGeneralE2EIT extends 
AbstractMigrationE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType() && 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType()).isEmpty();
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java
index e9f4b5a60f8..5a88515b90f 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/PostgreSQLMigrationGeneralE2EIT.java
@@ -24,10 +24,10 @@ import 
org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseTy
 import 
org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.task.E2EIncrementalTask;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.util.DataSourceExecuteUtil;
@@ -55,7 +55,7 @@ public final class PostgreSQLMigrationGeneralE2EIT extends 
AbstractMigrationE2EI
     private static final String SOURCE_TABLE_NAME = "t_order_copy";
     
     private static final String TARGET_TABLE_NAME = "t_order";
-        
+    
     @ParameterizedTest(name = "{0}")
     @EnabledIf("isEnabled")
     @ArgumentsSource(TestCaseArgumentsProvider.class)
@@ -116,9 +116,7 @@ public final class PostgreSQLMigrationGeneralE2EIT extends 
AbstractMigrationE2EI
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType()
-                && 
(!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
PostgreSQLDatabaseType()).isEmpty()
-                || 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
OpenGaussDatabaseType()).isEmpty());
+        return PipelineE2ECondition.isEnabled(new PostgreSQLDatabaseType(), 
new OpenGaussDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java
index 02939ab4967..05f9ea88ae7 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/general/RulesMigrationE2EIT.java
@@ -21,9 +21,9 @@ import 
org.apache.shardingsphere.data.pipeline.scenario.migration.MigrationJobTy
 import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import org.junit.jupiter.api.condition.EnabledIf;
@@ -94,7 +94,7 @@ public final class RulesMigrationE2EIT extends 
AbstractMigrationE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType() && 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType()).isEmpty();
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java
index 7076afdc448..7c0f1311aab 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/IndexesMigrationE2EIT.java
@@ -25,9 +25,9 @@ import 
org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateA
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm;
 import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import org.junit.jupiter.api.condition.EnabledIf;
@@ -204,9 +204,7 @@ public final class IndexesMigrationE2EIT extends 
AbstractMigrationE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType()
-                && 
(!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType()).isEmpty()
-                || 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
PostgreSQLDatabaseType()).isEmpty());
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType(), new 
PostgreSQLDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java
index 35bf66cd1c6..d716a245b70 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/MariaDBMigrationE2EIT.java
@@ -23,9 +23,9 @@ import 
org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm;
 import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import org.junit.jupiter.api.condition.EnabledIf;
@@ -82,7 +82,7 @@ public final class MariaDBMigrationE2EIT extends 
AbstractMigrationE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType() && 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType()).isEmpty();
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {
diff --git 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java
 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java
index 6030c172822..7137b242b61 100644
--- 
a/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java
+++ 
b/test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationE2EIT.java
@@ -23,9 +23,9 @@ import 
org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseTy
 import 
org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
 import 
org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineContainerComposer;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.PipelineE2ECondition;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.PipelineE2EEnvironment;
-import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
 import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
 import 
org.apache.shardingsphere.test.e2e.env.container.atomic.util.DatabaseTypeUtil;
@@ -80,10 +80,7 @@ public class TextPrimaryKeyMigrationE2EIT extends 
AbstractMigrationE2EIT {
     }
     
     private static boolean isEnabled() {
-        return PipelineEnvTypeEnum.NONE != 
PipelineE2EEnvironment.getInstance().getItEnvType()
-                && 
(!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
MySQLDatabaseType()).isEmpty()
-                || 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
PostgreSQLDatabaseType()).isEmpty()
-                || 
!PipelineE2EEnvironment.getInstance().listStorageContainerImages(new 
OpenGaussDatabaseType()).isEmpty());
+        return PipelineE2ECondition.isEnabled(new MySQLDatabaseType(), new 
PostgreSQLDatabaseType(), new OpenGaussDatabaseType());
     }
     
     private static class TestCaseArgumentsProvider implements 
ArgumentsProvider {

Reply via email to