Merged in feature/textExtractionsPart1 (pull request #192)
all schema and rest apis for text extraction support * in progress * stage 8 complete * phase 9 completed * phase 9 complete * ongoing - s3 path fix * working * optimize ci build * e2e tests * missing test
This commit is contained in:
@@ -4,7 +4,9 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"queryorchestration/internal/client"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
|
||||
db "queryorchestration/internal/database"
|
||||
@@ -86,3 +88,25 @@ func CreateDBWithParams(t testing.TB, cfg serviceconfig.ConfigProvider, dcfg *Cr
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
||||
// MustParseDate parses a date string in YYYY-MM-DD format and panics on error.
|
||||
// This is useful for test data where dates are known to be valid.
|
||||
func MustParseDate(dateStr string) time.Time {
|
||||
t, err := time.Parse("2006-01-02", dateStr)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to parse date %q: %v", dateStr, err))
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
// CreateTestClient creates a client using the client service, which automatically creates the root folder.
|
||||
// This is the preferred way to create clients in tests to ensure proper initialization.
|
||||
func CreateTestClient(t testing.TB, cfg serviceconfig.ConfigProvider, clientID, clientName string) {
|
||||
t.Helper()
|
||||
clientSvc := client.New(cfg)
|
||||
_, err := clientSvc.Create(t.Context(), client.CreateParams{
|
||||
ID: clientID,
|
||||
Name: clientName,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ func CreateMockServer(t testing.TB) *MockServer {
|
||||
network := GetNetwork(t)
|
||||
|
||||
req := testcontainers.ContainerRequest{
|
||||
Image: "mockserver/mockserver:latest",
|
||||
Image: "mockserver/mockserver:5.15.0",
|
||||
Name: "mockserver_test_queryorchestration",
|
||||
ExposedPorts: []string{port.Port()},
|
||||
Env: map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user