Skip to content

Commit 58e763d

Browse files
authored
chore: Follow-up to Mockery followup (#288)
1 parent bcf87d0 commit 58e763d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.mockery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
with-expecter: true
22
disable-version-string: true
3-
dir: ../mockadmin
3+
dir: mockadmin
44
outpkg: mockadmin
55
filename: "{{ .InterfaceName | snakecase }}.go"
66
mockname: "{{.InterfaceName}}"

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Repository contains following SDKs
8484
- `tools`: tooling used to generate Atlas Admin SDK. See [./tools](./tools) for more information.
8585
- `examples`: SDK examples
8686
- `internal`: folder for hosting non user facing SDK methods and core helpers
87+
- `mockadmin`: [Testify mocks](https://pkg.go.dev/github.com/stretchr/testify/mock) generated with [Mockery](https://github.com/vektra/mockery) for API interfaces
8788

8889
## VSCode debugging configuration
8990
VSCode developers might use following debugging configuration for transformer and go debugging

tools/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ update-version:
4444

4545
.PHONY: generate_mocks
4646
generate_mocks:
47-
go install github.com/vektra/mockery/[email protected]
48-
rm -Rf ../mockadmin
49-
mockery
47+
./scripts/generate_mocks.sh

tools/scripts/generate_mocks.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
rm -Rf ../mockadmin
3+
4+
# install only if not already present
5+
if ! which mockery ; then
6+
docker run --rm -v "$(dirname "$PWD")":/src --workdir=/src vektra/mockery:v2.42.1
7+
else
8+
mockery --dir ../mockadmin
9+
fi

0 commit comments

Comments
 (0)