Skip to content
Open
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
17 changes: 16 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,22 @@ below.

The CLI uses [`counterfeiter`](https://github.com/maxbrunsfeld/counterfeiter) to
generate fakes from interfaces for the unit tests. If any changes are made to an
interface, the fakes be should regenerated using counterfeiter:
interface, the fakes be should regenerated using counterfeiter.

### Regenerating all non-legacy fakes

To regenerate fakes for all non-legacy packages (recommended for most cases):

```bash
make generate-fakes
```

This will safely regenerate fakes in the `util`, `plugin`, `command`, `api`, and
`actor` packages without touching the legacy `cf/` codebase.

### Regenerating fakes for a specific package

If you only need to regenerate fakes for a specific package:

```bash
go generate ./<package>/...
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ fly-windows-units:
format: ## Run go fmt
go fmt ./...

generate-fakes: ## Regenerate counterfeiter fakes for non-legacy packages
@echo "Generating fakes for non-legacy packages..."
go generate ./util/... ./plugin/... ./command/... ./api/... ./actor/...
@echo "Fakes generated successfully!"

install-test-deps: ## Install "global" dependencies needed to run tests
# Running `go install <pkg>` without a version specifier will use version specified in go.mod
# See https://go.dev/ref/mod#go-install
Expand Down Expand Up @@ -221,7 +226,7 @@ units-full: build units-plugin units-non-plugin
version: ## Print the version number of what would be built
@echo $(CF_BUILD_VERSION)+$(CF_BUILD_SHA).$(CF_BUILD_DATE)

.PHONY: all build clean format version lint
.PHONY: all build clean format generate-fakes version lint
.PHONY: test units units-full install-test-deps integration integration-tests-full integration-cleanup integration-experimental integration-plugin integration-isolated integration-push
.PHONY: check-target-env fly-windows-experimental fly-windows-isolated fly-windows-plugin fly-windows-push
.PHONY: help
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions actor/pluginaction/pluginactionfakes/fake_command_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions actor/pluginaction/pluginactionfakes/fake_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions actor/pluginaction/pluginactionfakes/fake_plugin_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions actor/pluginaction/pluginactionfakes/fake_plugin_metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions actor/sharedaction/sharedactionfakes/fake_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions actor/sharedaction/sharedactionfakes/fake_log_cache_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions actor/sharedaction/sharedactionfakes/fake_secure_shell_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading