Files
coder/coderd/database/postgres/postgres_test.go
Steven Masley 591523a078 chore: Move httpapi, httpmw, & database into coderd (#568)
* chore: Move httpmw to /coderd directory
httpmw is specific to coderd and should be scoped under coderd

* chore: Move httpapi to /coderd directory
httpapi is specific to coderd and should be scoped under coderd

* chore: Move database  to /coderd directory
database is specific to coderd and should be scoped under coderd

* chore: Update codecov & gitattributes for generated files
* chore: Update Makefile
2022-03-25 16:07:45 -05:00

39 lines
606 B
Go

//go:build linux
package postgres_test
import (
"database/sql"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
"github.com/coder/coder/coderd/database/postgres"
_ "github.com/lib/pq"
)
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
func TestPostgres(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip()
return
}
connect, close, err := postgres.Open()
require.NoError(t, err)
defer close()
db, err := sql.Open("postgres", connect)
require.NoError(t, err)
err = db.Ping()
require.NoError(t, err)
err = db.Close()
require.NoError(t, err)
}