Merged in feature/remove-query (pull request #201)
remove query from codebase part 1 * remove query * fix localstack run
This commit is contained in:
@@ -14,12 +14,13 @@ 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"
|
||||
)
|
||||
|
||||
// Note: Query-related helper functions have been removed.
|
||||
// See remove_query_plan.md for details.
|
||||
|
||||
type File struct {
|
||||
ClientID queryapi.ClientID
|
||||
Filename string
|
||||
@@ -69,22 +70,6 @@ func CreateClientWithSync(t testing.TB, client queryapi.ClientWithResponsesInter
|
||||
return clientCreateRes.JSON201.Id
|
||||
}
|
||||
|
||||
func SetQueryForClient(t testing.TB, client queryapi.ClientWithResponsesInterface, clientId queryapi.ClientID, queryId uuid.UUID) {
|
||||
t.Helper()
|
||||
|
||||
newActiveVersion := int32(1)
|
||||
_, err := client.SetCollectorByClientIdWithResponse(t.Context(), clientId, queryapi.CollectorSet{
|
||||
ActiveVersion: &newActiveVersion,
|
||||
Fields: &[]queryapi.CollectorField{
|
||||
{
|
||||
Name: "JSON_QUERY",
|
||||
QueryId: queryId,
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func WaitForClientStatus(t testing.TB, ctx context.Context, service queryapi.ClientWithResponsesInterface, id string, status queryapi.ClientStatus) {
|
||||
t.Helper()
|
||||
|
||||
@@ -125,21 +110,3 @@ func WaitForClientStatus(t testing.TB, ctx context.Context, service queryapi.Cli
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CreateDependentQueries(t testing.TB, client *queryapi.ClientWithResponses) (uuid.UUID, uuid.UUID) {
|
||||
contextQueryRes, err := client.CreateQueryWithResponse(t.Context(), queryapi.QueryCreate{
|
||||
Type: queryapi.CONTEXTFULL,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
test.AssertStatus(t, http.StatusCreated, contextQueryRes.HTTPResponse)
|
||||
jcfg := `{"path":"keyone"}`
|
||||
jsonQueryRes, err := client.CreateQueryWithResponse(t.Context(), queryapi.QueryCreate{
|
||||
Type: queryapi.JSONEXTRACTOR,
|
||||
Config: &jcfg,
|
||||
RequiredQueries: &[]types.UUID{contextQueryRes.JSON201.Id},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
test.AssertStatus(t, http.StatusCreated, jsonQueryRes.HTTPResponse)
|
||||
|
||||
return contextQueryRes.JSON201.Id, jsonQueryRes.JSON201.Id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user