Skip to content

Commit

Permalink
use pulumi/sharder
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Jan 14, 2025
1 parent 9873345 commit ae81692
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.

0 comments on commit ae81692

Please sign in to comment.