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
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:
@@ -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:
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user