This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 191c42ea6bd Add it-transaction.yaml (#19442)
191c42ea6bd is described below
commit 191c42ea6bd898c6514c1d977d9bd4958e7f1aed
Author: JingShang Lu <[email protected]>
AuthorDate: Sat Jul 23 13:34:31 2022 +0800
Add it-transaction.yaml (#19442)
* add .github/workflows/it-transaction.yml
---
.github/workflows/it-transaction.yml | 65 ++++++++++++++++++++++
.../proxy/ShardingSphereProxyDockerContainer.java | 2 +-
.../resources/env/transaction-it-env.properties | 6 +-
.../{env/logback.xml => logback-test.xml} | 11 ++--
4 files changed, 73 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/it-transaction.yml
b/.github/workflows/it-transaction.yml
new file mode 100644
index 00000000000..27813ba95e2
--- /dev/null
+++ b/.github/workflows/it-transaction.yml
@@ -0,0 +1,65 @@
+#
+# 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.
+#
+
+name: Transaction Integration Test
+
+on:
+ push:
+ branches: [ master, dev ]
+
+ pull_request:
+ branches: [ master ]
+ paths:
+ - '!examples/**'
+ - '!shardingsphere-test/**'
+ - 'shardingsphere-test/shardingsphere-integration-test/**'
+ -
'!shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/**'
+ - '!*.md'
+
+concurrency:
+ group: it-transaction-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true
-Drat.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true
-Djacoco.skip=true -Dfailsafe.skipAfterFailureCount=1
-Dio.netty.leakDetectionLevel=advanced
+
+jobs:
+ transaction-it-test:
+ name: transaction-it-test
+ runs-on: ubuntu-latest
+ env:
+ postgresql_version: postgres:12-alpine
+ mysql_version: 5.7
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@v3
+ - name: Cache Maven Repos
+ uses: actions/cache@v3
+ with:
+ path: ~/.m2/repository
+ key: shardingsphere-it-cache-${{ github.sha }}
+ - name: Set up JDK 8
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'temurin'
+ java-version: 8
+ - name: Build Transaction IT image
+ run: ./mvnw -B clean install -am -pl
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction
-Pit.env.docker -DskipTests
+ - name: Run Transaction MySQL Integration Test
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.docker.mysql.version=${{
env.mysql_version }}
+ - name: Run Transaction PostgreSQL Integration Test
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
index 16cd27edd07..ce5ec0c5cd6 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
@@ -55,7 +55,7 @@ public final class ShardingSphereProxyDockerContainer extends
DockerITContainer
private void mapConfigurationFiles() {
withClasspathResourceMapping(String.format("/env/%s/server.yaml",
databaseType.getType().toLowerCase()),
"/opt/shardingsphere-proxy/conf/server.yaml", BindMode.READ_ONLY);
- withClasspathResourceMapping("/env/logback.xml",
"/opt/shardingsphere-proxy/conf/logback.xml", BindMode.READ_ONLY);
+ withClasspathResourceMapping("/logback-test.xml",
"/opt/shardingsphere-proxy/conf/logback-test.xml", BindMode.READ_ONLY);
if (TransactionITEnvTypeEnum.NATIVE ==
IntegrationTestEnvironment.getInstance().getItEnvType()) {
addFixedExposedPort(3307, 3307);
addFixedExposedPort(5005, 3308);
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
index c95d599f28c..95fd5c72945 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
@@ -17,11 +17,11 @@
# transaction.it.type=DOCKER,NATIVE
transaction.it.env.type=
# transaction.it.env.cases= MySQLAutoCommitTestCase,
PostgresSQLAutoCommitTestCase, ClassicTransferTestCase,
MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase,
MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, PostgreSQLSavePointTestCase
-transaction.it.env.cases=PostgresSQLAutoCommitTestCase,
ClassicTransferTestCase, MultiTableCommitAndRollbackTestCase,
SingleTableCommitAndRollbackTestCase, MySQLSetReadOnlyTestCase,
MySQLSavePointTestCase, PostgreSQLSavePointTestCase
+transaction.it.env.cases=PostgresSQLAutoCommitTestCase,
MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase,
MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, PostgreSQLSavePointTestCase
# transaction.it.docker.mysql.version=5.7,8.0
-transaction.it.docker.mysql.version=5.7
+transaction.it.docker.mysql.version=
#
transaction.it.docker.postgresql.version=postgres:10-alpine,postgres:11-alpine,postgres:12-alpine,postgres:13-alpine,postgres:14-alpine
-transaction.it.docker.postgresql.version=postgres:10-alpine
+transaction.it.docker.postgresql.version=
#
transaction.it.docker.opengauss.version=enmotech/opengauss:3.0.0,enmotech/opengauss:2.1.0
transaction.it.docker.opengauss.version=
# transaction.it.native.database=mysql or postgresql or opengauss
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/logback.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/logback-test.xml
similarity index 80%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/logback.xml
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/logback-test.xml
index b7dce6d0c6a..898bedb2c5e 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/logback.xml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/logback-test.xml
@@ -22,15 +22,12 @@
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread]
%logger{36} - %msg%n</pattern>
</encoder>
</appender>
- <logger name="org.apache.shardingsphere.mode" level="INFO"
additivity="false">
- <appender-ref ref="console" />
- </logger>
- <logger name="org.apache.shardingsphere.driver" level="INFO"
additivity="false">
- <appender-ref ref="console" />
- </logger>
+ <logger
name="org.apache.shardingsphere.test.integration.env.container.atomic.DockerITContainer"
level="WARN" />
<logger name="com.zaxxer.hikari.pool.ProxyConnection" level="OFF" />
+ <logger name="org.testcontainers" level="INFO"/>
+ <logger name="com.github.dockerjava" level="WARN"/>
<root>
- <level value="WARN" />
+ <level value="INFO" />
<appender-ref ref="console" />
</root>
</configuration>