Merged in feature/s3integration (pull request #47)
Set Up S3 integration * cfginterfaceandfirsts3funcs * addlocalstack * generallypassesfullsuite * addedmultipleattemptedpings * cleanup * stabiliseplusskip
This commit is contained in:
@@ -5,7 +5,10 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
documentinit "queryorchestration/internal/document/init"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
documentcleanc "queryorchestration/internal/serviceconfig/queue/documentclean"
|
||||
"queryorchestration/internal/test"
|
||||
queryservice "queryorchestration/pkg/queryService"
|
||||
"testing"
|
||||
@@ -13,21 +16,36 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type DocInitConfig struct {
|
||||
runner.BaseConfig
|
||||
documentcleanc.DocCleanConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
}
|
||||
|
||||
func TestDocInitRunner(t *testing.T) {
|
||||
t.SkipNow()
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := test.CreateBaseConfig()
|
||||
cfg.BasePath = path.Join(os.Getenv("PWD"), "../..")
|
||||
cfg := &DocInitConfig{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
cfg.SetBasePath(path.Join(os.Getenv("PWD"), "../.."))
|
||||
|
||||
network, ncleanup := test.CreateNetwork(t, ctx)
|
||||
defer ncleanup()
|
||||
|
||||
qcleanup := test.CreateQueueClient(t, ctx, &test.CreateQueueConfig{
|
||||
acfg, clean := test.CreateAWSContainer(t, ctx, &test.CreateAWSConfig{
|
||||
Cfg: cfg,
|
||||
Network: network,
|
||||
})
|
||||
defer qcleanup()
|
||||
defer clean()
|
||||
|
||||
err := cfg.SetQueueClient(ctx)
|
||||
assert.NoError(t, err)
|
||||
test.CreateStoreClient(t, ctx, cfg, acfg.ExternalEndpoint)
|
||||
|
||||
doccleanurl := test.CreateQueue(t, ctx, cfg, "docclean")
|
||||
bucketName := "docinitbucket"
|
||||
test.CreateBucket(t, ctx, cfg, bucketName)
|
||||
|
||||
net, cleanup := test.CreateRunnersAndServicesNetwork(t, ctx, &test.EcosystemNetworkConfig{
|
||||
Cfg: cfg,
|
||||
@@ -37,6 +55,7 @@ func TestDocInitRunner(t *testing.T) {
|
||||
Name: test.DocInitRunner,
|
||||
Env: map[string]string{
|
||||
"DOCUMENT_CLEAN_URL": doccleanurl,
|
||||
"BUCKET_NAME": bucketName,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -70,9 +89,12 @@ func TestDocInitRunner(t *testing.T) {
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
// TODO - upload example doc
|
||||
location := "/i/am/here"
|
||||
|
||||
document := documentinit.Create{
|
||||
JobID: jobRes.JSON201.Id,
|
||||
Location: "/I/am/here", // TODO
|
||||
Location: location,
|
||||
}
|
||||
|
||||
err = cfg.SendToQueue(ctx, &queue.SendParams{
|
||||
@@ -81,7 +103,7 @@ func TestDocInitRunner(t *testing.T) {
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
_ = test.AssertMessageWait(t, ctx, cfg, &queue.ReceiveParams{
|
||||
_ = test.AssertMessage(t, ctx, cfg, &queue.ReceiveParams{
|
||||
QueueURL: doccleanurl,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package integration_test
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/query"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
@@ -14,7 +15,8 @@ import (
|
||||
func TestQueryRunner(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := test.CreateBaseConfig()
|
||||
cfg := &serviceconfig.BaseConfig{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
c, cleanup := test.CreateRunnerNetwork(t, ctx, &test.RunnerNetworkConfig{
|
||||
Cfg: cfg,
|
||||
|
||||
Reference in New Issue
Block a user