This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree 7 files changed +34
-7
lines changed
7 files changed +34
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
11
11
ENV GO111MODULE on
12
12
# Install Go Tools
13
13
RUN go get -u golang.org/x/lint/golint
14
- RUN go get -u github.com/golang/mock/mockgen
15
14
16
15
17
16
WORKDIR /src
Original file line number Diff line number Diff line change @@ -580,6 +580,19 @@ Make sure you use the latest version in the image tag. Alternatiely you can use
580
580
likely to break at any time.
581
581
582
582
583
+ # # Testing
584
+
585
+ # ## Unit Tests
586
+
587
+ To unit test *aws-nuke*, some tests require [gomock](https://github.com/golang/mock) to run.
588
+ This will run via `go generate ./...`, but is automatically run via `make test`.
589
+ To run the unit tests :
590
+
591
+ ` ` ` bash
592
+ make test
593
+ ` ` `
594
+
595
+
583
596
# # Contact Channels
584
597
585
598
Feel free to create a GitHub Issue for any questions, bug reports or feature
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ go run github.com/golang/mock/mockgen -source $( go list -m -f " {{.Dir}}" " github.com/aws/aws-sdk-go" ) /service/cloudformation/cloudformationiface/interface.go -destination mocks/mock_cloudformationiface/mock.go
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ //go:generate ./generate_mocks
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO
71
71
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a /go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs =
72
72
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg =
73
73
golang.org/x/text v0.3.0 /go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ =
74
+ golang.org/x/tools v0.0.0-20190425150028-36563e24a262 h1:qsl9y/CJx34tuA7QCPNp86JNJe4spst6Ff8MjvPUdPg =
74
75
golang.org/x/tools v0.0.0-20190425150028-36563e24a262 /go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q =
75
76
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
76
77
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
Original file line number Diff line number Diff line change @@ -41,19 +41,19 @@ vet: vendor
41
41
lint :
42
42
$(foreach pkg,$(GOPKGS ) ,golint $(pkg ) ;)
43
43
44
- generate_mocks :
44
+ go_generate :
45
45
rm mocks -rvf
46
- mockgen -source $( shell go list -m -f "{{.Dir}}" "github.com/aws/aws-sdk-go") /service/cloudformation/cloudformationiface/interface.go -destination mocks/mock_cloudformationiface/mock.go
46
+ go generate ./...
47
47
48
48
test_packages : vendor
49
49
go test $(GOPKGS )
50
50
51
51
test_format :
52
52
gofmt -s -l $(GOFILES )
53
53
54
- test : test_format generate_mocks vet lint test_packages
54
+ test : test_format go_generate vet lint test_packages
55
55
56
- cov : generate_mocks
56
+ cov : go_generate
57
57
gocov test -v $(GOPKGS ) \
58
58
| gocov-html > coverage.html
59
59
@@ -80,5 +80,5 @@ install: vendor test
80
80
$(BUILD_FLAGS ) ; )
81
81
82
82
clean :
83
- rm dist/ -rv
84
- rm mocks/ -rv
83
+ rm dist/ -rvf
84
+ rm mocks/ -rvf
Original file line number Diff line number Diff line change
1
+ // +build tools
2
+
3
+ package main
4
+
5
+ // https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
6
+ import (
7
+ _ "github.com/golang/mock/mockgen"
8
+ )
You can’t perform that action at this time.
0 commit comments