mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
* 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
32 lines
559 B
Go
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)
|
|
}
|