Skip to content

Commit ae81692

Browse files
use pulumi/sharder
1 parent 9873345 commit ae81692

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
required: false
99
env:
1010
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
# Note this needs to match the shard input to the test matrix below as well as pattern in exclude.
12+
# see jobs.test.strategy.matrix.{shard,exclude}
1113
TOTAL_SHARDS: 15
1214

1315
jobs:
@@ -22,12 +24,16 @@ jobs:
2224
go-version: [1.22.x, 1.23.x]
2325
platform: [ubuntu-latest, macos-latest, windows-latest]
2426
feature-flags: ["DEFAULT", "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"]
27+
# Needs to match TOTAL_SHARDS
2528
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
2629
exclude:
30+
# We do not run non-default feature flags on non-ubuntu.
2731
- platform: windows-latest
2832
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"
2933
- platform: macos-latest
3034
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"
35+
# Windows and mac test runs do not need to be sharded as they are fast enough.
36+
# In order to do that we will skip all except the 0-th shard.
3137
- platform: windows-latest
3238
shard: 1
3339
- platform: windows-latest
@@ -113,7 +119,7 @@ jobs:
113119
- name: Build PF
114120
run: cd pkg/pf && make build
115121
- name: Shard tests
116-
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
122+
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
117123
if: ${{ matrix.platform == 'ubuntu-latest' }}
118124
- name: Test
119125
run: make VERBOSE=true test_shard

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ test_shard:: install_plugins
4444
test_profile:: install_plugins
4545
@mkdir -p bin
4646
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
47-
rm -f testoutput.txt
47+
rm -f test-timings.jsonl
4848
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
4949
go test -count=1 -timeout 2h -parallel ${TESTPARALLELISM} ./... -json | \
50-
jq -c -r 'select((.Action == "pass" or .Action == "fail") and .Test != null)' | tee testoutput.txt
50+
jq -c -r 'select((.Action == "pass" or .Action == "fail") and .Test != null)' | tee test-timings.jsonl
5151

5252
# Run tests while accepting current output as expected output "golden"
5353
# tests. In case where system behavior changes intentionally this can
File renamed without changes.

0 commit comments

Comments
 (0)