From 06a30ee853f2eed13d5605ace47c8fcd14c2b2cd Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Tue, 22 Sep 2026 16:07:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=9F=E4=BA=A7=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=95=9C=E5=83=8F=E8=BF=81=E7=A7=BB=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=20(#240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.jiangling.yml | 2 ++ tests/CreatesApplication.php | 1 + .../Unit/Deployment/BusinessMirrorScheduleTest.php | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/compose.jiangling.yml b/compose.jiangling.yml index d7ec45c0..31d22d45 100644 --- a/compose.jiangling.yml +++ b/compose.jiangling.yml @@ -95,6 +95,8 @@ services: condition: service_healthy environment: RUN_MIGRATIONS: ${RUN_MIGRATIONS:-0} + SUPPLIER_PAYABLE_MAINTENANCE_DB_CONNECTION: business_mirror + JST_DB_CONNECTION: business_mirror env_file: - ./runtime/qiniu-storage.env - ./runtime/clickhouse.env diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index b64b210c..a838f7a4 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -40,6 +40,7 @@ trait CreatesApplication config([ 'database.connections.business_mirror' => config('database.connections.sqlite'), 'database.supplier_payable_maintenance_connection' => 'sqlite', + 'jushuitan.connection' => 'business_mirror', 'upstream_mirrors.connection' => 'business_mirror', ]); $app->make(DatabaseManager::class)->purge('business_mirror'); diff --git a/tests/Unit/Deployment/BusinessMirrorScheduleTest.php b/tests/Unit/Deployment/BusinessMirrorScheduleTest.php index bd09eae7..48f7f8ae 100644 --- a/tests/Unit/Deployment/BusinessMirrorScheduleTest.php +++ b/tests/Unit/Deployment/BusinessMirrorScheduleTest.php @@ -92,6 +92,20 @@ class BusinessMirrorScheduleTest extends TestCase } } + public function test_production_supplier_payable_maintenance_uses_the_business_mirror(): void + { + $compose = file_get_contents(dirname(__DIR__, 3) . '/compose.jiangling.yml'); + $start = strpos($compose, " app:\n"); + $end = strpos($compose, "\nvolumes:\n", $start); + $service = substr($compose, $start, $end - $start); + + $this->assertStringContainsString( + 'SUPPLIER_PAYABLE_MAINTENANCE_DB_CONNECTION: business_mirror', + $service, + ); + $this->assertStringContainsString('JST_DB_CONNECTION: business_mirror', $service); + } + public function test_tunnel_task_accepts_both_missing_task_exception_types(): void { $contents = file_get_contents(dirname(__DIR__, 3) . '/scripts/install-upstream-tunnel-task.ps1');