fix: stop go-test-plugin from mutating plugin go.mod

The target ran `go get github.com/onsi/gomega` inside the plugin module before every test run, which rewrote that plugin's `go.mod` and `go.sum` as a side effect of running tests. For a plugin that does not use gomega it added the module plus five transitive dependencies as unused indirect requirements, and for one that pins it the `go get` silently upgraded the pinned version, leaving the working tree dirty and fighting the dependency updates. The plugins whose tests use gomega already require it directly, and the test run passes `-mod=readonly`, so nothing needs to be fetched ahead of time.
This commit is contained in:
Jose Diaz-Gonzalez
2026-09-02 04:09:20 -04:00
parent 326607e356
commit e50bcd4a3b

View File

@@ -191,7 +191,7 @@ go-tests:
@$(MAKE) go-test-plugin PLUGIN_NAME=traefik-vhosts
go-test-plugin:
cd plugins/$(PLUGIN_NAME) && go get github.com/onsi/gomega && DOKKU_ROOT=/home/dokku DOKKU_LIB_ROOT=/var/lib/dokku go test -v -p 1 -race -mod=readonly || exit $$?
cd plugins/$(PLUGIN_NAME) && DOKKU_ROOT=/home/dokku DOKKU_LIB_ROOT=/var/lib/dokku go test -v -p 1 -race -mod=readonly || exit $$?
go-test-plugin-in-docker:
@echo running go unit tests...