diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 093def304..5a1b54051 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,6 +8,8 @@ on: required: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Note this needs to match the shard input to the test matrix below as well as pattern in exclude. + # see jobs.test.strategy.matrix.{shard,exclude} TOTAL_SHARDS: 15 jobs: @@ -22,12 +24,16 @@ jobs: go-version: [1.22.x, 1.23.x] platform: [ubuntu-latest, macos-latest, windows-latest] feature-flags: ["DEFAULT", "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"] + # Needs to match TOTAL_SHARDS shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] exclude: + # We do not run non-default feature flags on non-ubuntu. - platform: windows-latest feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW" - platform: macos-latest feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW" + # Windows and mac test runs do not need to be sharded as they are fast enough. + # In order to do that we will skip all except the 0-th shard. - platform: windows-latest shard: 1 - platform: windows-latest @@ -113,7 +119,7 @@ jobs: - name: Build PF run: cd pkg/pf && make build - name: Shard tests - run: echo "SHARD_CMD=$(go run github.com/VenelinMartinov/sharder@9d09afeb1c053b4a0263fbaa5c3c9da1ca2d10e7 --total ${{ env.TOTAL_SHARDS }} --index ${{ matrix.shard }} --output testoutput.txt --format make)" >> $GITHUB_ENV + run: echo "SHARD_CMD=$(go run github.com/pulumi/sharder@828907542fdc6628c49e5139d35fa1f427570550 --total ${{ env.TOTAL_SHARDS }} --index ${{ matrix.shard }} --output test-timings.jsonl --format make)" >> $GITHUB_ENV if: ${{ matrix.platform == 'ubuntu-latest' }} - name: Test run: make VERBOSE=true test_shard diff --git a/Makefile b/Makefile index 0f0a752e5..53a6817c1 100644 --- a/Makefile +++ b/Makefile @@ -44,10 +44,10 @@ test_shard:: install_plugins test_profile:: install_plugins @mkdir -p bin go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider - rm -f testoutput.txt + rm -f test-timings.jsonl PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \ go test -count=1 -timeout 2h -parallel ${TESTPARALLELISM} ./... -json | \ - jq -c -r 'select((.Action == "pass" or .Action == "fail") and .Test != null)' | tee testoutput.txt + jq -c -r 'select((.Action == "pass" or .Action == "fail") and .Test != null)' | tee test-timings.jsonl # Run tests while accepting current output as expected output "golden" # tests. In case where system behavior changes intentionally this can diff --git a/testoutput.txt b/test-timings.jsonl similarity index 100% rename from testoutput.txt rename to test-timings.jsonl