Files
coder/database/postgres/postgres_test.go
Kyle Carberry 2618ce4694 chore: Add pubsub (#7)
* chore: Add pubsub

Exposes new in-memory and PostgreSQL pubsubs. This will be used for negotiating WebRTC connections.

* Don't run PostgreSQL tests on non-Linux
2022-01-06 08:35:44 -06:00

34 lines
553 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/database/postgres"
_ "github.com/lib/pq"
)
func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}
func TestPostgres(t *testing.T) {
t.Parallel()
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)
}