Merged in feature/tableandtests (pull request #119)

Stabilise tests and CNC_1 Sample

* testspeedup

* notyet

* replacebits

* noflake
This commit is contained in:
Michael McGuinness
2025-04-24 13:31:47 +00:00
parent 8b86b2baeb
commit d54c823d77
9 changed files with 901 additions and 922 deletions
+860 -911
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -137,6 +137,25 @@ func TestGetDocumentText(t *testing.T) {
assertReaders(t, txtFile, text)
})
// t.Run("sampleOne - chc_1", func(t *testing.T) {
// t.Parallel()
// cfg := DocTextConfig{}
// svc := Service{
// cfg: &cfg,
// }
// mockTextract := textractmock.NewMockTextractClient(t)
// cfg.TextractClient = mockTextract
// textractBaseOut, pdf, txtFile, close := getFiles(t, "sampleOne", "chc_1")
// defer close()
// textExpectations(t, mockTextract, textractBaseOut)
// text, err := svc.getDocumentText(ctx, pdf)
// require.NoError(t, err)
// assertReaders(t, txtFile, text)
// })
}
func getFiles(t testing.TB, sample string, filename string) (map[string][]textract.AnalyzeDocumentOutput, *documenttypes.PDF, *os.File, func()) {
+1 -2
View File
@@ -28,8 +28,7 @@ tasks:
fullsuite:
- task: build
- task: lint
- task: test:unit
- task: test:endtoend
- task: test:all
precommit:
- task: lint:short
deps:tidy:
+20 -5
View File
@@ -57,6 +57,18 @@ tasks:
CLI_ARGS: |
-coverpkg={{.INTERNAL}},{{.API}} \
-coverprofile={{.COVERAGE_FILE}}
- task: coverage
silent: true
endtoend:
deps:
- docker:build
cmds:
- go test -count=1 -parallel {{.E2E_PARALLEL}} ./test/...
coverage:
vars:
TMP_FILE: "{{.OUT_DIR}}/coverage.tmp"
FILTER_COVERAGE_FILE: "{{.OUT_DIR}}/filtered_coverage.out"
cmds:
- |
grep -v -E "{{.EXCLUDED_FILES}}" {{.COVERAGE_FILE}} \
> {{.FILTER_COVERAGE_FILE}}
@@ -94,9 +106,12 @@ tasks:
fi
echo "✅ All coverage checks passed!"
silent: true
endtoend:
deps:
- docker:build
all:
cmds:
- go test -count=1 -parallel {{.E2E_PARALLEL}} ./test/...
- mkdir -p {{.OUT_DIR}}
- |
go test -count=1 -parallel {{.UNIT_PARALLEL}} \
-coverpkg={{.INTERNAL}},{{.API}},{{.PKG}} \
-coverprofile={{.COVERAGE_FILE}} \
./...
- task: coverage
+1 -4
View File
@@ -20,9 +20,6 @@ func TestQueryAPI(t *testing.T) {
cfg := &Config{}
test.SetCfgProvider(t, cfg)
deps, clean := test.CreateFullDependencies(t, ctx, cfg)
defer clean()
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, test.QueryAPI)
defer cleanup()
@@ -71,7 +68,7 @@ func TestQueryAPI(t *testing.T) {
require.NoError(t, err)
assert.NotNil(t, res)
test.AssertMessageBody(t, ctx, cfg, deps.QueueURLs[test.QueryVersionSyncRunnerName], regexp.MustCompile(`{"id":".+"}`))
test.AssertMessageBody(t, ctx, cfg, c.Dependencies.QueueURLs[test.QueryVersionSyncRunnerName], regexp.MustCompile(`{"id":".+"}`))
queryRes, err = client.GetQueryWithResponse(ctx, jsonID)
require.NoError(t, err)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB