Skip to content

Commit 0ca2f72

Browse files
authored
chore(mockery): add mockery configuration (#4941)
* update mockery config * update mockery config * rename mockery config * update existing mocks * update mockery config * update mockery config * move cmd mocks to cmd pkg * add hadolint mocks to config * use moved files * remove comment
1 parent 683ca35 commit 0ca2f72

25 files changed

+1562
-148
lines changed

.mockery.yaml .mockery.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1-
quiet: false
21
mockname: "{{.InterfaceName}}"
32
filename: "{{.InterfaceName}}.go"
3+
dir: "{{.InterfaceDir}}/mocks"
44
outpkg: mocks
5+
quiet: false
56
packages:
7+
github.com/SAP/jenkins-library/cmd:
8+
interfaces:
9+
GithubRepoClient:
10+
HadolintPiperFileUtils:
11+
HadolintClient:
12+
github.com/SAP/jenkins-library/pkg/config:
13+
interfaces:
14+
VaultClient:
15+
github.com/SAP/jenkins-library/pkg/jenkins:
16+
interfaces:
17+
Artifact:
18+
Build:
19+
CredentialsManager:
20+
Jenkins:
21+
Job:
22+
Task:
23+
github.com/SAP/jenkins-library/pkg/kubernetes:
24+
interfaces:
25+
HelmExecutor:
626
github.com/influxdata/influxdb-client-go/v2:
727
config:
828
dir: pkg/influx/mocks
@@ -13,8 +33,3 @@ packages:
1333
dir: pkg/influx/mocks
1434
interfaces:
1535
WriteAPIBlocking:
16-
github.com/SAP/jenkins-library/pkg/config:
17-
config:
18-
dir: pkg/config/mocks
19-
interfaces:
20-
VaultClient:

cmd/githubPublishRelease.go

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
piperGithub "github.com/SAP/jenkins-library/pkg/github"
1717
)
1818

19-
// mock generated with: mockery --name GithubRepoClient --dir cmd --output cmd/mocks
2019
type GithubRepoClient interface {
2120
CreateRelease(ctx context.Context, owner string, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
2221
DeleteReleaseAsset(ctx context.Context, owner string, repo string, id int64) (*github.Response, error)

cmd/hadolintExecute.go

-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ import (
1818
const hadolintCommand = "hadolint"
1919

2020
// HadolintPiperFileUtils abstracts piperutils.Files
21-
// mock generated with: mockery --name HadolintPiperFileUtils --dir cmd --output pkg/hadolint/mocks
2221
type HadolintPiperFileUtils interface {
2322
FileExists(filename string) (bool, error)
2423
FileWrite(filename string, data []byte, perm os.FileMode) error
2524
WriteFile(filename string, data []byte, perm os.FileMode) error
2625
}
2726

2827
// HadolintClient abstracts http.Client
29-
// mock generated with: mockery --name hadolintClient --dir cmd --output pkg/hadolint/mocks
3028
type HadolintClient interface {
3129
SetOptions(options piperhttp.ClientOptions)
3230
DownloadFile(url, filename string, header http.Header, cookies []*http.Cookie) error

cmd/hadolintExecute_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package cmd
66
import (
77
"testing"
88

9-
"github.com/SAP/jenkins-library/pkg/hadolint/mocks"
9+
"github.com/SAP/jenkins-library/cmd/mocks"
1010
piperMocks "github.com/SAP/jenkins-library/pkg/mock"
1111
"github.com/stretchr/testify/assert"
1212
"github.com/stretchr/testify/mock"

0 commit comments

Comments
 (0)