Merged in feature/shorttestsanddirtidy (pull request #26)
Add short tests and Tidy internal directories * complete the tasks
This commit is contained in:
@@ -3,8 +3,8 @@ package controllers
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/query/document"
|
||||
"queryorchestration/internal/server/queue"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
controllers "queryorchestration/api/queryRunner"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/query/document"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
@@ -20,6 +20,9 @@ import (
|
||||
)
|
||||
|
||||
func TestQueryRunner(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
qCfg, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package queryservice
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/export"
|
||||
"queryorchestration/internal/job/collector"
|
||||
"queryorchestration/internal/query"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
|
||||
@@ -3,7 +3,7 @@ package queryservice
|
||||
import (
|
||||
"errors"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
func parseQueries(queries []*query.Query) ([]Query, error) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package queryservice
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
@@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"context"
|
||||
controllers "queryorchestration/api/queryRunner"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/query/document"
|
||||
"queryorchestration/internal/server"
|
||||
"queryorchestration/internal/server/queue"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"log"
|
||||
queryservice "queryorchestration/api/queryService"
|
||||
"queryorchestration/internal/api"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/export"
|
||||
"queryorchestration/internal/job/collector"
|
||||
"queryorchestration/internal/query"
|
||||
"queryorchestration/internal/server"
|
||||
"queryorchestration/internal/server/api"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/url"
|
||||
"queryorchestration/internal/env"
|
||||
"queryorchestration/internal/server/env"
|
||||
|
||||
"github.com/docker/go-connections/nat"
|
||||
"github.com/jackc/pgx/v5"
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestDBConn(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
||||
Migrations: &database.MigrationConfig{
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestRunMigrations(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{})
|
||||
|
||||
@@ -2,9 +2,9 @@ package collector_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/job/collector"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,11 +3,11 @@ package query
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -2,11 +2,11 @@ package document
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryqueue "queryorchestration/internal/queryQueue"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/job/collector"
|
||||
queryqueue "queryorchestration/internal/query/queue"
|
||||
"queryorchestration/internal/query/result"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/query/document"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -2,7 +2,7 @@ package queryprocessor_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -2,7 +2,7 @@ package queryprocessor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/query/result"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -3,7 +3,7 @@ package queryqueue
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
func (q *Queue) getUnsyncedQueries() {
|
||||
@@ -2,11 +2,11 @@ package queryqueue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/job/collector"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,8 +3,8 @@ package queryqueue
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
@@ -3,12 +3,12 @@ package queryqueue_test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryqueue "queryorchestration/internal/queryQueue"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/job/collector"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
queryqueue "queryorchestration/internal/query/queue"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
+1
-1
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,12 +3,12 @@ package queryqueue
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
)
|
||||
|
||||
func (q *Queue) setResult(ctx context.Context, qu *queryprocessor.Query, resultValues []result.Value) error {
|
||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -2,10 +2,10 @@ package queryqueue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/job/collector"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -3,12 +3,12 @@ package queryqueue_test
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"queryorchestration/internal/collector"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryqueue "queryorchestration/internal/queryQueue"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/job/collector"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
queryqueue "queryorchestration/internal/query/queue"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -2,7 +2,7 @@ package result_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/result"
|
||||
"queryorchestration/internal/query/result"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,7 +3,7 @@ package contextfull
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
type Creator struct {
|
||||
+2
-2
@@ -2,10 +2,10 @@ package contextfull_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
+3
-3
@@ -2,9 +2,9 @@ package contextfull_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,8 +3,8 @@ package contextfull
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
)
|
||||
|
||||
type Extractor struct {
|
||||
@@ -3,7 +3,7 @@ package contextfull
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
type Updator struct {
|
||||
+2
-2
@@ -2,10 +2,10 @@ package contextfull_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,7 +3,7 @@ package jsonextractor
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
type Creator struct {
|
||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
+4
-4
@@ -3,12 +3,12 @@ package jsonextractor_test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"fmt"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
"queryorchestration/internal/result"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"queryorchestration/internal/query/result"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
@@ -3,7 +3,7 @@ package jsonextractor
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
)
|
||||
|
||||
type Updator struct {
|
||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -3,9 +3,9 @@ package query
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
contextfull "queryorchestration/internal/contextFull"
|
||||
jsonextractor "queryorchestration/internal/jsonExtractor"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
contextfull "queryorchestration/internal/query/types/contextFull"
|
||||
jsonextractor "queryorchestration/internal/query/types/jsonExtractor"
|
||||
)
|
||||
|
||||
func (s *Service) Update(ctx context.Context, entity *queryprocessor.Update) error {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
queryprocessor "queryorchestration/internal/queryProcessor"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
||||
@@ -1,7 +1,7 @@
|
||||
package env_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/env"
|
||||
"queryorchestration/internal/server/env"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -1,7 +1,7 @@
|
||||
package env_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/env"
|
||||
"queryorchestration/internal/server/env"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -2,7 +2,7 @@ package otel_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/otel"
|
||||
"queryorchestration/internal/server/otel"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -2,7 +2,7 @@ package queue_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -3,8 +3,8 @@ package queue
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"queryorchestration/internal/env"
|
||||
"queryorchestration/internal/server"
|
||||
"queryorchestration/internal/server/env"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs"
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"os"
|
||||
"path"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
_, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -2,7 +2,7 @@ package queue_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -18,6 +18,9 @@ func (s MockController) Process(ctx context.Context, config *queue.Config, msg *
|
||||
}
|
||||
|
||||
func TestPollMessages(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -38,6 +41,9 @@ func TestPollMessages(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPollMessage(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -2,7 +2,7 @@ package queue_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestReceive(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -2,7 +2,7 @@ package queue_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestSend(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/otel"
|
||||
"queryorchestration/internal/server/otel"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
)
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{})
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateAPIContainer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
ncfg, ncleanup := test.CreateNetwork(t, ctx)
|
||||
@@ -37,6 +40,9 @@ func TestCreateAPIContainer(t *testing.T) {
|
||||
cleanup()
|
||||
}
|
||||
func TestCreateAPIWithDependencies(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
conn, cleanup := test.CreateAPIWithDependencies(t, ctx, "queryService")
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateContainer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
ncfg, ncleanup := CreateNetwork(t, ctx)
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateDB(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
dbcfg, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{})
|
||||
@@ -23,6 +26,9 @@ func TestCreateDB(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateDBWithMigrations(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
dbcfg, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
||||
|
||||
@@ -3,7 +3,7 @@ package test
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package test_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateQueue(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
qcfg, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
@@ -22,6 +25,9 @@ func TestCreateQueue(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAssertMessageWait(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
qcfg, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
@@ -40,6 +46,9 @@ func TestAssertMessageWait(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAssertMessageBodyWait(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
qcfg, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
@@ -57,6 +66,9 @@ func TestAssertMessageBodyWait(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAssertMessageAttrWait(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
qcfg, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateQueueContainer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
ncfg, ncleanup := CreateNetwork(t, ctx)
|
||||
@@ -47,6 +50,9 @@ func TestCreateQueueContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateQueueWithDependencies(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
conn, cleanup := CreateQueueWithDependencies(t, ctx, "queryRunner")
|
||||
|
||||
+8
-4
@@ -5,18 +5,22 @@ version: '3'
|
||||
|
||||
vars:
|
||||
COVERAGE_FILE: "{{.OUT_DIR}}/coverage.out"
|
||||
INTERNAL: "./internal/..."
|
||||
API: "./api/..."
|
||||
PKG: "./pkg/..."
|
||||
|
||||
tasks:
|
||||
mocks:generate:
|
||||
cmds:
|
||||
- mockery
|
||||
unit:short:
|
||||
deps:
|
||||
- mocks:generate
|
||||
cmds:
|
||||
- go test -short {{.INTERNAL}} {{.API}} {{.PKG}}
|
||||
unit:nocoverage:
|
||||
deps:
|
||||
- mocks:generate
|
||||
vars:
|
||||
INTERNAL: "./internal/..."
|
||||
API: "./api/..."
|
||||
PKG: "./pkg/..."
|
||||
cmds:
|
||||
- mkdir -p {{.OUT_DIR}}
|
||||
- |
|
||||
|
||||
@@ -3,8 +3,8 @@ package integration_test
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/queue"
|
||||
"queryorchestration/internal/query/document"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user