diff --git a/.config/mise.test.toml b/.config/mise.test.toml index 7176fabf..a97f5ffa 100644 --- a/.config/mise.test.toml +++ b/.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/.github/workflows/test.yml b/.github/workflows/test.yml index 13ee0232..3525ecd6 100644 --- a/.github/workflows/test.yml +++ b/.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 --format github-actions --" PULUMI_API: https://api.pulumi-staging.io PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. @@ -98,18 +99,17 @@ 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: 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: 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/Makefile b/Makefile index 57dd49b5..0cb72611 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ 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 ?= PULUMI_CONVERT := 1 @@ -252,13 +254,13 @@ 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=$(TESTTAGS) -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) \ - ./... + . test_provider: $(call test_provider_cmd) .PHONY: test_provider