Skip to content

Commit

Permalink
mocks: regenerate mocks again with added configuration for expected c…
Browse files Browse the repository at this point in the history
…alls and added CI job to ensure we don't miss mocks in the future;
  • Loading branch information
ajscholl committed Jul 5, 2023
1 parent ca50171 commit 7733180
Show file tree
Hide file tree
Showing 132 changed files with 37,012 additions and 64 deletions.
47 changes: 39 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -37,14 +37,45 @@ jobs:
- name: Execute test -z $(gofmt -l .)
run: test -z $(gofmt -l .)

mockery:
name: mockery
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.20"

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Install mockery
run: go install github.com/vektra/mockery/[email protected]

- name: Execute mockery
run: go generate -run='mockery' ./...

- name: Check for empty diff
run: |
git add -A *
changes=$(git status -s | grep -E '^[ ]?M|A') || true
if [ "0" != $(echo -n $changes | wc -c) ]; then
git status -s | grep -E '^[ ]?M|A'
echo "please check the file list above and (re-)create those mocks locally with the mockery version v2.22.1!"
echo "here's the diff:"
git diff HEAD~0
echo "end of diff"
exit 1
fi
build:
name: go build
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -62,7 +93,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -80,7 +111,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -98,7 +129,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -116,7 +147,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -134,7 +165,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -152,7 +183,7 @@ jobs:
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: "1.18"

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .mockery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
inpackage: false
testonly: false
with-expecter: true
keeptree: true
unroll-variadic: true
36 changes: 36 additions & 0 deletions pkg/apiserver/auth/mocks/Authenticator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions pkg/apiserver/auth/mocks/JwtTokenHandler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions pkg/apiserver/auth/mocks/TokenInfoProvider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions pkg/apiserver/crud/mocks/BaseCreateHandler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7733180

Please sign in to comment.