92334ad1dd
Set Up S3 integration * cfginterfaceandfirsts3funcs * addlocalstack * generallypassesfullsuite * addedmultipleattemptedpings * cleanup * stabiliseplusskip
53 lines
1.0 KiB
Go
53 lines
1.0 KiB
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/serviceconfig"
|
|
objectstore "queryorchestration/internal/serviceconfig/objectstore"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
type StoreConfig struct {
|
|
serviceconfig.BaseConfig
|
|
objectstore.ObjectStoreConfig
|
|
}
|
|
|
|
func TestCreateBucket(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &StoreConfig{}
|
|
SetCfgProvider(t, cfg)
|
|
|
|
acfg, cleanup := CreateAWSContainer(t, ctx, &CreateAWSConfig{
|
|
Cfg: cfg,
|
|
})
|
|
defer cleanup()
|
|
|
|
CreateStoreClient(t, ctx, cfg, acfg.ExternalEndpoint)
|
|
|
|
CreateBucket(t, ctx, cfg, "myname")
|
|
}
|
|
|
|
func TestCreateStoreClient(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &StoreConfig{}
|
|
SetCfgProvider(t, cfg)
|
|
|
|
acfg, cleanup := CreateAWSContainer(t, ctx, &CreateAWSConfig{
|
|
Cfg: cfg,
|
|
})
|
|
defer cleanup()
|
|
|
|
CreateStoreClient(t, ctx, cfg, acfg.ExternalEndpoint)
|
|
assert.NotNil(t, cfg.GetStoreClient())
|
|
}
|