chore: quote test name patterns in make targets (#39429)

`test-backend#%` and `test-integration#%` passed the test name to the
shell unquoted, so regex characters broke the command. For example `make
'test-backend#^(TestA|TestB)$'` failed with `syntax error near
unexpected token '('`. The pattern is now single-quoted like the
neighbouring `-tags` argument.
This commit is contained in:
silverwind
2026-09-25 14:32:51 +00:00
committed by GitHub
parent d42128d71d
commit a7b0327ff6
+2 -2
View File
@@ -403,7 +403,7 @@ test-check:
.PHONY: test-backend\#%
test-backend\#%:
@echo "Running go test with -tags '$(TAGS)'..."
@$(GO) test $(GOTEST_FLAGS) -tags='$(TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES)
@$(GO) test $(GOTEST_FLAGS) -tags='$(TAGS)' -run '$(subst .,/,$*)' $(GO_TEST_PACKAGES)
.PHONY: coverage
coverage:
@@ -460,7 +460,7 @@ test-integration-compile:
.PHONY: test-integration\#%
test-integration\#%: $(EXECUTABLE)
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' -run $(subst .,/,$*) gitea.dev/tests/integration
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' -run '$(subst .,/,$*)' gitea.dev/tests/integration
.PHONY: test-migration
test-migration: migrations.integration.test migrations.individual.test