(t *testing.T)
| 5408 | } |
| 5409 | |
| 5410 | func TestCreateBulkTransactionsSyncNonAtomic(t *testing.T) { |
| 5411 | // Skip in short mode |
| 5412 | if testing.Short() { |
| 5413 | t.Skip("Skipping bulk transaction test in short mode") |
| 5414 | } |
| 5415 | |
| 5416 | ctx := context.Background() |
| 5417 | cnf := &config.Configuration{ |
| 5418 | Redis: config.RedisConfig{ |
| 5419 | Dns: "localhost:6379", |
| 5420 | }, |
| 5421 | DataSource: config.DataSourceConfig{ |
| 5422 | Dns: "postgres://postgres:password@localhost:5432/ledgerforge?sslmode=disable", |
| 5423 | }, |
| 5424 | Queue: config.QueueConfig{ |
| 5425 | WebhookQueue: "webhook_queue_test_bulk", |
| 5426 | IndexQueue: "index_queue_test_bulk", |
| 5427 | TransactionQueue: "transaction_queue_test_bulk", |
| 5428 | NumberOfQueues: 1, |
| 5429 | }, |
| 5430 | Server: config.ServerConfig{ |
| 5431 | SecretKey: "test-secret", |
| 5432 | }, |
| 5433 | Transaction: config.TransactionConfig{ |
| 5434 | BatchSize: 100, |
| 5435 | MaxQueueSize: 1000, |
| 5436 | LockDuration: time.Second * 30, |
| 5437 | IndexQueuePrefix: "test_index", |
| 5438 | }, |
| 5439 | } |
| 5440 | config.ConfigStore.Store(cnf) |
| 5441 | |
| 5442 | ds, err := database.NewDataSource(cnf) |
| 5443 | require.NoError(t, err, "Failed to create datasource") |
| 5444 | |
| 5445 | ledgerforge, err := NewLedgerForge(ds) |
| 5446 | require.NoError(t, err, "Failed to create LedgerForge instance") |
| 5447 | |
| 5448 | // Create test balances |
| 5449 | sourceBalance := &model.Balance{ |
| 5450 | Currency: "USD", |
| 5451 | LedgerID: "general_ledger_id", |
| 5452 | } |
| 5453 | destBalance1 := &model.Balance{ |
| 5454 | Currency: "USD", |
| 5455 | LedgerID: "general_ledger_id", |
| 5456 | } |
| 5457 | destBalance2 := &model.Balance{ |
| 5458 | Currency: "USD", |
| 5459 | LedgerID: "general_ledger_id", |
| 5460 | } |
| 5461 | |
| 5462 | source, err := ds.CreateBalance(*sourceBalance) |
| 5463 | require.NoError(t, err, "Failed to create source balance") |
| 5464 | |
| 5465 | dest1, err := ds.CreateBalance(*destBalance1) |
| 5466 | require.NoError(t, err, "Failed to create destination balance 1") |
| 5467 |
nothing calls this directly
no test coverage detected