Merged in feature/parallellogqueries (pull request #132)
Testing Tweaks * parallel * slowestquery * split * cleanup * health * dynamiccores * go * profile * timeout * commitmychanges * taskfile * sqlcheckstart * client * cost * ctxtimeout
This commit is contained in:
+5
-32
@@ -2,7 +2,6 @@ package endtoend_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -15,7 +14,6 @@ import (
|
||||
queryapi "queryorchestration/pkg/queryAPI"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/oapi-codegen/runtime/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -35,32 +33,7 @@ func TestProcess(t *testing.T) {
|
||||
defer clean()
|
||||
|
||||
client := queryapitest.CreateClientWithSync(t, ctx, net.Client)
|
||||
|
||||
contextQueryRes, err := net.Client.CreateQueryWithResponse(ctx, queryapi.QueryCreate{
|
||||
Type: queryapi.CONTEXTFULL,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, http.StatusCreated, contextQueryRes.StatusCode())
|
||||
jcfg := `{"path":"keyone"}`
|
||||
jsonQueryRes, err := net.Client.CreateQueryWithResponse(ctx, queryapi.QueryCreate{
|
||||
Type: queryapi.JSONEXTRACTOR,
|
||||
Config: &jcfg,
|
||||
RequiredQueries: &[]types.UUID{contextQueryRes.JSON201.Id},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, http.StatusCreated, jsonQueryRes.StatusCode())
|
||||
newActiveVersion := int32(1)
|
||||
collRes, err := net.Client.SetCollectorByClientIdWithResponse(ctx, client.Id, queryapi.CollectorSet{
|
||||
ActiveVersion: &newActiveVersion,
|
||||
Fields: &[]queryapi.CollectorField{
|
||||
{
|
||||
Name: "JSON_QUERY",
|
||||
QueryId: jsonQueryRes.JSON201.Id,
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, http.StatusOK, collRes.StatusCode())
|
||||
_, jsonId := queryapitest.CreateDependentQueries(t, net.Client, client.Id)
|
||||
|
||||
queryapitest.WaitForClientStatus(t, ctx, net.Client, client.Id, queryapi.INSYNC)
|
||||
|
||||
@@ -124,9 +97,9 @@ func TestProcess(t *testing.T) {
|
||||
fullDoc := *docRes.JSON200
|
||||
assert.EqualExportedValues(t, expectedDoc, fullDoc)
|
||||
|
||||
jcfg = `{"path":"keytwo"}`
|
||||
jcfg := `{"path":"keytwo"}`
|
||||
av := int32(2)
|
||||
_, err = net.Client.UpdateQueryWithResponse(ctx, jsonQueryRes.JSON201.Id, queryapi.QueryUpdate{
|
||||
_, err = net.Client.UpdateQueryWithResponse(ctx, jsonId, queryapi.QueryUpdate{
|
||||
ActiveVersion: &av,
|
||||
Config: &jcfg,
|
||||
})
|
||||
@@ -144,13 +117,13 @@ func TestProcess(t *testing.T) {
|
||||
require.NotNil(t, docRes.JSON200)
|
||||
assert.EqualExportedValues(t, expectedDoc, *docRes.JSON200)
|
||||
|
||||
testRes, err := net.Client.TestQueryWithResponse(ctx, jsonQueryRes.JSON201.Id, queryapi.QueryTestRequest{
|
||||
testRes, err := net.Client.TestQueryWithResponse(ctx, jsonId, queryapi.QueryTestRequest{
|
||||
QueryVersion: 1,
|
||||
DocumentId: doc.Id,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "valueone", testRes.JSON200.Value)
|
||||
testRes, err = net.Client.TestQueryWithResponse(ctx, jsonQueryRes.JSON201.Id, queryapi.QueryTestRequest{
|
||||
testRes, err = net.Client.TestQueryWithResponse(ctx, jsonId, queryapi.QueryTestRequest{
|
||||
QueryVersion: 2,
|
||||
DocumentId: doc.Id,
|
||||
})
|
||||
|
||||
@@ -41,4 +41,6 @@ func TestQueryAPIAccessories(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, resp)
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
|
||||
test.PrintContainerLogs(t, c.API.Container)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user