Merged in feature/ecr (pull request #161)

Feature/ecr

* nosave

* repo

* awscli

* unzip

* ignore

* moreram

* 14k

* ref

* deployment

* 12k

* uselocal

* go

* dockercomd

* reorder

* iamgename

* installs

* tart

* cli

* clideps

* y

* dockerce

* nodock

* multi

* rmecr

* dev
This commit is contained in:
Michael McGuinness
2025-06-03 13:52:10 +00:00
parent ae4b456399
commit 7ce7c9df4d
73 changed files with 295 additions and 326 deletions
+3 -4
View File
@@ -1,7 +1,6 @@
package documentclean
import (
"context"
"io"
"strings"
"testing"
@@ -23,7 +22,7 @@ import (
)
func TestClean(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -113,7 +112,7 @@ func TestClean(t *testing.T) {
}
func TestExecuteCleanTasks(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
@@ -172,7 +171,7 @@ func TestExecuteCleanTasks(t *testing.T) {
}
func TestStoreClean(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+11 -12
View File
@@ -1,7 +1,6 @@
package documentclean
import (
"context"
"fmt"
"io"
"strings"
@@ -21,7 +20,7 @@ import (
func TestGetBodyMimeType(t *testing.T) {
t.Run("invalid type", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -59,7 +58,7 @@ func TestGetBodyMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
})
t.Run("pdf", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -108,7 +107,7 @@ func TestGetBodyMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypePDF, contentType)
})
t.Run("pdf start", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -157,7 +156,7 @@ func TestGetBodyMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
})
t.Run("pdf end", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -206,7 +205,7 @@ func TestGetBodyMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
})
t.Run("short", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -269,7 +268,7 @@ func TestGetMetadataMimeType(t *testing.T) {
func TestGetAcceptedMimeType(t *testing.T) {
t.Run("invalid type", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -307,7 +306,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypeInvalid, contentType)
})
t.Run("pdf mimetype", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -320,7 +319,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
assert.Equal(t, documenttypes.MimeTypePDF, contentType)
})
t.Run("pdf format", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -372,7 +371,7 @@ func TestGetAcceptedMimeType(t *testing.T) {
func TestGetBytesBuffer(t *testing.T) {
t.Run("valid", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -412,7 +411,7 @@ func TestGetBytesBuffer(t *testing.T) {
assert.NotNil(t, buffer)
})
t.Run("negative start", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
@@ -452,7 +451,7 @@ func TestGetBytesBuffer(t *testing.T) {
assert.NotNil(t, buffer)
})
t.Run("zero length", func(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &DocCleanConfig{}
mockS3 := objectstoremock.NewMockS3Client(t)
cfg.StoreClient = mockS3
+2 -3
View File
@@ -1,7 +1,6 @@
package documentclean
import (
"context"
"fmt"
"io"
"strings"
@@ -33,7 +32,7 @@ type DocCleanConfig struct {
}
func TestCreate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -139,7 +138,7 @@ func TestCreate(t *testing.T) {
}
func TestInformClean(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
mockSQS := queuemock.NewMockSQSClient(t)
cfg := &DocCleanConfig{}
+2 -3
View File
@@ -1,7 +1,6 @@
package document_test
import (
"context"
"testing"
"queryorchestration/internal/database/repository"
@@ -16,7 +15,7 @@ import (
)
func TestGetSummary(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -44,7 +43,7 @@ func TestGetSummary(t *testing.T) {
}
func TestGetExternal(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+6 -7
View File
@@ -1,7 +1,6 @@
package documentinit
import (
"context"
"errors"
"fmt"
"testing"
@@ -22,7 +21,7 @@ import (
)
func TestCreate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -95,7 +94,7 @@ func TestCreate(t *testing.T) {
}
func TestGetCreateParams(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -135,7 +134,7 @@ func TestGetCreateParams(t *testing.T) {
}
func TestGetCreateParamsExisting(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -179,7 +178,7 @@ func TestGetCreateParamsExisting(t *testing.T) {
}
func TestGetCreateParamsCurrentDocErr(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -212,7 +211,7 @@ func TestGetCreateParamsCurrentDocErr(t *testing.T) {
}
func TestSubmitCreate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -255,7 +254,7 @@ func TestSubmitCreate(t *testing.T) {
}
func TestSubmitCreateExists(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+1 -2
View File
@@ -1,7 +1,6 @@
package document_test
import (
"context"
"testing"
"queryorchestration/internal/database/repository"
@@ -15,7 +14,7 @@ import (
)
func TestListByClientId(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+1 -2
View File
@@ -1,7 +1,6 @@
package documentstore
import (
"context"
"testing"
"time"
@@ -21,7 +20,7 @@ type ProcessConfig struct {
}
func TestProcess(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := &ProcessConfig{}
mockSQS := queuemock.NewMockSQSClient(t)
+1 -2
View File
@@ -1,7 +1,6 @@
package documentsync_test
import (
"context"
"fmt"
"testing"
@@ -20,7 +19,7 @@ import (
)
func TestSync(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+1 -1
View File
@@ -21,7 +21,7 @@ import (
)
func TestGetDocumentText(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("Hello World", func(t *testing.T) {
t.Parallel()
+1 -2
View File
@@ -1,7 +1,6 @@
package documenttext
import (
"context"
"io"
"strings"
"testing"
@@ -20,7 +19,7 @@ import (
)
func TestExecuteExtract(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+2 -3
View File
@@ -1,7 +1,6 @@
package documenttext
import (
"context"
"fmt"
"io"
"strings"
@@ -35,7 +34,7 @@ type DocTextConfig struct {
}
func TestCreate(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -141,7 +140,7 @@ func TestCreate(t *testing.T) {
}
func TestInformClean(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
mockSQS := queuemock.NewMockSQSClient(t)
cfg := &DocTextConfig{}
+1 -2
View File
@@ -1,7 +1,6 @@
package documenttext
import (
"context"
"io"
"testing"
@@ -16,7 +15,7 @@ import (
)
func TestGetBasePage(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
cfg := DocTextConfig{}
svc := Service{
cfg: &cfg,
+1 -2
View File
@@ -1,7 +1,6 @@
package documenttext
import (
"context"
"database/sql"
"io"
"strings"
@@ -22,7 +21,7 @@ import (
)
func TestStoreExtract(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
pool, err := pgxmock.NewPool()
require.NoError(t, err)
+5 -6
View File
@@ -1,7 +1,6 @@
package documenttypes
import (
"context"
"math"
"os"
"path/filepath"
@@ -15,7 +14,7 @@ import (
)
func TestIsValidDPI(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("no imgs", func(t *testing.T) {
pdf := NewPDF(strings.NewReader(pdfHelloWorld))
@@ -133,7 +132,7 @@ func TestIsValidDPI(t *testing.T) {
}
func TestIsValidDimensions(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("valid", func(t *testing.T) {
pdf := NewPDF(strings.NewReader(pdfHelloWorld))
@@ -168,7 +167,7 @@ func TestIsValidDimensions(t *testing.T) {
}
func TestGetPageCount(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("valid", func(t *testing.T) {
pdf := NewPDF(strings.NewReader(pdfHelloWorld))
@@ -186,7 +185,7 @@ func TestGetPageCount(t *testing.T) {
}
func TestIsCorrupt(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("valid", func(t *testing.T) {
pdf := NewPDF(strings.NewReader(pdfHelloWorld))
@@ -255,7 +254,7 @@ func TestNewPDF(t *testing.T) {
}
func TestPDFGetPage(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
t.Run("hello world", func(t *testing.T) {
file, err := os.Open("../../../assets/original/version1_7.pdf")
require.NoError(t, err)