Merged in feature/import (pull request #157)

Feature/import

* importstart

* pp

* tests

* importtests

* 100GB

* lint

* passtests

* utc

* awsprofile

* doublequotes

* host
This commit is contained in:
Michael McGuinness
2025-05-27 15:28:46 +00:00
parent 46882da5f5
commit cc2278086f
74 changed files with 992 additions and 4753 deletions
+16 -61
View File
@@ -10,6 +10,7 @@ import (
"queryorchestration/internal/serviceconfig/aws"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/test"
queryapitest "queryorchestration/internal/test/queryAPI"
queryapi "queryorchestration/pkg/queryAPI"
@@ -59,21 +60,15 @@ func TestProcess(t *testing.T) {
queryapitest.SetQueryForClient(t, net.Client, clientId, jsonId)
part := uint16(0)
importKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Import,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile := strings.NewReader(pdfHelloWorld)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: importKey,
queryapitest.CreateFile(t, net.Client, queryapitest.File{
Filename: "helloworld.pdf",
Content: []byte(pdfHelloWorld),
ClientID: clientId,
})
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
part := uint16(0)
textKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
@@ -81,7 +76,7 @@ func TestProcess(t *testing.T) {
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile = strings.NewReader(textractBody)
inputFile := strings.NewReader(textractBody)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: textKey,
@@ -144,33 +139,13 @@ func TestProcess(t *testing.T) {
queryapitest.SetQueryForClient(t, net.Client, clientId, jsonId)
part := uint16(0)
importKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Import,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile := strings.NewReader(pdfHelloWorld)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: importKey,
queryapitest.CreateFile(t, net.Client, queryapitest.File{
Filename: "helloworld.pdf",
Content: []byte(pdfHelloWorld),
ClientID: clientId,
})
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
textKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Text,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile = strings.NewReader(textractBody)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: textKey,
})
queryapitest.WaitForClientStatus(t, t.Context(), net.Client, clientId, queryapi.INSYNC)
@@ -245,33 +220,13 @@ func TestProcess(t *testing.T) {
queryapitest.SetQueryForClient(t, net.Client, clientId, jsonId)
part := uint16(0)
importKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Import,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile := strings.NewReader(pdfHelloWorld)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: importKey,
queryapitest.CreateFile(t, net.Client, queryapitest.File{
Filename: "helloworld.pdf",
Content: []byte(pdfHelloWorld),
ClientID: clientId,
})
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
textKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Text,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile = strings.NewReader(textractBody)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: textKey,
})
queryapitest.WaitForClientStatus(t, t.Context(), net.Client, clientId, queryapi.INSYNC)