Skip to content
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ before_script:
# Install dependencies for testing.
- go get github.com/golang/mock/gomock@v1.2.0
- go get github.com/golang/mock/mockgen@v1.2.0
# Generate the mocks for testing.
- go generate ./...

script:
- make test
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ gofmt_test:
$(VERB) echo "Running 'go fmt' test ..."
$(VERB) ./gofmt_test.sh

ghutil_test:
$(VERB) echo
$(VERB) echo "Running tests in 'ghutil' recursively ..."
$(VERB) $(MAKE) VERBOSE=$(VERBOSE) -s -C ghutil test

go_mod_tidy_test:
$(VERB) echo "Running 'go mod tidy' test ..."
$(VERB) ./go_mod_tidy_test.sh

test: go_test gofmt_test ghutil_test go_mod_tidy_test
test: go_test gofmt_test go_mod_tidy_test
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,26 @@ $ go get github.com/golang/mock/gomock@v1.2.0
$ go get github.com/golang/mock/mockgen@v1.2.0
```

Generate the mocks:

```bash
$ go generate ./...
```

This specific version of both `gomock` and `mockgen` tools is what's used in
this repo, and tests will fail if your version of these tools generates
different code, including comments.

To update the versions of these tools used in this repo:

1. update the version numbers in this file (above) and in
[`.travis.yml`](.travis.yml) to match
1. run the commands above to get those specific versions of the tools
1. update the generated code in this repo via:

```bash
$ cd ghutil
$ rm -f mock_ghutil.go
$ make mock
```

1. update the version numbers in this file (above) as well as in
[`.travis.yml`](.travis.yml) and [`go.mod`](go.mod) to match
1. run `go mod tidy` to update the `go.sum` file
1. run the updated `go get` commands above to get newer versions of the tools
1. run the `go generate` command above to regenerate the mocks
1. [run the tests](#testing) from the top-level of the tree
1. commit your changes to this file (`README.md`), `.travis.yml`, and
`ghutil/mock_ghutil.go` and make sure the build passes on Travis CI before
merging the change
1. commit your changes to this file (`README.md`) and `.travis.yml`, making
sure that the build passes on Travis CI before merging the change

## Testing

Expand Down
1 change: 1 addition & 0 deletions ghutil/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mock_ghutil.go
33 changes: 0 additions & 33 deletions ghutil/Makefile

This file was deleted.

4 changes: 4 additions & 0 deletions ghutil/ghutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// TODO(mbrukman): in the future, consider using the recently-added
// `-copyright_filename` flag: https://github.com/golang/mock/pull/234

//go:generate mockgen -source ghutil.go -destination mock_ghutil.go -package ghutil
package ghutil

import (
Expand Down
261 changes: 0 additions & 261 deletions ghutil/mock_ghutil.go

This file was deleted.

14 changes: 0 additions & 14 deletions ghutil/mock_header.txt

This file was deleted.