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');