Merged in feature/textextraction (pull request #110)
Text Extraction * bases * go * splitting * structure * movetoasync * movetoasync * settinguptrigger * reorder * storevent * standardisepollingvalidation * unittests * fixlint * fixlint * awscfg * generatesample * followthrough * tests * clena * store * externalidcleanup * clientid * local * baseunittests * putobjecttests * tests
This commit is contained in:
@@ -16,7 +16,10 @@ import (
|
||||
func TestQueryAPIAccessories(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, &test.ServiceNetworkConfig{
|
||||
cfg := &Config{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, &test.ServiceNetworkConfig{
|
||||
API: test.QueryAPI,
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package endtoend
|
||||
package endtoend_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -15,7 +15,10 @@ import (
|
||||
func TestClient(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, &test.ServiceNetworkConfig{
|
||||
cfg := &Config{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, &test.ServiceNetworkConfig{
|
||||
API: test.QueryAPI,
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package endtoend
|
||||
package endtoend_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/aws"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
"queryorchestration/internal/test"
|
||||
queryapi "queryorchestration/pkg/queryAPI"
|
||||
@@ -16,32 +18,24 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type CollectorConfig struct {
|
||||
type Config struct {
|
||||
serviceconfig.BaseConfig
|
||||
aws.AWSConfig
|
||||
queue.QueueConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
}
|
||||
|
||||
func TestCollectorService(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &CollectorConfig{}
|
||||
cfg := &Config{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
network, ncleanup := test.CreateNetwork(t, ctx)
|
||||
defer ncleanup()
|
||||
|
||||
_, clean := test.CreateAWSContainer(t, ctx, &test.CreateAWSConfig{
|
||||
Cfg: cfg,
|
||||
Network: network,
|
||||
})
|
||||
deps, clean := test.CreateFullDependencies(t, ctx, cfg)
|
||||
defer clean()
|
||||
|
||||
test.SetQueueClient(t, ctx, cfg)
|
||||
clientsyncurl := test.CreateQueue(t, ctx, cfg, test.ClientSyncRunnerName)
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, &test.ServiceNetworkConfig{
|
||||
Cfg: cfg,
|
||||
Network: network,
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, &test.ServiceNetworkConfig{
|
||||
Network: deps.Network,
|
||||
API: test.QueryAPI,
|
||||
})
|
||||
defer cleanup()
|
||||
@@ -107,5 +101,5 @@ func TestCollectorService(t *testing.T) {
|
||||
assert.Len(t, collRes.JSON200.Fields, 1)
|
||||
assert.ElementsMatch(t, fields, collRes.JSON200.Fields)
|
||||
|
||||
test.AssertMessageBody(t, ctx, cfg, clientsyncurl, regexp.MustCompile(`{"id":".+"}`))
|
||||
test.AssertMessageBody(t, ctx, cfg, deps.QueueURLs[test.ClientSyncRunnerName], regexp.MustCompile(`{"id":".+"}`))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package endtoend
|
||||
package endtoend_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -15,7 +15,10 @@ import (
|
||||
func TestExportService(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, &test.ServiceNetworkConfig{
|
||||
cfg := &Config{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, &test.ServiceNetworkConfig{
|
||||
API: test.QueryAPI,
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
@@ -5,8 +5,6 @@ import (
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
"queryorchestration/internal/test"
|
||||
queryapi "queryorchestration/pkg/queryAPI"
|
||||
|
||||
@@ -16,33 +14,17 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type QueryConfig struct {
|
||||
serviceconfig.BaseConfig
|
||||
queue.QueueConfig
|
||||
}
|
||||
|
||||
func TestQueryAPI(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &QueryConfig{}
|
||||
cfg := &Config{}
|
||||
test.SetCfgProvider(t, cfg)
|
||||
|
||||
network, ncleanup := test.CreateNetwork(t, ctx)
|
||||
defer ncleanup()
|
||||
|
||||
_, clean := test.CreateAWSContainer(t, ctx, &test.CreateAWSConfig{
|
||||
Cfg: cfg,
|
||||
Network: network,
|
||||
})
|
||||
deps, clean := test.CreateFullDependencies(t, ctx, cfg)
|
||||
defer clean()
|
||||
|
||||
err := cfg.SetQueueClient(ctx)
|
||||
require.NoError(t, err)
|
||||
queryversionsyncurl := test.CreateQueue(t, ctx, cfg, test.QueryVersionSyncRunnerName)
|
||||
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, &test.ServiceNetworkConfig{
|
||||
Cfg: cfg,
|
||||
Network: network,
|
||||
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, &test.ServiceNetworkConfig{
|
||||
Network: deps.Network,
|
||||
API: test.QueryAPI,
|
||||
})
|
||||
defer cleanup()
|
||||
@@ -92,7 +74,7 @@ func TestQueryAPI(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, res)
|
||||
|
||||
test.AssertMessageBody(t, ctx, cfg, queryversionsyncurl, regexp.MustCompile(`{"id":".+"}`))
|
||||
test.AssertMessageBody(t, ctx, cfg, deps.QueueURLs[test.QueryVersionSyncRunnerName], regexp.MustCompile(`{"id":".+"}`))
|
||||
|
||||
queryRes, err = client.GetQueryWithResponse(ctx, jsonID)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user