0ebb8a21a1
Clean Up Testing and Linting * somescriptcleanup * mostgolangci * deplatest * imageversions * usingscratch * movedqueuefrtesting * finishedunittesting * linting * taskfilecontext
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package integration_test
|
|
|
|
import (
|
|
"context"
|
|
serviceinterfaces "queryorchestration/api/serviceInterfaces"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestQueryService(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
conn, cleanup := createAPIDependencies(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
|
|
}
|