fix: execute go get/build with mod in readonly mode

This will avoid issues where a build or test will inadvertently update dependencies, causing drift between what is in code and what is being tested/run.
This commit is contained in:
Jose Diaz-Gonzalez
2024-03-06 01:52:06 -05:00
parent fe993ac14c
commit d346a347a0
2 changed files with 4 additions and 4 deletions

View File

@@ -182,7 +182,7 @@ go-test-plugin:
-v $$PWD:$(GO_REPO_ROOT) \
-w $(GO_REPO_ROOT) \
$(BUILD_IMAGE) \
bash -c "cd plugins/$(PLUGIN_NAME) && go get github.com/onsi/gomega && go test -v -p 1 -race " || exit $$?
bash -c "cd plugins/$(PLUGIN_NAME) && go get github.com/onsi/gomega && go test -v -p 1 -race -mod=readonly " || exit $$?
unit-tests: go-tests
@echo running bats unit tests...