Files
query-orchestration/internal/database/connection_test.go
T

29 lines
560 B
Go
Raw Normal View History

2024-12-24 18:11:25 +00:00
package database_test
import (
"context"
2025-01-14 17:28:26 +00:00
"os"
"path"
2024-12-24 18:11:25 +00:00
"queryorchestration/internal/database"
"queryorchestration/internal/test"
2024-12-24 18:11:25 +00:00
"testing"
"github.com/stretchr/testify/assert"
)
func TestDBConn(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
2024-12-24 18:11:25 +00:00
ctx := context.Background()
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
Migrations: &database.MigrationConfig{
2025-01-14 17:28:26 +00:00
BasePath: path.Join(os.Getenv("PWD"), "../.."),
},
})
2025-01-10 11:12:03 +00:00
defer cleanup()
2024-12-24 18:11:25 +00:00
pool := database.GetDBPool(ctx)
assert.NotNil(t, pool)
}