Skip to content

Commit c922bc3

Browse files
committed
paymentsdb: test all db agnostic tests for all backends
We now test every test in the payment_test.go file against all databases.
1 parent f7523af commit c922bc3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

payments/db/payment_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func TestDeleteFailedAttempts(t *testing.T) {
446446
// testDeleteFailedAttempts tests the DeleteFailedAttempts method with the
447447
// given keepFailedPaymentAttempts flag as argument.
448448
func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
449-
paymentDB := NewKVTestDB(
449+
paymentDB := NewTestDB(
450450
t, WithKeepFailedPaymentAttempts(keepFailedPaymentAttempts),
451451
)
452452

@@ -537,7 +537,7 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
537537
func TestMPPRecordValidation(t *testing.T) {
538538
t.Parallel()
539539

540-
paymentDB := NewKVTestDB(t)
540+
paymentDB := NewTestDB(t)
541541

542542
preimg, err := genPreimage(t)
543543
require.NoError(t, err)
@@ -638,7 +638,7 @@ func TestMPPRecordValidation(t *testing.T) {
638638
func TestDeleteSinglePayment(t *testing.T) {
639639
t.Parallel()
640640

641-
paymentDB := NewKVTestDB(t)
641+
paymentDB := NewTestDB(t)
642642

643643
// Register four payments:
644644
// All payments will have one failed HTLC attempt and one HTLC attempt
@@ -1283,7 +1283,7 @@ func TestEmptyRoutesGenerateSphinxPacket(t *testing.T) {
12831283
func TestSuccessesWithoutInFlight(t *testing.T) {
12841284
t.Parallel()
12851285

1286-
paymentDB := NewKVTestDB(t)
1286+
paymentDB := NewTestDB(t)
12871287

12881288
preimg, err := genPreimage(t)
12891289
require.NoError(t, err)
@@ -1306,7 +1306,7 @@ func TestSuccessesWithoutInFlight(t *testing.T) {
13061306
func TestFailsWithoutInFlight(t *testing.T) {
13071307
t.Parallel()
13081308

1309-
paymentDB := NewKVTestDB(t)
1309+
paymentDB := NewTestDB(t)
13101310

13111311
preimg, err := genPreimage(t)
13121312
require.NoError(t, err)
@@ -1326,7 +1326,7 @@ func TestFailsWithoutInFlight(t *testing.T) {
13261326
func TestDeletePayments(t *testing.T) {
13271327
t.Parallel()
13281328

1329-
paymentDB := NewKVTestDB(t)
1329+
paymentDB := NewTestDB(t)
13301330

13311331
// Register three payments:
13321332
// 1. A payment with two failed attempts.
@@ -1384,7 +1384,7 @@ func TestDeletePayments(t *testing.T) {
13841384
func TestSwitchDoubleSend(t *testing.T) {
13851385
t.Parallel()
13861386

1387-
paymentDB := NewKVTestDB(t)
1387+
paymentDB := NewTestDB(t)
13881388

13891389
preimg, err := genPreimage(t)
13901390
require.NoError(t, err)
@@ -1462,7 +1462,7 @@ func TestSwitchDoubleSend(t *testing.T) {
14621462
func TestSwitchFail(t *testing.T) {
14631463
t.Parallel()
14641464

1465-
paymentDB := NewKVTestDB(t)
1465+
paymentDB := NewTestDB(t)
14661466

14671467
preimg, err := genPreimage(t)
14681468
require.NoError(t, err)
@@ -1628,7 +1628,7 @@ func TestMultiShard(t *testing.T) {
16281628
}
16291629

16301630
runSubTest := func(t *testing.T, test testCase) {
1631-
paymentDB := NewKVTestDB(t)
1631+
paymentDB := NewTestDB(t)
16321632

16331633
preimg, err := genPreimage(t)
16341634
require.NoError(t, err)

0 commit comments

Comments
 (0)