Merged in feature/mockserver (pull request #135)

Single Mock Server

* mockserver

* mockserver

* reqs

* mockserver

* slowrunner

* someoptimisedqueries

* passedfullsuite

* passedfullsuite
This commit is contained in:
Michael McGuinness
2025-05-06 01:59:52 +00:00
parent 39b5517d7f
commit ee776d2681
56 changed files with 656 additions and 822 deletions
-1
View File
@@ -43,7 +43,6 @@ func TestQueryRunner(t *testing.T) {
runner := clientsyncrunner.New(&clientsyncrunner.Services{
ClientSync: svc,
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
bod := clientsyncrunner.Body{
-1
View File
@@ -51,7 +51,6 @@ func TestDocCleanRunner(t *testing.T) {
runner := doccleanrunner.New(&doccleanrunner.Services{
Clean: documentclean.New(cfg),
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
bod := doccleanrunner.Body{
-1
View File
@@ -43,7 +43,6 @@ func TestDocInitRunner(t *testing.T) {
runner := docinitrunner.New(&docinitrunner.Services{
Document: documentinit.New(cfg),
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
clientId := "clientid"
-1
View File
@@ -45,7 +45,6 @@ func TestDocInitRunner(t *testing.T) {
Client: client.New(cfg),
}),
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
j := client.Client{
-1
View File
@@ -58,7 +58,6 @@ func TestDocCleanRunner(t *testing.T) {
runner := doctextrunner.New(&doctextrunner.Services{
Text: documenttext.New(cfg),
})
assert.NotNil(t, runner)
doc := doctextrunner.Body{
DocumentID: uuid.New(),
}
-14
View File
@@ -1,14 +0,0 @@
package queryapi_test
import (
"testing"
queryapi "queryorchestration/api/queryAPI"
"github.com/stretchr/testify/assert"
)
func TestNewControllers(t *testing.T) {
cons := queryapi.NewControllers(&queryapi.Services{})
assert.NotNil(t, cons)
}
-1
View File
@@ -105,7 +105,6 @@ func TestListQueries(t *testing.T) {
var res queryapi.ListQueries
err = json.Unmarshal(rec.Body.Bytes(), &res)
require.NoError(t, err)
assert.NotNil(t, res.Queries)
assert.ElementsMatch(t, res.Queries, []queryapi.Query{
{
Id: id,
+2
View File
@@ -10,6 +10,7 @@ import (
queryapi "queryorchestration/api/queryAPI"
"queryorchestration/internal/client"
"queryorchestration/internal/database/repository"
"queryorchestration/internal/export"
"queryorchestration/internal/serviceconfig"
"github.com/labstack/echo/v4"
@@ -27,6 +28,7 @@ func TestGetClientStatus(t *testing.T) {
cons := queryapi.NewControllers(&queryapi.Services{
Client: client.New(cfg),
Export: export.New(),
})
e := echo.New()
+1 -2
View File
@@ -52,7 +52,6 @@ func TestQueryRunner(t *testing.T) {
Sync: resultsync.New(cfg),
}),
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
doc := queryrunner.Body{
@@ -112,7 +111,7 @@ func TestQueryRunner(t *testing.T) {
pool.ExpectExec("name: AddResultDependency :exec").WithArgs(resultId, requiredResultId).
WillReturnResult(pgxmock.NewResult("", 1))
pool.ExpectCommit()
pool.ExpectQuery("name: ListQueryDirectDependentsByDocumentID :many").WithArgs(query.ID, doc.DocumentID).
pool.ExpectQuery("name: ListQueryDirectDependentsByDocumentID :many").WithArgs(&query.ID, &doc.DocumentID).
WillReturnRows(
pgxmock.NewRows([]string{"queryId"}).
AddRow(&reqQuery),
-1
View File
@@ -46,7 +46,6 @@ func TestQueryRunner(t *testing.T) {
runner := querysyncrunner.New(&querysyncrunner.Services{
QuerySync: svc,
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
doc := querysyncrunner.Body{
@@ -43,7 +43,6 @@ func TestQueryRunner(t *testing.T) {
runner := queryversionsyncrunner.New(&queryversionsyncrunner.Services{
Sync: svc,
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
doc := queryversionsyncrunner.Body{
-1
View File
@@ -42,7 +42,6 @@ func TestDocInitRunner(t *testing.T) {
runner := New(&Services{
documentstore.New(cfg),
})
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
clientId := "hi"