2025-02-12 19:00:25 +00:00
|
|
|
package endtoend
|
2025-01-13 15:02:43 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-03-05 12:05:46 +00:00
|
|
|
"testing"
|
|
|
|
|
|
2025-01-13 15:02:43 +00:00
|
|
|
"queryorchestration/internal/test"
|
2025-01-15 19:45:51 +00:00
|
|
|
queryservice "queryorchestration/pkg/queryService"
|
2025-01-13 15:02:43 +00:00
|
|
|
|
2025-03-05 19:37:06 +00:00
|
|
|
"github.com/google/uuid"
|
2025-01-13 15:02:43 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestExportService(t *testing.T) {
|
|
|
|
|
ctx := context.Background()
|
|
|
|
|
|
2025-02-03 17:30:50 +00:00
|
|
|
c, cleanup := test.CreateServiceNetwork(t, ctx, &test.ServiceNetworkConfig{
|
|
|
|
|
Name: test.QueryService,
|
2025-02-12 19:00:25 +00:00
|
|
|
Env: map[string]string{
|
2025-03-10 11:03:00 +00:00
|
|
|
"CLIENT_SYNC_URL": "/i/am/here",
|
2025-02-14 10:56:24 +00:00
|
|
|
"QUERY_VERSION_SYNC_URL": "iamthere",
|
2025-02-12 19:00:25 +00:00
|
|
|
},
|
2025-02-03 17:30:50 +00:00
|
|
|
})
|
2025-01-13 15:02:43 +00:00
|
|
|
defer cleanup()
|
|
|
|
|
|
2025-02-03 17:30:50 +00:00
|
|
|
client, err := queryservice.NewClientWithResponses(c.URI)
|
|
|
|
|
assert.NoError(t, err)
|
2025-01-13 15:02:43 +00:00
|
|
|
|
2025-03-05 19:37:06 +00:00
|
|
|
id := uuid.New()
|
|
|
|
|
|
|
|
|
|
idRes, err := client.TriggerExportWithResponse(ctx, id, queryservice.ExportTrigger{})
|
2025-02-03 17:30:50 +00:00
|
|
|
assert.NoError(t, err)
|
2025-01-13 15:02:43 +00:00
|
|
|
assert.NotNil(t, idRes)
|
|
|
|
|
}
|