(t *testing.T)
| 5850 | } |
| 5851 | |
| 5852 | func TestCreateBulkTransactionsAsync(t *testing.T) { |
| 5853 | // Skip in short mode |
| 5854 | if testing.Short() { |
| 5855 | t.Skip("Skipping async bulk transaction test in short mode") |
| 5856 | } |
| 5857 | |
| 5858 | ctx := context.Background() |
| 5859 | cnf := &config.Configuration{ |
| 5860 | Redis: config.RedisConfig{ |
| 5861 | Dns: "localhost:6379", |
| 5862 | }, |
| 5863 | DataSource: config.DataSourceConfig{ |
| 5864 | Dns: "postgres://postgres:password@localhost:5432/ledgerforge?sslmode=disable", |
| 5865 | }, |
| 5866 | Queue: config.QueueConfig{ |
| 5867 | WebhookQueue: "webhook_queue_test_bulk_async", |
| 5868 | IndexQueue: "index_queue_test_bulk_async", |
| 5869 | TransactionQueue: "transaction_queue_test_bulk_async", |
| 5870 | NumberOfQueues: 1, |
| 5871 | }, |
| 5872 | Server: config.ServerConfig{ |
| 5873 | SecretKey: "test-secret", |
| 5874 | }, |
| 5875 | Transaction: config.TransactionConfig{ |
| 5876 | BatchSize: 100, |
| 5877 | MaxQueueSize: 1000, |
| 5878 | LockDuration: time.Second * 30, |
| 5879 | IndexQueuePrefix: "test_index", |
| 5880 | }, |
| 5881 | } |
| 5882 | config.ConfigStore.Store(cnf) |
| 5883 | |
| 5884 | ds, err := database.NewDataSource(cnf) |
| 5885 | require.NoError(t, err, "Failed to create datasource") |
| 5886 | |
| 5887 | ledgerforge, err := NewLedgerForge(ds) |
| 5888 | require.NoError(t, err, "Failed to create LedgerForge instance") |
| 5889 | |
| 5890 | // Create test balances |
| 5891 | sourceBalance := &model.Balance{ |
| 5892 | Currency: "USD", |
| 5893 | LedgerID: "general_ledger_id", |
| 5894 | } |
| 5895 | destBalance1 := &model.Balance{ |
| 5896 | Currency: "USD", |
| 5897 | LedgerID: "general_ledger_id", |
| 5898 | } |
| 5899 | destBalance2 := &model.Balance{ |
| 5900 | Currency: "USD", |
| 5901 | LedgerID: "general_ledger_id", |
| 5902 | } |
| 5903 | |
| 5904 | source, err := ds.CreateBalance(*sourceBalance) |
| 5905 | require.NoError(t, err, "Failed to create source balance") |
| 5906 | |
| 5907 | dest1, err := ds.CreateBalance(*destBalance1) |
| 5908 | require.NoError(t, err, "Failed to create destination balance 1") |
| 5909 |
nothing calls this directly
no test coverage detected