Skip to content

Commit

Permalink
test(proxy): create viper mock (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Dec 14, 2023
1 parent 7d5ca36 commit 78512f9
Show file tree
Hide file tree
Showing 7 changed files with 735 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"gola",
"gomega",
"gomnd",
"gomock",
"gosec",
"gosimple",
"govet",
Expand All @@ -44,6 +45,7 @@
"linters",
"magick",
"memfs",
"mockgen",
"nakedret",
"nicksnyder",
"nolint",
Expand All @@ -69,6 +71,7 @@
"unparam",
"vactive",
"Validatable",
"varargs",
"varcheck"
],
"files.associations": {
Expand Down
4 changes: 4 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ tasks:
- cobrass-gen -test -cwd ./ -templates generators/gola -write
- go fmt ./generators/gola/out/assistant/*.go

co-gen-vc:
cmds:
- go generate src/assistant/configuration

# co-gen:
# cmds:
# - go generate ./...
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/mock v0.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/tools v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
Expand Down
2 changes: 2 additions & 0 deletions src/assistant/configuration/global-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/spf13/viper"
)

//go:generate mockgen -destination ../mocks/mock-global-viper-config.go -package mocks -source global-config.go -mock_names ViperConfig=MockViperConfig

type ViperConfig interface {
AddConfigPath(in string)
AutomaticEnv()
Expand Down
Loading

0 comments on commit 78512f9

Please sign in to comment.