0ebb8a21a1
Clean Up Testing and Linting * somescriptcleanup * mostgolangci * deplatest * imageversions * usingscratch * movedqueuefrtesting * finishedunittesting * linting * taskfilecontext
31 lines
750 B
Go
31 lines
750 B
Go
package repository_test
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/database"
|
|
"queryorchestration/internal/database/repository"
|
|
"testing"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCollector(t *testing.T) {
|
|
ctx := context.Background()
|
|
db, cleanup := createDB(t, ctx)
|
|
defer cleanup()
|
|
queries := repository.New(db.pool)
|
|
|
|
collectorID := database.MustToDBUUID(uuid.New())
|
|
|
|
collectorQueries, err := queries.GetCollectorQueries(ctx, collectorID)
|
|
assert.Nil(t, err)
|
|
assert.Len(t, collectorQueries, 0)
|
|
assert.ElementsMatch(t, []repository.GetCollectorQueriesRow{}, collectorQueries)
|
|
|
|
jobID := database.MustToDBUUID(uuid.New())
|
|
|
|
_, err = queries.GetCollectorFromJobID(ctx, jobID)
|
|
assert.NotNil(t, err)
|
|
}
|