From 05391ce12295190aabcf64f9a6075b0c5a7e517a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E4=BA=91=E9=87=91YunjinXu?= Date: Tue, 24 Dec 2024 17:42:18 +0800 Subject: [PATCH] ci: allow empty MySQL password MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 老大哥go那边的测试mysql的密码是空的,本地频繁项目的集成伤神,调整成跟go那边一样。 --- .github/workflows/build_and_it.yml | 6 +++--- samples/DtmOnDaprSample/appsettings.docker.json | 2 +- samples/DtmSample/appsettings.docker.json | 2 +- tests/BusiGrpcService/Services/BusiApiService.cs | 2 +- tests/Dtmgrpc.IntegrationTests/MsgGrpcTest.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_it.yml b/.github/workflows/build_and_it.yml index e9d8bd6..e846513 100644 --- a/.github/workflows/build_and_it.yml +++ b/.github/workflows/build_and_it.yml @@ -24,7 +24,7 @@ jobs: --health-interval=10s --health-timeout=5s --health-retries=3 - -e MYSQL_ROOT_PASSWORD=123456 + -e MYSQL_ALLOW_EMPTY_PASSWORD=1 --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" strategy: matrix: @@ -43,8 +43,8 @@ jobs: dotnet --list-runtimes - name: Create database run: | - mysql -h127.0.0.1 -uroot -p123456 < /home/runner/work/client-csharp/client-csharp/sqls/barrier.mysql.sql - mysql -h127.0.0.1 -uroot -p123456 < /home/runner/work/client-csharp/client-csharp/sqls/busi.mysql.sql + mysql -h127.0.0.1 -uroot < /home/runner/work/client-csharp/client-csharp/sqls/barrier.mysql.sql + mysql -h127.0.0.1 -uroot < /home/runner/work/client-csharp/client-csharp/sqls/busi.mysql.sql - name: Setup DTM server run: | wget https://github.com/dtm-labs/dtm/releases/download/v1.18.0/dtm_1.18.0_linux_amd64.tar.gz diff --git a/samples/DtmOnDaprSample/appsettings.docker.json b/samples/DtmOnDaprSample/appsettings.docker.json index 03fe741..fdde146 100644 --- a/samples/DtmOnDaprSample/appsettings.docker.json +++ b/samples/DtmOnDaprSample/appsettings.docker.json @@ -12,7 +12,7 @@ "AppSettings": { "DtmUrl": "http://dtm:36789", "BusiUrl": "http://sample:9090/api", - "BarrierConn": "Server=db;port=3306;User ID=root;Password=123456;Database=dtm_barrier", + "BarrierConn": "Server=db;port=3306;User ID=root;Password=;Database=dtm_barrier", "MongoBarrierConn": "mongodb://mgdb:27017" } } diff --git a/samples/DtmSample/appsettings.docker.json b/samples/DtmSample/appsettings.docker.json index 7bfaafb..189fc12 100644 --- a/samples/DtmSample/appsettings.docker.json +++ b/samples/DtmSample/appsettings.docker.json @@ -13,7 +13,7 @@ "DtmUrl": "http://dtm:36789", "DtmGrpcUrl": "http://dtm:36790", "BusiUrl": "http://sample:9090/api", - "BarrierConn": "Server=db;port=3306;User ID=root;Password=123456;Database=dtm_barrier", + "BarrierConn": "Server=db;port=3306;User ID=root;Password=;Database=dtm_barrier", "MongoBarrierConn": "mongodb://mgdb:27017" } } diff --git a/tests/BusiGrpcService/Services/BusiApiService.cs b/tests/BusiGrpcService/Services/BusiApiService.cs index 34d2f1e..a8f1370 100644 --- a/tests/BusiGrpcService/Services/BusiApiService.cs +++ b/tests/BusiGrpcService/Services/BusiApiService.cs @@ -279,7 +279,7 @@ await barrier.Call(conn, async (tx) => return new Empty(); } - private MySqlConnection GetBarrierConn() => new("Server=localhost;port=3306;User ID=root;Password=123456;Database=dtm_barrier"); + private MySqlConnection GetBarrierConn() => new("Server=localhost;port=3306;User ID=root;Password=;Database=dtm_barrier"); private async Task GetRedis() { diff --git a/tests/Dtmgrpc.IntegrationTests/MsgGrpcTest.cs b/tests/Dtmgrpc.IntegrationTests/MsgGrpcTest.cs index d19ae00..ddd4d88 100644 --- a/tests/Dtmgrpc.IntegrationTests/MsgGrpcTest.cs +++ b/tests/Dtmgrpc.IntegrationTests/MsgGrpcTest.cs @@ -111,7 +111,7 @@ await branchBarrier.Call(conn, () => private static readonly int TransInUID = 2; - private MySqlConnection getBarrierMySqlConnection() => new("Server=localhost;port=3306;User ID=root;Password=123456;Database=dtm_barrier"); + private MySqlConnection getBarrierMySqlConnection() => new("Server=localhost;port=3306;User ID=root;Password=;Database=dtm_barrier"); private async Task LocalAdjustBalance(DbConnection conn, int uid, long amount, string result) {