mirror of
https://github.com/empayre/fleet.git
synced 2024-11-08 01:38:57 +00:00
343262b799
- Add datastore method to check migration status. - Print a warning on startup if migrations are not completed. Fixes #1279
25 lines
542 B
Go
25 lines
542 B
Go
package datastore
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/kolide/kolide/server/kolide"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func testMigrationStatus(t *testing.T, ds kolide.Datastore) {
|
|
if ds.Name() == "inmem" {
|
|
t.Skip("inmem is being deprecated, test skipped")
|
|
}
|
|
|
|
require.Nil(t, ds.Drop())
|
|
require.NotNil(t, ds.MigrationStatus())
|
|
|
|
require.Nil(t, ds.MigrateTables())
|
|
require.NotNil(t, ds.MigrationStatus())
|
|
|
|
// Should return nil with all migrations completed
|
|
require.Nil(t, ds.MigrateData())
|
|
require.Nil(t, ds.MigrationStatus())
|
|
}
|