Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement go generate support #280

Merged
merged 3 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM golang:1.14-alpine as builder

COPY ./ /mockery
RUN cd /mockery && go install ./...

FROM golang:1.14-alpine

COPY mockery /
COPY --from=builder /go/bin/mockery /

# Explicitly set a writable cache path when running --user=$(id -u):$(id -g)
# see: https://github.com/golang/go/issues/26280#issuecomment-445294378
ENV GOCACHE /tmp/.cache

ENTRYPOINT ["/mockery"]
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL=bash

all: clean fmt test fixture install integration
all: clean fmt test fixture install docker integration

clean:
rm -rf mocks
Expand All @@ -17,5 +17,8 @@ fixture:
install:
go install ./...

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

integration: docker install
./hack/run-e2e.sh
9 changes: 9 additions & 0 deletions hack/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ verify
reset
${GOPATH}/bin/mockery -all -recursive -cpuprofile="mockery.prof" -srcpkg github.com/vektra/mockery/mockery/fixtures
verify


reset
docker run -v $(pwd):/src -w /src --user=$(id -u):$(id -g) vektra/mockery -all -recursive -cpuprofile="mockery.prof" -dir="mockery/fixtures"
verify

reset
docker run -v $(pwd):/src -w /src --user=$(id -u):$(id -g) vektra/mockery -all -recursive -cpuprofile="mockery.prof" -srcpkg github.com/vektra/mockery/mockery/fixtures
verify