Browse Source

channeldb: mark ApplyMigration as a test helper

With this change, errors from migrations will have the proper local line
number.
master
Olaoluwa Osuntokun 4 years ago committed by Johan T. Halseth
parent
commit
c6a8816043
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
  1. 4
      channeldb/migtest/migtest.go

4
channeldb/migtest/migtest.go

@ -41,6 +41,8 @@ func ApplyMigration(t *testing.T,
beforeMigration, afterMigration, migrationFunc func(tx kvdb.RwTx) error,
shouldFail bool) {
t.Helper()
cdb, cleanUp, err := MakeDB()
defer cleanUp()
if err != nil {
@ -55,6 +57,8 @@ func ApplyMigration(t *testing.T,
}
defer func() {
t.Helper()
if r := recover(); r != nil {
err = newError(r)
}

Loading…
Cancel
Save