channeldb: mark ApplyMigration as a test helper
With this change, errors from migrations will have the proper local line number.
This commit is contained in:
parent
db23e34f74
commit
c6a8816043
@ -41,6 +41,8 @@ func ApplyMigration(t *testing.T,
|
|||||||
beforeMigration, afterMigration, migrationFunc func(tx kvdb.RwTx) error,
|
beforeMigration, afterMigration, migrationFunc func(tx kvdb.RwTx) error,
|
||||||
shouldFail bool) {
|
shouldFail bool) {
|
||||||
|
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
cdb, cleanUp, err := MakeDB()
|
cdb, cleanUp, err := MakeDB()
|
||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -55,6 +57,8 @@ func ApplyMigration(t *testing.T,
|
|||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
t.Helper()
|
||||||
|
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
err = newError(r)
|
err = newError(r)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user