fa95d733ca
Add short tests and Tidy internal directories * complete the tasks
29 lines
560 B
Go
29 lines
560 B
Go
package database_test
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"path"
|
|
"queryorchestration/internal/database"
|
|
"queryorchestration/internal/test"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestDBConn(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
|
Migrations: &database.MigrationConfig{
|
|
BasePath: path.Join(os.Getenv("PWD"), "../.."),
|
|
},
|
|
})
|
|
defer cleanup()
|
|
|
|
pool := database.GetDBPool(ctx)
|
|
assert.NotNil(t, pool)
|
|
}
|