paymentsdb: rename db agnostic tests to highlight their behaviour
What changed, and why it matters
This commit only renames five test functions in a single test file to remove the 'KVPaymentsDB' prefix from their names. No production code, logic, or behavior was changed. It is a code-cleanup/refactoring change with no security relevance.
No security action needed; this is a non-functional test rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only comments/function names in payments/db/payment_test.go: TestKVPaymentsDBMPPRecordValidation -> TestMPPRecordValidation, TestKVPaymentsDBSuccessesWithoutInFlight -> TestSuccessesWithoutInFlight, TestKVPaymentsDBFailsWithoutInFlight -> TestFailsWithoutInFlight, and TestKVPaymentsDBDeletePayments -> TestDeletePayments. No implementation code, interfaces, or test assertions were altered.
Changed components
payments/db/payment_test.goInspect captured patch +11 / −11
diff --git a/payments/db/payment_test.go b/payments/db/payment_test.go
index 0ed8311..413db41 100644
--- a/payments/db/payment_test.go
+++ b/payments/db/payment_test.go
@@ -466,8 +466,8 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
}
}
-// TestKVPaymentsDBMPPRecordValidation tests MPP record validation.
-func TestKVPaymentsDBMPPRecordValidation(t *testing.T) {
+// TestMPPRecordValidation tests MPP record validation.
+func TestMPPRecordValidation(t *testing.T) {
t.Parallel()
paymentDB := NewTestDB(t)
@@ -1181,9 +1181,9 @@ func TestEmptyRoutesGenerateSphinxPacket(t *testing.T) {
require.ErrorIs(t, err, route.ErrNoRouteHopsProvided)
}
-// TestKVPaymentsDBSuccessesWithoutInFlight tests that the payment control will
-// disallow calls to Success when no payment is in flight.
-func TestKVPaymentsDBSuccessesWithoutInFlight(t *testing.T) {
+// TestSuccessesWithoutInFlight tests that the payment control will disallow
+// calls to Success when no payment is in flight.
+func TestSuccessesWithoutInFlight(t *testing.T) {
t.Parallel()
paymentDB := NewTestDB(t)
@@ -1201,9 +1201,9 @@ func TestKVPaymentsDBSuccessesWithoutInFlight(t *testing.T) {
require.ErrorIs(t, err, ErrPaymentNotInitiated)
}
-// TestKVPaymentsDBFailsWithoutInFlight checks that a strict payment control
-// will disallow calls to Fail when no payment is in flight.
-func TestKVPaymentsDBFailsWithoutInFlight(t *testing.T) {
+// TestFailsWithoutInFlight checks that a strict payment control will disallow
+// calls to Fail when no payment is in flight.
+func TestFailsWithoutInFlight(t *testing.T) {
t.Parallel()
paymentDB := NewTestDB(t)
@@ -1218,9 +1218,9 @@ func TestKVPaymentsDBFailsWithoutInFlight(t *testing.T) {
require.ErrorIs(t, err, ErrPaymentNotInitiated)
}
-// TestKVPaymentsDBDeletePayments tests that DeletePayments correctly deletes
-// information about completed payments from the database.
-func TestKVPaymentsDBDeletePayments(t *testing.T) {
+// TestDeletePayments tests that DeletePayments correctly deletes information
+// about completed payments from the database.
+func TestDeletePayments(t *testing.T) {
t.Parallel()
paymentDB := NewTestDB(t)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.