mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
34 lines
768 B
Go
34 lines
768 B
Go
package datastore
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/kolide/fleet/server/kolide"
|
|
"github.com/stretchr/testify/assert"
|
|
"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())
|
|
|
|
status, err := ds.MigrationStatus()
|
|
require.Nil(t, err)
|
|
assert.EqualValues(t, kolide.NoMigrationsCompleted, status)
|
|
|
|
require.Nil(t, ds.MigrateTables())
|
|
|
|
status, err = ds.MigrationStatus()
|
|
require.Nil(t, err)
|
|
assert.EqualValues(t, kolide.SomeMigrationsCompleted, status)
|
|
|
|
require.Nil(t, ds.MigrateData())
|
|
|
|
status, err = ds.MigrationStatus()
|
|
require.Nil(t, err)
|
|
assert.EqualValues(t, kolide.AllMigrationsCompleted, status)
|
|
}
|