Skip to content

Commit a178e95

Browse files
authored
Do mock generation consistently (#1368)
This PR adds taskfile commands to install the mock generator and run them as part of build and test. In at least one instance, we had mocks generated with the wrong generator, this PR fixes that too.
1 parent 023dfc0 commit a178e95

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

Taskfile.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ tasks:
2323
cmds:
2424
- swag init -g pkg/api/server.go --v3.1 -o docs/server
2525

26+
mock-install:
27+
desc: Install the mockgen tool for mock generation
28+
cmds:
29+
- go install go.uber.org/mock/mockgen@latest
30+
31+
mock-gen:
32+
desc: Generate mock files using go generate
33+
deps: [mock-install]
34+
cmds:
35+
- go generate ./...
36+
2637
lint:
2738
desc: Run linting tools
2839
cmds:
@@ -53,6 +64,7 @@ tasks:
5364

5465
test:
5566
desc: Run unit tests (excluding e2e tests)
67+
deps: [mock-gen]
5668
cmds:
5769
- task: test-unixlike
5870
platforms: [linux, darwin]
@@ -128,6 +140,7 @@ tasks:
128140

129141
build:
130142
desc: Build the binary
143+
deps: [mock-gen]
131144
vars:
132145
VERSION:
133146
sh: git describe --tags --always --dirty --match "v*" || echo "dev"

pkg/transport/types/mocks/mock_tunnel_provider.go

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)