From 0a3efcfb6eddc1a3077dcba87582929c2800c8b8 Mon Sep 17 00:00:00 2001 From: Alberto Pose Date: Wed, 11 Mar 2026 18:14:02 +0000 Subject: [PATCH 1/3] Add GO_TEST_EXEC variable to use gotestsum on CI Introduce a Makefile variable GO_TEST_EXEC (defaulting to "go test") that is set to "gotestsum --" on CI via the GitHub Actions workflow env. Also install gotestsum via mise in the test environment. Closes #2106 Co-Authored-By: Claude Sonnet 4.6 --- .../internal/pkg/templates/all/.config/mise.test.toml | 3 ++- .../internal/pkg/templates/base/.github/workflows/test.yml | 1 + provider-ci/internal/pkg/templates/base/Makefile | 5 +++-- provider-ci/internal/pkg/templates/parameterized-go/Makefile | 5 +++-- provider-ci/test-providers/aws-native/.config/mise.test.toml | 3 ++- provider-ci/test-providers/aws/.config/mise.test.toml | 3 ++- provider-ci/test-providers/aws/.github/workflows/test.yml | 1 + provider-ci/test-providers/aws/Makefile | 5 +++-- provider-ci/test-providers/cloudflare/.config/mise.test.toml | 3 ++- .../test-providers/cloudflare/.github/workflows/test.yml | 1 + provider-ci/test-providers/cloudflare/Makefile | 5 +++-- provider-ci/test-providers/command/.config/mise.test.toml | 3 ++- .../test-providers/docker-build/.config/mise.test.toml | 3 ++- provider-ci/test-providers/docker/.config/mise.test.toml | 3 ++- provider-ci/test-providers/docker/.github/workflows/test.yml | 1 + provider-ci/test-providers/docker/Makefile | 5 +++-- provider-ci/test-providers/eks/.config/mise.test.toml | 3 ++- provider-ci/test-providers/eks/.github/workflows/test.yml | 1 + provider-ci/test-providers/eks/Makefile | 5 +++-- .../kubernetes-cert-manager/.config/mise.test.toml | 3 ++- .../test-providers/kubernetes-coredns/.config/mise.test.toml | 3 ++- .../kubernetes-ingress-nginx/.config/mise.test.toml | 3 ++- provider-ci/test-providers/kubernetes/.config/mise.test.toml | 3 ++- .../pulumi-provider-boilerplate/.config/mise.test.toml | 3 ++- .../test-providers/pulumiservice/.config/mise.test.toml | 3 ++- .../test-providers/pulumiservice/.github/workflows/test.yml | 1 + provider-ci/test-providers/pulumiservice/Makefile | 5 +++-- .../test-providers/terraform-module/.config/mise.test.toml | 3 ++- .../terraform-module/.github/workflows/test.yml | 1 + provider-ci/test-providers/terraform-module/Makefile | 5 +++-- provider-ci/test-providers/xyz/.config/mise.test.toml | 3 ++- provider-ci/test-providers/xyz/.github/workflows/test.yml | 1 + provider-ci/test-providers/xyz/Makefile | 5 +++-- 33 files changed, 67 insertions(+), 34 deletions(-) diff --git a/provider-ci/internal/pkg/templates/all/.config/mise.test.toml b/provider-ci/internal/pkg/templates/all/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/internal/pkg/templates/all/.config/mise.test.toml +++ b/provider-ci/internal/pkg/templates/all/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml index 4c7310af1d..e0c5475bc8 100644 --- a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml +++ b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" #{{ .Config | renderGlobalEnv | indent 2 }}# diff --git a/provider-ci/internal/pkg/templates/base/Makefile b/provider-ci/internal/pkg/templates/base/Makefile index 3e4cd744a8..936ce0dc37 100644 --- a/provider-ci/internal/pkg/templates/base/Makefile +++ b/provider-ci/internal/pkg/templates/base/Makefile @@ -13,6 +13,7 @@ CODEGEN := pulumi-#{{ .Config.GenName }}#-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) #{{- if .Config.GoBuildParallelism }}# PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p #{{ .Config.GoBuildParallelism }}# @@ -341,13 +342,13 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd #{{ .Config.TestFolder }}# && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test #{{- if .Config.TestProviderCmd }}# test_provider_cmd = #{{ .Config.TestProviderCmd }}# #{{- else }}# -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/internal/pkg/templates/parameterized-go/Makefile b/provider-ci/internal/pkg/templates/parameterized-go/Makefile index 3321900bfd..2d5dec8ef5 100644 --- a/provider-ci/internal/pkg/templates/parameterized-go/Makefile +++ b/provider-ci/internal/pkg/templates/parameterized-go/Makefile @@ -11,6 +11,7 @@ GO_MODULE := $(PROJECT) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) #{{- if .Config.GoBuildParallelism }}# PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p #{{ .Config.GoBuildParallelism }}# @@ -125,13 +126,13 @@ bin/$(PROVIDER): $(call build_provider_cmd,$(shell go env GOOS),$(shell go env GOARCH),$(WORKING_DIR)/bin/$(PROVIDER)) test: - cd #{{ .Config.TestFolder }}# && go test -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test #{{- if .Config.TestProviderCmd }}# test_provider_cmd = #{{ .Config.TestProviderCmd }}# #{{- else }}# -test_provider_cmd = go test \ +test_provider_cmd = $(GO_TEST_EXEC) \ -coverprofile="coverage.txt" \ -coverpkg="./..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/aws-native/.config/mise.test.toml b/provider-ci/test-providers/aws-native/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/aws-native/.config/mise.test.toml +++ b/provider-ci/test-providers/aws-native/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/aws/.config/mise.test.toml b/provider-ci/test-providers/aws/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/aws/.config/mise.test.toml +++ b/provider-ci/test-providers/aws/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/aws/.github/workflows/test.yml b/provider-ci/test-providers/aws/.github/workflows/test.yml index fa6167841b..f14f21d305 100644 --- a/provider-ci/test-providers/aws/.github/workflows/test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" AWS_REGION: us-west-2 PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index a8fa05cec0..c7ddb80c1d 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p 2 PULUMI_CONVERT := 1 @@ -245,9 +246,9 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/cloudflare/.config/mise.test.toml b/provider-ci/test-providers/cloudflare/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/cloudflare/.config/mise.test.toml +++ b/provider-ci/test-providers/cloudflare/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml index b4401303d3..3fcf15d69a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" PULUMI_API: https://api.pulumi-staging.io PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 5761e3af8b..d443731d74 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= PULUMI_CONVERT := 1 @@ -252,9 +253,9 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/command/.config/mise.test.toml b/provider-ci/test-providers/command/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/command/.config/mise.test.toml +++ b/provider-ci/test-providers/command/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/docker-build/.config/mise.test.toml b/provider-ci/test-providers/docker-build/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/docker-build/.config/mise.test.toml +++ b/provider-ci/test-providers/docker-build/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/docker/.config/mise.test.toml b/provider-ci/test-providers/docker/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/docker/.config/mise.test.toml +++ b/provider-ci/test-providers/docker/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/docker/.github/workflows/test.yml b/provider-ci/test-providers/docker/.github/workflows/test.yml index c8b9968a6a..422ecad646 100644 --- a/provider-ci/test-providers/docker/.github/workflows/test.yml +++ b/provider-ci/test-providers/docker/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" ARM_CLIENT_ID: 30e520fa-12b4-4e21-b473-9426c5ac2e1e ARM_SUBSCRIPTION_ID: 0282681f-7a9e-424b-80b2-96babd57a8a1 diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index f49cdca149..faae69edfc 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= PULUMI_CONVERT := 1 @@ -257,9 +258,9 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/eks/.config/mise.test.toml b/provider-ci/test-providers/eks/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/eks/.config/mise.test.toml +++ b/provider-ci/test-providers/eks/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/eks/.github/workflows/test.yml b/provider-ci/test-providers/eks/.github/workflows/test.yml index d853c2cc86..63c585e76a 100644 --- a/provider-ci/test-providers/eks/.github/workflows/test.yml +++ b/provider-ci/test-providers/eks/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" AWS_REGION: us-west-2 DOTNET_VERSION: 6.x diff --git a/provider-ci/test-providers/eks/Makefile b/provider-ci/test-providers/eks/Makefile index b8db51da10..518dff3ff5 100644 --- a/provider-ci/test-providers/eks/Makefile +++ b/provider-ci/test-providers/eks/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-gen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= PULUMI_CONVERT := 0 @@ -246,9 +247,9 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd tests && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd tests && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/kubernetes-cert-manager/.config/mise.test.toml b/provider-ci/test-providers/kubernetes-cert-manager/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/kubernetes-cert-manager/.config/mise.test.toml +++ b/provider-ci/test-providers/kubernetes-cert-manager/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/kubernetes-coredns/.config/mise.test.toml b/provider-ci/test-providers/kubernetes-coredns/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/kubernetes-coredns/.config/mise.test.toml +++ b/provider-ci/test-providers/kubernetes-coredns/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/kubernetes-ingress-nginx/.config/mise.test.toml b/provider-ci/test-providers/kubernetes-ingress-nginx/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/kubernetes-ingress-nginx/.config/mise.test.toml +++ b/provider-ci/test-providers/kubernetes-ingress-nginx/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/kubernetes/.config/mise.test.toml b/provider-ci/test-providers/kubernetes/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/kubernetes/.config/mise.test.toml +++ b/provider-ci/test-providers/kubernetes/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/pulumi-provider-boilerplate/.config/mise.test.toml b/provider-ci/test-providers/pulumi-provider-boilerplate/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/pulumi-provider-boilerplate/.config/mise.test.toml +++ b/provider-ci/test-providers/pulumi-provider-boilerplate/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/pulumiservice/.config/mise.test.toml b/provider-ci/test-providers/pulumiservice/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/pulumiservice/.config/mise.test.toml +++ b/provider-ci/test-providers/pulumiservice/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml b/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml index c7894de6b0..b5224cfdb8 100644 --- a/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml +++ b/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" PROVIDER: pulumiservice PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/pulumiservice/Makefile b/provider-ci/test-providers/pulumiservice/Makefile index 7bdf46feb1..681a5cfb24 100644 --- a/provider-ci/test-providers/pulumiservice/Makefile +++ b/provider-ci/test-providers/pulumiservice/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-gen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= PULUMI_CONVERT := 0 @@ -245,9 +246,9 @@ bin/$(PROVIDER): test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/terraform-module/.config/mise.test.toml b/provider-ci/test-providers/terraform-module/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/terraform-module/.config/mise.test.toml +++ b/provider-ci/test-providers/terraform-module/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/terraform-module/.github/workflows/test.yml b/provider-ci/test-providers/terraform-module/.github/workflows/test.yml index c94cf23335..29e5efb58b 100644 --- a/provider-ci/test-providers/terraform-module/.github/workflows/test.yml +++ b/provider-ci/test-providers/terraform-module/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" AWS_REGION: us-west-2 PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/terraform-module/Makefile b/provider-ci/test-providers/terraform-module/Makefile index 75fc6820fa..18e3a7015a 100644 --- a/provider-ci/test-providers/terraform-module/Makefile +++ b/provider-ci/test-providers/terraform-module/Makefile @@ -7,6 +7,7 @@ GO_MODULE := $(PROJECT) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -106,9 +107,9 @@ bin/$(PROVIDER): $(call build_provider_cmd,$(shell go env GOOS),$(shell go env GOARCH),$(WORKING_DIR)/bin/$(PROVIDER)) test: - cd tests && go test -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd tests && $(GO_TEST_EXEC) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = go test \ +test_provider_cmd = $(GO_TEST_EXEC) \ -coverprofile="coverage.txt" \ -coverpkg="./..." \ -parallel $(TESTPARALLELISM) \ diff --git a/provider-ci/test-providers/xyz/.config/mise.test.toml b/provider-ci/test-providers/xyz/.config/mise.test.toml index 7176fabfb3..a97f5ffaf2 100644 --- a/provider-ci/test-providers/xyz/.config/mise.test.toml +++ b/provider-ci/test-providers/xyz/.config/mise.test.toml @@ -1,3 +1,4 @@ # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt -# Overrides for test workflows -- currently empty. +[tools] +"aqua:gotestyourself/gotestsum" = "1.12.0" diff --git a/provider-ci/test-providers/xyz/.github/workflows/test.yml b/provider-ci/test-providers/xyz/.github/workflows/test.yml index 605a96fcff..8ceba69974 100644 --- a/provider-ci/test-providers/xyz/.github/workflows/test.yml +++ b/provider-ci/test-providers/xyz/.github/workflows/test.yml @@ -13,6 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test + GO_TEST_EXEC: "gotestsum --" PULUMI_API: https://api.pulumi-staging.io PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. diff --git a/provider-ci/test-providers/xyz/Makefile b/provider-ci/test-providers/xyz/Makefile index 2ff741b4d3..c4a1c87ac6 100644 --- a/provider-ci/test-providers/xyz/Makefile +++ b/provider-ci/test-providers/xyz/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p 2 PULUMI_CONVERT := 1 @@ -245,9 +246,9 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test -test_provider_cmd = cd provider && go test -v -short \ +test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ -coverpkg="./...,github.com/hashicorp/terraform-provider-..." \ -parallel $(TESTPARALLELISM) \ From e6b89f5ae95a28b1142a64f89f68c3988105d18c Mon Sep 17 00:00:00 2001 From: Alberto Pose Date: Thu, 12 Mar 2026 09:57:29 +0000 Subject: [PATCH 2/3] Converge test execution into Makefile; fix GO_TEST_EXEC propagation The previous approach set GO_TEST_EXEC in the workflow env and relied on Make's ?= to pick it up. This worked for the sharded path (make test) but not the non-sharded path, which called go test directly in the workflow YAML. This change moves all test invocations through make by: - Adding TESTTAGS ?= all to control build tags (replaces hardcoded -tags=all) - Replacing direct `go test` calls in the non-sharded workflow steps with `make TESTTAGS= GOTESTARGS= test` GO_TEST_EXEC ?= go test in the Makefile now correctly controls the test executor for both sharded and non-sharded paths, and the workflow env GO_TEST_EXEC: "gotestsum --" is picked up via ?= in both cases. Co-Authored-By: Claude Sonnet 4.6 --- .../internal/pkg/templates/base/.github/workflows/test.yml | 7 +++---- provider-ci/internal/pkg/templates/base/Makefile | 3 ++- .../internal/pkg/templates/parameterized-go/Makefile | 3 ++- provider-ci/test-providers/aws/Makefile | 3 ++- .../test-providers/cloudflare/.github/workflows/test.yml | 7 +++---- provider-ci/test-providers/cloudflare/Makefile | 3 ++- .../test-providers/docker/.github/workflows/test.yml | 4 ++-- provider-ci/test-providers/docker/Makefile | 3 ++- provider-ci/test-providers/eks/Makefile | 3 ++- provider-ci/test-providers/pulumiservice/Makefile | 3 ++- provider-ci/test-providers/terraform-module/Makefile | 3 ++- provider-ci/test-providers/xyz/.github/workflows/test.yml | 4 ++-- provider-ci/test-providers/xyz/Makefile | 3 ++- 13 files changed, 28 insertions(+), 21 deletions(-) diff --git a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml index e0c5475bc8..b3230201c3 100644 --- a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml +++ b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml @@ -172,19 +172,18 @@ jobs: #{{- if .Config.IntegrationTestProvider }}# - name: Run provider tests if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover" test_provider env: #{{ .Config | renderLocalEnv | indent 8 }}# #{{- end }}# - name: Run tests if: matrix.testTarget == 'local' - run: cd #{{ .Config.TestFolder }}# && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -skip TestPulumiExamples" test env: #{{ .Config | renderLocalEnv | indent 8 }}# - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -run TestPulumiExamples" test env: #{{ .Config | renderLocalEnv | indent 8 }}# #{{- else }}# diff --git a/provider-ci/internal/pkg/templates/base/Makefile b/provider-ci/internal/pkg/templates/base/Makefile index 936ce0dc37..94a8fb494c 100644 --- a/provider-ci/internal/pkg/templates/base/Makefile +++ b/provider-ci/internal/pkg/templates/base/Makefile @@ -13,6 +13,7 @@ CODEGEN := pulumi-#{{ .Config.GenName }}#-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) #{{- if .Config.GoBuildParallelism }}# @@ -342,7 +343,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test #{{- if .Config.TestProviderCmd }}# diff --git a/provider-ci/internal/pkg/templates/parameterized-go/Makefile b/provider-ci/internal/pkg/templates/parameterized-go/Makefile index 2d5dec8ef5..fb9e32c9ae 100644 --- a/provider-ci/internal/pkg/templates/parameterized-go/Makefile +++ b/provider-ci/internal/pkg/templates/parameterized-go/Makefile @@ -11,6 +11,7 @@ GO_MODULE := $(PROJECT) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) #{{- if .Config.GoBuildParallelism }}# @@ -126,7 +127,7 @@ bin/$(PROVIDER): $(call build_provider_cmd,$(shell go env GOOS),$(shell go env GOARCH),$(WORKING_DIR)/bin/$(PROVIDER)) test: - cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd #{{ .Config.TestFolder }}# && $(GO_TEST_EXEC) -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test #{{- if .Config.TestProviderCmd }}# diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index c7ddb80c1d..4eb7342e96 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p 2 @@ -246,7 +247,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml index 3fcf15d69a..6d8b733e54 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml @@ -106,8 +106,7 @@ jobs: run: make install_${{ matrix.language}}_sdk - name: Run provider tests if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover" test_provider env: CLOUDFLARE_ACCOUNT_ID: ${{ steps.esc-secrets.outputs.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ steps.esc-secrets.outputs.CLOUDFLARE_API_TOKEN }} @@ -115,7 +114,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -skip TestPulumiExamples" test env: CLOUDFLARE_ACCOUNT_ID: ${{ steps.esc-secrets.outputs.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ steps.esc-secrets.outputs.CLOUDFLARE_API_TOKEN }} @@ -123,7 +122,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -run TestPulumiExamples" test env: CLOUDFLARE_ACCOUNT_ID: ${{ steps.esc-secrets.outputs.CLOUDFLARE_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ steps.esc-secrets.outputs.CLOUDFLARE_API_TOKEN }} diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index d443731d74..25648d66c2 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -253,7 +254,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/docker/.github/workflows/test.yml b/provider-ci/test-providers/docker/.github/workflows/test.yml index 422ecad646..dd8fc6e3eb 100644 --- a/provider-ci/test-providers/docker/.github/workflows/test.yml +++ b/provider-ci/test-providers/docker/.github/workflows/test.yml @@ -138,7 +138,7 @@ jobs: run: make install_${{ matrix.language}}_sdk - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -skip TestPulumiExamples" test env: ARM_CLIENT_SECRET: ${{ steps.esc-secrets.outputs.ARM_CLIENT_SECRET }} DIGITALOCEAN_TOKEN: ${{ steps.esc-secrets.outputs.DIGITALOCEAN_TOKEN }} @@ -147,7 +147,7 @@ jobs: PRIVATE_SSH_KEY_FOR_DIGITALOCEAN: ${{ steps.esc-secrets.outputs.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -run TestPulumiExamples" test env: ARM_CLIENT_SECRET: ${{ steps.esc-secrets.outputs.ARM_CLIENT_SECRET }} DIGITALOCEAN_TOKEN: ${{ steps.esc-secrets.outputs.DIGITALOCEAN_TOKEN }} diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index faae69edfc..edb1dcfba8 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -258,7 +259,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/eks/Makefile b/provider-ci/test-providers/eks/Makefile index 518dff3ff5..decb4dbb07 100644 --- a/provider-ci/test-providers/eks/Makefile +++ b/provider-ci/test-providers/eks/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-gen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -247,7 +248,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd tests && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd tests && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/pulumiservice/Makefile b/provider-ci/test-providers/pulumiservice/Makefile index 681a5cfb24..086d1f320c 100644 --- a/provider-ci/test-providers/pulumiservice/Makefile +++ b/provider-ci/test-providers/pulumiservice/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-gen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -246,7 +247,7 @@ bin/$(PROVIDER): test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/terraform-module/Makefile b/provider-ci/test-providers/terraform-module/Makefile index 18e3a7015a..c3ddc111be 100644 --- a/provider-ci/test-providers/terraform-module/Makefile +++ b/provider-ci/test-providers/terraform-module/Makefile @@ -7,6 +7,7 @@ GO_MODULE := $(PROJECT) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= @@ -107,7 +108,7 @@ bin/$(PROVIDER): $(call build_provider_cmd,$(shell go env GOOS),$(shell go env GOARCH),$(WORKING_DIR)/bin/$(PROVIDER)) test: - cd tests && $(GO_TEST_EXEC) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd tests && $(GO_TEST_EXEC) -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = $(GO_TEST_EXEC) \ -coverprofile="coverage.txt" \ diff --git a/provider-ci/test-providers/xyz/.github/workflows/test.yml b/provider-ci/test-providers/xyz/.github/workflows/test.yml index 8ceba69974..b3cfbaea02 100644 --- a/provider-ci/test-providers/xyz/.github/workflows/test.yml +++ b/provider-ci/test-providers/xyz/.github/workflows/test.yml @@ -101,12 +101,12 @@ jobs: run: make install_${{ matrix.language}}_sdk - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -skip TestPulumiExamples" test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + run: make TESTTAGS=${{ matrix.language }} GOTESTARGS="-count=1 -cover -run TestPulumiExamples" test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} strategy: diff --git a/provider-ci/test-providers/xyz/Makefile b/provider-ci/test-providers/xyz/Makefile index c4a1c87ac6..4df6b56747 100644 --- a/provider-ci/test-providers/xyz/Makefile +++ b/provider-ci/test-providers/xyz/Makefile @@ -9,6 +9,7 @@ CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) TESTPARALLELISM := 10 GOTESTARGS := "" +TESTTAGS ?= all GO_TEST_EXEC ?= go test WORKING_DIR := $(shell pwd) PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p 2 @@ -246,7 +247,7 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: - cd examples && $(GO_TEST_EXEC) -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) + cd examples && $(GO_TEST_EXEC) -v -tags=$(TESTTAGS) -parallel $(TESTPARALLELISM) -timeout 2h $(value GOTESTARGS) .PHONY: test test_provider_cmd = cd provider && $(GO_TEST_EXEC) -v -short \ -coverprofile="coverage.txt" \ From f5009008b5aeb708a0d974c8c37b71d12549c0c0 Mon Sep 17 00:00:00 2001 From: Alberto Pose Date: Thu, 12 Mar 2026 10:40:10 +0000 Subject: [PATCH 3/3] Use gotestsum --format github-actions for inline PR annotations Co-Authored-By: Claude Sonnet 4.6 --- .../internal/pkg/templates/base/.github/workflows/test.yml | 2 +- provider-ci/test-providers/aws/.github/workflows/test.yml | 2 +- .../test-providers/cloudflare/.github/workflows/test.yml | 2 +- provider-ci/test-providers/docker/.github/workflows/test.yml | 2 +- provider-ci/test-providers/eks/.github/workflows/test.yml | 2 +- .../test-providers/pulumiservice/.github/workflows/test.yml | 2 +- .../test-providers/terraform-module/.github/workflows/test.yml | 2 +- provider-ci/test-providers/xyz/.github/workflows/test.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml index b3230201c3..f50c57b251 100644 --- a/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml +++ b/provider-ci/internal/pkg/templates/base/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" #{{ .Config | renderGlobalEnv | indent 2 }}# diff --git a/provider-ci/test-providers/aws/.github/workflows/test.yml b/provider-ci/test-providers/aws/.github/workflows/test.yml index f14f21d305..6b4ee37686 100644 --- a/provider-ci/test-providers/aws/.github/workflows/test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" AWS_REGION: us-west-2 PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml index 6d8b733e54..93c2e9140f 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" PULUMI_API: https://api.pulumi-staging.io PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. diff --git a/provider-ci/test-providers/docker/.github/workflows/test.yml b/provider-ci/test-providers/docker/.github/workflows/test.yml index dd8fc6e3eb..8cfbe445c7 100644 --- a/provider-ci/test-providers/docker/.github/workflows/test.yml +++ b/provider-ci/test-providers/docker/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" ARM_CLIENT_ID: 30e520fa-12b4-4e21-b473-9426c5ac2e1e ARM_SUBSCRIPTION_ID: 0282681f-7a9e-424b-80b2-96babd57a8a1 diff --git a/provider-ci/test-providers/eks/.github/workflows/test.yml b/provider-ci/test-providers/eks/.github/workflows/test.yml index 63c585e76a..67cb91f96a 100644 --- a/provider-ci/test-providers/eks/.github/workflows/test.yml +++ b/provider-ci/test-providers/eks/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" AWS_REGION: us-west-2 DOTNET_VERSION: 6.x diff --git a/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml b/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml index b5224cfdb8..4364840767 100644 --- a/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml +++ b/provider-ci/test-providers/pulumiservice/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" PROVIDER: pulumiservice PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/terraform-module/.github/workflows/test.yml b/provider-ci/test-providers/terraform-module/.github/workflows/test.yml index 29e5efb58b..85bf843c42 100644 --- a/provider-ci/test-providers/terraform-module/.github/workflows/test.yml +++ b/provider-ci/test-providers/terraform-module/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" AWS_REGION: us-west-2 PULUMI_API: https://api.pulumi-staging.io diff --git a/provider-ci/test-providers/xyz/.github/workflows/test.yml b/provider-ci/test-providers/xyz/.github/workflows/test.yml index b3cfbaea02..594de0f06d 100644 --- a/provider-ci/test-providers/xyz/.github/workflows/test.yml +++ b/provider-ci/test-providers/xyz/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: env: PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} MISE_ENV: test - GO_TEST_EXEC: "gotestsum --" + GO_TEST_EXEC: "gotestsum --format github-actions --" PULUMI_API: https://api.pulumi-staging.io PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..