cbd1d5f067
Add tests for queuing * startingtest * queuerunnertest * addedtestfuncs * testtests * passintegration * unittests
49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
package integration_test
|
|
|
|
import (
|
|
"context"
|
|
serviceinterfaces "queryorchestration/api/serviceInterfaces"
|
|
"queryorchestration/internal/test"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestQueryService(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
conn, cleanup := test.CreateAPIWithDependencies(t, ctx, "queryService")
|
|
defer cleanup()
|
|
|
|
client := serviceinterfaces.NewQueryServiceClient(conn)
|
|
|
|
config := ""
|
|
reqQueries := []string{}
|
|
idRes, err := client.Create(ctx, &serviceinterfaces.QueryCreate{
|
|
Type: 1,
|
|
Config: &config,
|
|
RequiredQueries: reqQueries,
|
|
})
|
|
assert.Nil(t, err)
|
|
id := idRes.GetId()
|
|
assert.NotEmpty(t, id)
|
|
|
|
// queryRes, err := client.Get(ctx, &serviceinterfaces.IdMessage{
|
|
// Id: id,
|
|
// })
|
|
// log.Print(err)
|
|
// assert.Nil(t, err)
|
|
// assert.EqualExportedValues(t, serviceinterfaces.Query{
|
|
// Id: id,
|
|
// Type: serviceinterfaces.QueryType_QUERY_TYPE_CONTEXT_FULL,
|
|
// ActiveVersion: int32(1),
|
|
// LatestVersion: int32(1),
|
|
// Config: &config,
|
|
// RequiredQueries: reqQueries,
|
|
// }, *queryRes)
|
|
|
|
//QueryService - List, Update, Test
|
|
//JobController - Create, Update, Get
|
|
//Export - Trigger
|
|
}
|