2025-01-07 13:01:14 +00:00
|
|
|
package integration_test
|
2024-12-23 12:56:47 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-01-29 11:52:37 +00:00
|
|
|
"queryorchestration/internal/query"
|
2025-01-17 12:00:32 +00:00
|
|
|
"queryorchestration/internal/server/queue"
|
2025-01-10 19:17:20 +00:00
|
|
|
"queryorchestration/internal/test"
|
2024-12-23 12:56:47 +00:00
|
|
|
"testing"
|
|
|
|
|
|
2025-01-10 19:17:20 +00:00
|
|
|
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
|
2024-12-23 12:56:47 +00:00
|
|
|
"github.com/google/uuid"
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
2025-01-07 16:12:18 +00:00
|
|
|
func TestQueryRunner(t *testing.T) {
|
2024-12-23 12:56:47 +00:00
|
|
|
ctx := context.Background()
|
|
|
|
|
|
2025-02-03 17:30:50 +00:00
|
|
|
cfg := test.CreateBaseConfig()
|
|
|
|
|
|
|
|
|
|
c, cleanup := test.CreateRunnerNetwork(t, ctx, &test.RunnerNetworkConfig{
|
|
|
|
|
Cfg: cfg,
|
|
|
|
|
Name: test.QueryRunner,
|
|
|
|
|
})
|
2024-12-23 12:56:47 +00:00
|
|
|
defer cleanup()
|
|
|
|
|
|
2025-01-29 11:52:37 +00:00
|
|
|
document := query.Document{
|
2024-12-23 12:56:47 +00:00
|
|
|
ID: uuid.New(),
|
|
|
|
|
JobID: uuid.New(),
|
|
|
|
|
CleanVersion: int32(1),
|
|
|
|
|
TextVersion: int32(1),
|
|
|
|
|
}
|
2025-02-03 17:30:50 +00:00
|
|
|
qcfg := &queue.Config{
|
|
|
|
|
URL: c.URI,
|
|
|
|
|
Client: cfg.QueueClient,
|
2025-01-10 19:17:20 +00:00
|
|
|
}
|
2024-12-23 12:56:47 +00:00
|
|
|
|
2025-02-03 17:30:50 +00:00
|
|
|
err := queue.Send(ctx, qcfg, document, map[string]types.MessageAttributeValue{})
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
// TODO - check document output
|
2024-12-23 12:56:47 +00:00
|
|
|
}
|