Skip to content

Commit

Permalink
pgsql: Add test for migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
KeyboardNerd committed Mar 13, 2019
1 parent ea418cf commit 497b79a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package pgsql
package migrations_test

import (
"testing"

"github.com/coreos/clair/database/pgsql/migrations"
"github.com/coreos/clair/database/pgsql/testutil"
_ "github.com/lib/pq"
"github.com/remind101/migrate"
"github.com/stretchr/testify/require"

"github.com/coreos/clair/database/pgsql/migrations"
)

var userTableCount = `SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname='public'`

func TestMigration(t *testing.T) {
db, cleanup := createAndConnectTestDB(t, "TestMigration")
db, cleanup := testutil.CreateAndConnectTestDB(t, "TestMigration")
defer cleanup()

err := migrate.NewPostgresMigrator(db).Exec(migrate.Up, migrations.Migrations...)
Expand Down

0 comments on commit 497b79a

Please sign in to comment.