Files
query-orchestration/internal/test/ecosystem_test.go
T
Michael McGuinness 555b6d420b Merged in feature/docresult (pull request #105)
Document Result Endpoint

* testing

* cleantesting

* progress

* query

* lint

* readme

* dockerclient

* api

* passtest

* tests

* test
2025-03-17 18:14:15 +00:00

79 lines
1.7 KiB
Go

package test
import (
"context"
"testing"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/objectstore"
"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{}
SetCfgProviderWithBasePath(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{}
SetCfgProviderWithBasePath(t, cfg, "../..")
conn, cleanup := CreateFullNetwork(t, ctx, cfg)
assert.NotNil(t, conn)
assert.NotNil(t, cleanup)
cleanup()
}