fixed runner tests
This commit is contained in:
parent
f9f917ba05
commit
dce1808860
6 changed files with 13 additions and 6 deletions
|
|
@ -354,7 +354,7 @@ func (s *EnterpriseTestSuite) TestUpdateEnterpriseDBSaveErr() {
|
|||
|
||||
func (s *EnterpriseTestSuite) TestUpdateEnterpriseDBDecryptingErr() {
|
||||
s.StoreSQLMocked.cfg.Passphrase = "wrong-passphrase"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "some-webhook-secret"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "webhook-secret"
|
||||
|
||||
s.Fixtures.SQLMock.
|
||||
ExpectQuery(regexp.QuoteMeta("SELECT * FROM `enterprises` WHERE id = ? AND `enterprises`.`deleted_at` IS NULL ORDER BY `enterprises`.`id` LIMIT 1")).
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ func (s *OrgTestSuite) TestUpdateOrganizationDBSaveErr() {
|
|||
|
||||
func (s *OrgTestSuite) TestUpdateOrganizationDBDecryptingErr() {
|
||||
s.StoreSQLMocked.cfg.Passphrase = "wrong-passphrase"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "some-webhook-secret"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "webhook-secret"
|
||||
|
||||
s.Fixtures.SQLMock.
|
||||
ExpectQuery(regexp.QuoteMeta("SELECT * FROM `organizations` WHERE id = ? AND `organizations`.`deleted_at` IS NULL ORDER BY `organizations`.`id` LIMIT 1")).
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ func (s *RepoTestSuite) TestUpdateRepositoryDBSaveErr() {
|
|||
|
||||
func (s *RepoTestSuite) TestUpdateRepositoryDBDecryptingErr() {
|
||||
s.StoreSQLMocked.cfg.Passphrase = "wrong-passphrase"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "some-webhook-secret"
|
||||
s.Fixtures.UpdateRepoParams.WebhookSecret = "webhook-secret"
|
||||
|
||||
s.Fixtures.SQLMock.
|
||||
ExpectQuery(regexp.QuoteMeta("SELECT * FROM `repositories` WHERE id = ? AND `repositories`.`deleted_at` IS NULL ORDER BY `repositories`.`id` LIMIT 1")).
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ package runner
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"garm/auth"
|
||||
"garm/config"
|
||||
"garm/database"
|
||||
|
|
@ -27,7 +29,6 @@ import (
|
|||
"garm/runner/common"
|
||||
runnerCommonMocks "garm/runner/common/mocks"
|
||||
runnerMocks "garm/runner/mocks"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
@ -106,6 +107,7 @@ func (s *EnterpriseTestSuite) SetupTest() {
|
|||
CreateEnterpriseParams: params.CreateEnterpriseParams{
|
||||
Name: "test-enterprise-create",
|
||||
CredentialsName: "test-creds",
|
||||
WebhookSecret: "test-create-enterprise-webhook-secret",
|
||||
},
|
||||
CreatePoolParams: params.CreatePoolParams{
|
||||
ProviderName: "test-provider",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ package runner
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"garm/auth"
|
||||
"garm/config"
|
||||
"garm/database"
|
||||
|
|
@ -27,7 +29,6 @@ import (
|
|||
"garm/runner/common"
|
||||
runnerCommonMocks "garm/runner/common/mocks"
|
||||
runnerMocks "garm/runner/mocks"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
@ -106,6 +107,7 @@ func (s *OrgTestSuite) SetupTest() {
|
|||
CreateOrgParams: params.CreateOrgParams{
|
||||
Name: "test-org-create",
|
||||
CredentialsName: "test-creds",
|
||||
WebhookSecret: "test-create-org-webhook-secret",
|
||||
},
|
||||
CreatePoolParams: params.CreatePoolParams{
|
||||
ProviderName: "test-provider",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ package runner
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"garm/auth"
|
||||
"garm/config"
|
||||
"garm/database"
|
||||
|
|
@ -27,7 +29,6 @@ import (
|
|||
"garm/runner/common"
|
||||
runnerCommonMocks "garm/runner/common/mocks"
|
||||
runnerMocks "garm/runner/mocks"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
@ -106,6 +107,7 @@ func (s *RepoTestSuite) SetupTest() {
|
|||
Owner: "test-owner-create",
|
||||
Name: "test-repo-create",
|
||||
CredentialsName: "test-creds",
|
||||
WebhookSecret: "test-create-repo-webhook-secret",
|
||||
},
|
||||
CreatePoolParams: params.CreatePoolParams{
|
||||
ProviderName: "test-provider",
|
||||
|
|
@ -404,6 +406,7 @@ func (s *RepoTestSuite) TestGetRepoPoolByIDErrUnauthorized() {
|
|||
|
||||
s.Require().Equal(runnerErrors.ErrUnauthorized, err)
|
||||
}
|
||||
|
||||
func (s *RepoTestSuite) TestDeleteRepoPool() {
|
||||
pool, err := s.Fixtures.Store.CreateRepositoryPool(s.Fixtures.AdminContext, s.Fixtures.StoreRepos["test-repo-1"].ID, s.Fixtures.CreatePoolParams)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue