Files
query-orchestration/test/queryService/testquery_test.go
T
Michael McGuinness c1e9d93037 Merged in feature/jobsync (pull request #63)
Document Sync and Job Sync

* docsyncfunc

* startedQueryWork

* morefixes

* jobsyncsvcstart

* save

* jobsynctext

* save

* save

* docsync

* shorttest

* jobsync

* jobsyncupdateoncollectorupdate

* passlivetest

* collectortest

* lint
2025-02-12 19:00:25 +00:00

46 lines
1.0 KiB
Go

package endtoend_test
import (
"context"
"queryorchestration/internal/test"
queryservice "queryorchestration/pkg/queryService"
"testing"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
)
func TestQueryServiceTest(t *testing.T) {
ctx := context.Background()
c, cleanup := test.CreateServiceNetwork(t, ctx, &test.ServiceNetworkConfig{
Name: test.QueryService,
Env: map[string]string{
"JOB_SYNC_URL": "/i/am/here",
},
})
defer cleanup()
client, err := queryservice.NewClientWithResponses(c.URI)
assert.NoError(t, err)
idRes, err := client.CreateQueryWithResponse(ctx, queryservice.QueryCreate{
Type: queryservice.CONTEXTFULL,
})
assert.NoError(t, err)
id := idRes.JSON201.Id
assert.NotEmpty(t, id)
docId := uuid.New()
testRes, err := client.TestQueryWithResponse(ctx, id, queryservice.QueryTestRequest{
DocumentId: docId,
QueryVersion: int32(1),
})
assert.NoError(t, err)
assert.NotNil(t, testRes)
// TODO
// assert.NotNil(t, testRes.JSON200)
// assert.Equal(t, "hey", testRes.JSON200.Value)
}