Files
query-orchestration/internal/test/ecosystem_test.go
T

79 lines
1.6 KiB
Go
Raw Normal View History

package test
import (
"context"
"testing"
2025-03-05 12:05:46 +00:00
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/objectstore"
2025-03-05 12:05:46 +00:00
"github.com/stretchr/testify/assert"
)
func TestCreateAPINetwork(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
ctx := context.Background()
conn, cleanup := CreateAPINetwork(t, ctx, &ServiceNetworkConfig{
API: QueryAPI,
})
assert.NotNil(t, conn)
assert.NotNil(t, cleanup)
cleanup()
}
func TestCreateBaseConfig(t *testing.T) {
cfg := &serviceconfig.BaseConfig{}
SetCfgProvider(t, cfg)
assert.Equal(t, "test", cfg.AWSKeyID)
assert.Equal(t, "test", cfg.AWSSecretKey)
assert.Equal(t, "us-east-1", cfg.AWSRegion)
assert.Equal(t, "invalid_user", cfg.DBUser)
assert.Equal(t, "invalid_pass", cfg.DBSecret)
assert.Equal(t, "invalid_host", cfg.DBHost)
assert.Equal(t, 5432, cfg.DBPort)
assert.Equal(t, "invalid_name", cfg.DBName)
assert.True(t, cfg.DBNoSSL)
}
type FullDepsConfig struct {
serviceconfig.BaseConfig
objectstore.ObjectStoreConfig
}
func TestCreateFullDependencies(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
ctx := context.Background()
cfg := &FullDepsConfig{}
SetCfgProvider(t, cfg)
conn, cleanup := CreateFullDependencies(t, ctx, cfg)
assert.NotNil(t, conn)
assert.NotNil(t, cleanup)
cleanup()
}
func TestCreateNetwork(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
ctx := context.Background()
cfg := &FullDepsConfig{}
SetCfgProvider(t, cfg)
conn, cleanup := CreateFullNetwork(t, ctx, cfg)
assert.NotNil(t, conn)
assert.NotNil(t, cleanup)
cleanup()
}