diff --git a/.gitignore b/.gitignore index c9c9e20..0baf7f3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ cypress-videos/ *.out # Dependency directories (remove the comment below to include it) -# vendor/ +vendor/ swagger/ # Common text editors diff --git a/server/test/test_repository.go b/server/test/test_repository.go index 2336944..6eef984 100644 --- a/server/test/test_repository.go +++ b/server/test/test_repository.go @@ -196,7 +196,7 @@ const sortQuery = ` ORDER BY t.version DESC LIMIT 1` func (r *repository) get(ctx context.Context, id id.ID) (Test, error) { query, params := sqlutil.TenantWithPrefix(ctx, getTestSQL+" WHERE t.id = $1", "t.", id) - test, err := r.readRow(ctx, r.db.QueryRowContext(ctx, query+sortQuery, params...)) + test, err := r.readRow(ctx, r.db.QueryRowContext(ctx, query+" "+sortQuery, params...)) if err != nil { return Test{}, err } @@ -208,7 +208,7 @@ func (r *repository) GetTestSuiteSteps(ctx context.Context, id id.ID, version in sortQuery := ` ORDER BY ts.step_number ASC` query, params := sqlutil.TenantWithPrefix(ctx, getTestSQL+testMaxVersionQuery+` INNER JOIN test_suite_steps ts ON t.id = ts.test_id WHERE ts.test_suite_id = $1 AND ts.test_suite_version = $2`, "t.", id, version) - stmt, err := r.db.Prepare(query + sortQuery) + stmt, err := r.db.Prepare(query + " "+sortQuery) if err != nil { return []Test{}, fmt.Errorf("prepare 2: %w", err) } diff --git a/server/testsuite/testsuite_run_repository.go b/server/testsuite/testsuite_run_repository.go index 791c110..2ea4280 100644 --- a/server/testsuite/testsuite_run_repository.go +++ b/server/testsuite/testsuite_run_repository.go @@ -340,7 +340,7 @@ func (td *RunRepository) GetTestSuiteRun(ctx context.Context, ID id.ID, runID in func (td *RunRepository) GetLatestRunByTestSuiteVersion(ctx context.Context, ID id.ID, version int) (TestSuiteRun, error) { sortQuery := " ORDER BY created_at DESC LIMIT 1" query, params := sqlutil.Tenant(ctx, selectTestSuiteRunQuery+" WHERE test_suite_id = $1 AND test_suite_version = $2", ID, version) - stmt, err := td.db.Prepare(query + sortQuery) + stmt, err := td.db.Prepare(query +" "+sortQuery) if err != nil { return TestSuiteRun{}, fmt.Errorf("prepare: %w", err) } @@ -359,7 +359,7 @@ func (td *RunRepository) GetLatestRunByTestSuiteVersion(ctx context.Context, ID func (td *RunRepository) GetTestSuiteRuns(ctx context.Context, ID id.ID, take, skip int32) ([]TestSuiteRun, error) { sortQuery := " ORDER BY created_at DESC LIMIT $2 OFFSET $3" query, params := sqlutil.Tenant(ctx, selectTestSuiteRunQuery+" WHERE test_suite_id = $1", ID.String(), take, skip) - stmt, err := td.db.Prepare(query + sortQuery) + stmt, err := td.db.Prepare(query +" "+ sortQuery) if err != nil { return []TestSuiteRun{}, fmt.Errorf("prepare: %w", err) }