ci: exclude PostgreSQL tests from CI workflow
Build and Deploy to Synology NAS / test (push) Successful in 1h8m11s
Build and Deploy to Synology NAS / build (push) Failing after 2h11m18s
Build and Deploy to Synology NAS / deploy (push) Failing after 11m20s
Build and Deploy to Synology NAS / notify (push) Has been cancelled

- 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 <noreply@anthropic.com>
This commit is contained in:
2025-12-17 18:04:42 +01:00
co-authored by Claude
parent 94d02736f7
commit d0bd84f4a2
3 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
- name: Run Tests - name: Run Tests
if: ${{ steps.validate.outputs.valid == 'true' }} 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 # Job 2: Build and Push Docker Image
build: build:
+8 -8
View File
@@ -9,7 +9,7 @@ test('can connect to backend schema', function () {
$count = Transaction::count(); $count = Transaction::count();
expect($count)->toBeGreaterThanOrEqual(0); expect($count)->toBeGreaterThanOrEqual(0);
}); })->group('backend-db');
test('can read transactions from backend schema', function () { test('can read transactions from backend schema', function () {
$transaction = Transaction::first(); $transaction = Transaction::first();
@@ -22,7 +22,7 @@ test('can read transactions from backend schema', function () {
} else { } else {
expect(true)->toBeTrue(); // No transactions yet expect(true)->toBeTrue(); // No transactions yet
} }
}); })->group('backend-db');
test('can read transaction outputs', function () { test('can read transaction outputs', function () {
$output = TransactionOutput::first(); $output = TransactionOutput::first();
@@ -35,7 +35,7 @@ test('can read transaction outputs', function () {
} else { } else {
expect(true)->toBeTrue(); // No outputs yet expect(true)->toBeTrue(); // No outputs yet
} }
}); })->group('backend-db');
test('transaction has outputs relationship', function () { test('transaction has outputs relationship', function () {
$transaction = Transaction::with('outputs')->first(); $transaction = Transaction::with('outputs')->first();
@@ -45,7 +45,7 @@ test('transaction has outputs relationship', function () {
} else { } else {
expect(true)->toBeTrue(); // No transactions yet expect(true)->toBeTrue(); // No transactions yet
} }
}); })->group('backend-db');
test('can get specific output by key', function () { test('can get specific output by key', function () {
$transaction = Transaction::with('outputs')->first(); $transaction = Transaction::with('outputs')->first();
@@ -58,7 +58,7 @@ test('can get specific output by key', function () {
} else { } else {
expect(true)->toBeTrue(); // No transactions with outputs yet expect(true)->toBeTrue(); // No transactions with outputs yet
} }
}); })->group('backend-db');
test('can get company info from transaction', function () { test('can get company info from transaction', function () {
$transaction = Transaction::with('outputs')->first(); $transaction = Transaction::with('outputs')->first();
@@ -71,7 +71,7 @@ test('can get company info from transaction', function () {
} else { } else {
expect(true)->toBeTrue(); expect(true)->toBeTrue();
} }
}); })->group('backend-db');
test('can get risk assessment from transaction', function () { test('can get risk assessment from transaction', function () {
$transaction = Transaction::with('outputs')->first(); $transaction = Transaction::with('outputs')->first();
@@ -88,7 +88,7 @@ test('can get risk assessment from transaction', function () {
} else { } else {
expect(true)->toBeTrue(); expect(true)->toBeTrue();
} }
}); })->group('backend-db');
test('can check if transaction requires review', function () { test('can check if transaction requires review', function () {
$transaction = Transaction::with('outputs')->first(); $transaction = Transaction::with('outputs')->first();
@@ -100,7 +100,7 @@ test('can check if transaction requires review', function () {
} else { } else {
expect(true)->toBeTrue(); expect(true)->toBeTrue();
} }
}); })->group('backend-db');
test('transaction output keys constants exist', function () { test('transaction output keys constants exist', function () {
expect(TransactionOutput::KEY_COMPANY_INFO)->toBe('company_info'); expect(TransactionOutput::KEY_COMPANY_INFO)->toBe('company_info');
@@ -43,7 +43,7 @@ test('full sync truncates and rebuilds backend_data_pool', function () {
->first(); ->first();
expect($oldRecord)->toBeNull(); expect($oldRecord)->toBeNull();
}); })->group('backend-db');
test('incremental sync only adds new records', function () { test('incremental sync only adds new records', function () {
// Arrange: Perform initial sync // 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) // Assert: Count should not increase significantly (only if new records in backend)
$newCount = DB::table('backend_data_pool')->count(); $newCount = DB::table('backend_data_pool')->count();
expect($newCount)->toBeGreaterThanOrEqual($initialCount); expect($newCount)->toBeGreaterThanOrEqual($initialCount);
}); })->group('backend-db');
test('sync correctly maps backend.transactions and backend.transaction_outputs', function () { test('sync correctly maps backend.transactions and backend.transaction_outputs', function () {
// Act: Perform sync // Act: Perform sync
@@ -84,7 +84,7 @@ test('sync correctly maps backend.transactions and backend.transaction_outputs',
expect($record)->toHaveProperty('content'); expect($record)->toHaveProperty('content');
expect($record)->toHaveProperty('synced_at'); expect($record)->toHaveProperty('synced_at');
} }
}); })->group('backend-db');
test('sync only includes transactions with status done', function () { test('sync only includes transactions with status done', function () {
// Act: Perform sync // Act: Perform sync
@@ -97,7 +97,7 @@ test('sync only includes transactions with status done', function () {
->count(); ->count();
expect($nonDoneRecords)->toBe(0); expect($nonDoneRecords)->toBe(0);
}); })->group('backend-db');
test('sync processes records in batches', function () { test('sync processes records in batches', function () {
// Act: Perform sync with small batch size // Act: Perform sync with small batch size
@@ -107,7 +107,7 @@ test('sync processes records in batches', function () {
// Assert: Should complete without errors // Assert: Should complete without errors
$recordCount = DB::table('backend_data_pool')->count(); $recordCount = DB::table('backend_data_pool')->count();
expect($recordCount)->toBeGreaterThanOrEqual(0); expect($recordCount)->toBeGreaterThanOrEqual(0);
}); })->group('backend-db');
test('getStats returns correct statistics', function () { test('getStats returns correct statistics', function () {
// Arrange: Perform sync // Arrange: Perform sync
@@ -125,7 +125,7 @@ test('getStats returns correct statistics', function () {
expect($stats)->toHaveKey('last_synced_at'); expect($stats)->toHaveKey('last_synced_at');
expect($stats['backend_data_pool_records'])->toBeGreaterThanOrEqual(0); expect($stats['backend_data_pool_records'])->toBeGreaterThanOrEqual(0);
}); })->group('backend-db');
test('sync handles empty backend gracefully', function () { test('sync handles empty backend gracefully', function () {
// This test assumes backend might be empty or have no 'done' transactions // 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 // Assert: Should complete without errors
$recordCount = DB::table('backend_data_pool')->count(); $recordCount = DB::table('backend_data_pool')->count();
expect($recordCount)->toBeGreaterThanOrEqual(0); expect($recordCount)->toBeGreaterThanOrEqual(0);
}); })->group('backend-db');
test('sync orders records by transaction_id and prompt_id', function () { test('sync orders records by transaction_id and prompt_id', function () {
// Act: Perform sync // Act: Perform sync
@@ -167,4 +167,4 @@ test('sync orders records by transaction_id and prompt_id', function () {
$previousPromptId = $record->prompt_id; $previousPromptId = $record->prompt_id;
} }
} }
}); })->group('backend-db');