From d0bd84f4a2a28ad02471b3f663760e368644ef75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Fr=C3=B6hlich?= Date: Wed, 17 Dec 2025 18:04:42 +0100 Subject: [PATCH] ci: exclude PostgreSQL tests from CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added --exclude-group=backend-db flag to test command in Gitea workflow - Marked all PostgreSQL-dependent tests with ->group('backend-db') - Tests in BackendModelsTest.php (8 tests) now excluded from CI - Tests in SyncBackendDataPoolTest.php (8 tests) now excluded from CI - These tests still run locally where PostgreSQL backend is available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitea/workflows/deploy-synology.yml | 2 +- tests/Feature/BackendModelsTest.php | 16 ++++++++-------- tests/Feature/Jobs/SyncBackendDataPoolTest.php | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/deploy-synology.yml b/.gitea/workflows/deploy-synology.yml index 2725e8f..e48b285 100644 --- a/.gitea/workflows/deploy-synology.yml +++ b/.gitea/workflows/deploy-synology.yml @@ -63,7 +63,7 @@ jobs: - name: Run Tests if: ${{ steps.validate.outputs.valid == 'true' }} - run: php artisan test + run: php artisan test --exclude-group=backend-db # Job 2: Build and Push Docker Image build: diff --git a/tests/Feature/BackendModelsTest.php b/tests/Feature/BackendModelsTest.php index d51293a..41950d0 100644 --- a/tests/Feature/BackendModelsTest.php +++ b/tests/Feature/BackendModelsTest.php @@ -9,7 +9,7 @@ test('can connect to backend schema', function () { $count = Transaction::count(); expect($count)->toBeGreaterThanOrEqual(0); -}); +})->group('backend-db'); test('can read transactions from backend schema', function () { $transaction = Transaction::first(); @@ -22,7 +22,7 @@ test('can read transactions from backend schema', function () { } else { expect(true)->toBeTrue(); // No transactions yet } -}); +})->group('backend-db'); test('can read transaction outputs', function () { $output = TransactionOutput::first(); @@ -35,7 +35,7 @@ test('can read transaction outputs', function () { } else { expect(true)->toBeTrue(); // No outputs yet } -}); +})->group('backend-db'); test('transaction has outputs relationship', function () { $transaction = Transaction::with('outputs')->first(); @@ -45,7 +45,7 @@ test('transaction has outputs relationship', function () { } else { expect(true)->toBeTrue(); // No transactions yet } -}); +})->group('backend-db'); test('can get specific output by key', function () { $transaction = Transaction::with('outputs')->first(); @@ -58,7 +58,7 @@ test('can get specific output by key', function () { } else { expect(true)->toBeTrue(); // No transactions with outputs yet } -}); +})->group('backend-db'); test('can get company info from transaction', function () { $transaction = Transaction::with('outputs')->first(); @@ -71,7 +71,7 @@ test('can get company info from transaction', function () { } else { expect(true)->toBeTrue(); } -}); +})->group('backend-db'); test('can get risk assessment from transaction', function () { $transaction = Transaction::with('outputs')->first(); @@ -88,7 +88,7 @@ test('can get risk assessment from transaction', function () { } else { expect(true)->toBeTrue(); } -}); +})->group('backend-db'); test('can check if transaction requires review', function () { $transaction = Transaction::with('outputs')->first(); @@ -100,7 +100,7 @@ test('can check if transaction requires review', function () { } else { expect(true)->toBeTrue(); } -}); +})->group('backend-db'); test('transaction output keys constants exist', function () { expect(TransactionOutput::KEY_COMPANY_INFO)->toBe('company_info'); diff --git a/tests/Feature/Jobs/SyncBackendDataPoolTest.php b/tests/Feature/Jobs/SyncBackendDataPoolTest.php index 7a9eaba..dfa0dc6 100644 --- a/tests/Feature/Jobs/SyncBackendDataPoolTest.php +++ b/tests/Feature/Jobs/SyncBackendDataPoolTest.php @@ -43,7 +43,7 @@ test('full sync truncates and rebuilds backend_data_pool', function () { ->first(); expect($oldRecord)->toBeNull(); -}); +})->group('backend-db'); test('incremental sync only adds new records', function () { // Arrange: Perform initial sync @@ -62,7 +62,7 @@ test('incremental sync only adds new records', function () { // Assert: Count should not increase significantly (only if new records in backend) $newCount = DB::table('backend_data_pool')->count(); expect($newCount)->toBeGreaterThanOrEqual($initialCount); -}); +})->group('backend-db'); test('sync correctly maps backend.transactions and backend.transaction_outputs', function () { // Act: Perform sync @@ -84,7 +84,7 @@ test('sync correctly maps backend.transactions and backend.transaction_outputs', expect($record)->toHaveProperty('content'); expect($record)->toHaveProperty('synced_at'); } -}); +})->group('backend-db'); test('sync only includes transactions with status done', function () { // Act: Perform sync @@ -97,7 +97,7 @@ test('sync only includes transactions with status done', function () { ->count(); expect($nonDoneRecords)->toBe(0); -}); +})->group('backend-db'); test('sync processes records in batches', function () { // Act: Perform sync with small batch size @@ -107,7 +107,7 @@ test('sync processes records in batches', function () { // Assert: Should complete without errors $recordCount = DB::table('backend_data_pool')->count(); expect($recordCount)->toBeGreaterThanOrEqual(0); -}); +})->group('backend-db'); test('getStats returns correct statistics', function () { // Arrange: Perform sync @@ -125,7 +125,7 @@ test('getStats returns correct statistics', function () { expect($stats)->toHaveKey('last_synced_at'); expect($stats['backend_data_pool_records'])->toBeGreaterThanOrEqual(0); -}); +})->group('backend-db'); test('sync handles empty backend gracefully', function () { // This test assumes backend might be empty or have no 'done' transactions @@ -137,7 +137,7 @@ test('sync handles empty backend gracefully', function () { // Assert: Should complete without errors $recordCount = DB::table('backend_data_pool')->count(); expect($recordCount)->toBeGreaterThanOrEqual(0); -}); +})->group('backend-db'); test('sync orders records by transaction_id and prompt_id', function () { // Act: Perform sync @@ -167,4 +167,4 @@ test('sync orders records by transaction_id and prompt_id', function () { $previousPromptId = $record->prompt_id; } } -}); +})->group('backend-db');