Files
coder/database/migrate_test.go
Kyle Carberry 2654a93132 chore: Fix golangci-lint configuration and patch errors (#34)
* chore: Fix golangci-lint configuration and patch errors

Due to misconfiguration of a linting rules directory, our linter has not been
working properly. This change fixes the configuration issue, and all remaining
linting errors.

* Fix race in peer logging

* Fix race and return

* Lock on bufferred amount low

* Fix mutex lock
2022-01-20 10:00:13 -06:00

32 lines
559 B
Go

//go:build linux
package database_test
import (
"database/sql"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
)
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
func TestMigrate(t *testing.T) {
t.Parallel()
connection, closeFn, err := postgres.Open()
require.NoError(t, err)
defer closeFn()
db, err := sql.Open("postgres", connection)
require.NoError(t, err)
defer db.Close()
err = database.Migrate(db)
require.NoError(t, err)
}