From e8ea7117cee8b57a4c103bf81c2a0f42ab3c4b75 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Mon, 22 Apr 2024 14:10:51 +0000 Subject: [PATCH] Fix tests post-rebase Signed-off-by: Gabriel Adrian Samfira --- database/sql/enterprise_test.go | 4 ++-- database/sql/organizations_test.go | 4 ++-- database/sql/repositories_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/database/sql/enterprise_test.go b/database/sql/enterprise_test.go index d49b25bd..2a26c11d 100644 --- a/database/sql/enterprise_test.go +++ b/database/sql/enterprise_test.go @@ -216,8 +216,8 @@ func (s *EnterpriseTestSuite) TestCreateEnterpriseInvalidDBPassphrase() { func (s *EnterpriseTestSuite) TestCreateEnterpriseDBCreateErr() { s.Fixtures.SQLMock.ExpectBegin() s.Fixtures.SQLMock. - ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT 1")). - WithArgs(s.Fixtures.Enterprises[0].CredentialsName). + ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT ?")). + WithArgs(s.Fixtures.Enterprises[0].CredentialsName, 1). WillReturnRows(sqlmock.NewRows([]string{"id", "endpoint_name"}).AddRow(s.testCreds.ID, s.testCreds.Endpoint.Name)) s.Fixtures.SQLMock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_endpoints` WHERE `github_endpoints`.`name` = ? AND `github_endpoints`.`deleted_at` IS NULL")). WithArgs(s.testCreds.Endpoint.Name). diff --git a/database/sql/organizations_test.go b/database/sql/organizations_test.go index 9954b978..ae880da7 100644 --- a/database/sql/organizations_test.go +++ b/database/sql/organizations_test.go @@ -217,8 +217,8 @@ func (s *OrgTestSuite) TestCreateOrganizationInvalidDBPassphrase() { func (s *OrgTestSuite) TestCreateOrganizationDBCreateErr() { s.Fixtures.SQLMock.ExpectBegin() s.Fixtures.SQLMock. - ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT 1")). - WithArgs(s.Fixtures.Orgs[0].CredentialsName). + ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT ?")). + WithArgs(s.Fixtures.Orgs[0].CredentialsName, 1). WillReturnRows(sqlmock.NewRows([]string{"id", "endpoint_name"}). AddRow(s.testCreds.ID, s.githubEndpoint.Name)) s.Fixtures.SQLMock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_endpoints` WHERE `github_endpoints`.`name` = ? AND `github_endpoints`.`deleted_at` IS NULL")). diff --git a/database/sql/repositories_test.go b/database/sql/repositories_test.go index 3ff780a4..5a67abd1 100644 --- a/database/sql/repositories_test.go +++ b/database/sql/repositories_test.go @@ -233,8 +233,8 @@ func (s *RepoTestSuite) TestCreateRepositoryInvalidDBPassphrase() { func (s *RepoTestSuite) TestCreateRepositoryInvalidDBCreateErr() { s.Fixtures.SQLMock.ExpectBegin() s.Fixtures.SQLMock. - ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT 1")). - WithArgs(s.Fixtures.Repos[0].CredentialsName). + ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_credentials` WHERE name = ? AND `github_credentials`.`deleted_at` IS NULL ORDER BY `github_credentials`.`id` LIMIT ?")). + WithArgs(s.Fixtures.Repos[0].CredentialsName, 1). WillReturnRows(sqlmock.NewRows([]string{"id", "endpoint_name"}). AddRow(s.testCreds.ID, s.githubEndpoint.Name)) s.Fixtures.SQLMock.ExpectQuery(regexp.QuoteMeta("SELECT * FROM `github_endpoints` WHERE `github_endpoints`.`name` = ? AND `github_endpoints`.`deleted_at` IS NULL")).