Skip to content

Commit

Permalink
Fix Makefile, move two mocks to correct folder, refactor test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
grongor committed Sep 13, 2021
1 parent ead8b66 commit 45dc76a
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 462 deletions.
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
SHELL=bash

all: clean fmt test fixture install docker integration
.PHONY: all
all: clean fmt mocks test install docker integration

.PHONY: clean
clean:
rm -rf mocks

.PHONY: fmt
fmt:
go fmt ./...

test:
.PHONY: test
test: mocks
go test ./...

fixture:
mockery --print --dir pkg/fixtures --name RequesterVariadic > pkg/fixtures/mocks/requester_variadic.go
mockery --print --dir pkg/fixtures --name RequesterVariadic --unroll-variadic=False > pkg/fixtures/mocks/requester_variadic_one_arg.go
mocks: $(shell find . -type f -name '*.go' -not -name '*_test.go')
go run . --dir pkg/fixtures --output mocks/pkg/fixtures
go run . --all=false --print --dir pkg/fixtures --name RequesterVariadic --structname RequesterVariadicOneArgument --unroll-variadic=False > mocks/pkg/fixtures/RequesterVariadicOneArgument.go
@touch mocks

.PHONY: install
install:
go install ./...
go install .

.PHONY: docker
docker:
docker build -t vektra/mockery .

.PHONY: integration
integration: docker install
./hack/run-e2e.sh
29 changes: 0 additions & 29 deletions mocks/cmd/stackTracer.go

This file was deleted.

24 changes: 0 additions & 24 deletions mocks/pkg/Cleanup.go

This file was deleted.

49 changes: 0 additions & 49 deletions mocks/pkg/OutputStreamProvider.go

This file was deleted.

29 changes: 0 additions & 29 deletions mocks/pkg/WalkerVisitor.go

This file was deleted.

24 changes: 0 additions & 24 deletions mocks/pkg/namer.go

This file was deleted.

88 changes: 0 additions & 88 deletions pkg/fixtures/mocks/requester_variadic.go

This file was deleted.

70 changes: 0 additions & 70 deletions pkg/fixtures/mocks/requester_variadic_one_arg.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func upperFirstOnly(s string) string {
return unicode.ToUpper(r)
}
return r
},s)
}, s)
}

func (g *Generator) mockName() string {
Expand Down
Loading

0 comments on commit 45dc76a

Please sign in to comment.