Skip to content

Commit 3b8c80d

Browse files
committed
Experiment with just using github.com/pulumi/shard
While github.com/pulumi/sharder should be optimal, github.com/pulumi/shard should approach optimality as the number of tests grows. I want to see the degradation in test performance we see when using a simpler solution.
1 parent 33505e7 commit 3b8c80d

File tree

3 files changed

+3
-7120
lines changed

3 files changed

+3
-7120
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,10 @@ jobs:
119119
- name: Build PF
120120
run: cd pkg/pf && make build
121121
- name: Shard tests
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
123-
if: ${{ matrix.platform == 'ubuntu-latest' }}
124-
- name: Test
125-
run: make VERBOSE=true test_shard
122+
run: echo "RUN_TEST_CMD=$(go run github.com/pulumi/shard@5b6297aaffa0c06291fb8231968d7a9f4e6832e6 --total ${{ env.TOTAL_SHARDS }} --index ${{ matrix.shard }} --seed 42)" >> $GITHUB_ENV
126123
if: ${{ matrix.platform == 'ubuntu-latest' }}
127124
- name: Test
128125
run: make test
129-
if: ${{ matrix.platform != 'ubuntu-latest' }}
130126
- name: Upload coverage reports to Codecov
131127
# If we have a CODECOV_TOKEN secret, then we upload it to get a coverage report.
132128
#

Makefile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,12 @@ lint:
2727
lint_fix:
2828
go run scripts/build.go fix-lint
2929

30+
RUN_TEST_CMD ?= ./...
3031
test:: install_plugins
3132
@mkdir -p bin
3233
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
3334
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
34-
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./...
35-
36-
# Run a single shard of tests. This is a make target for use in CI. It assumes the shard arguments are provided in SHARD_CMD
37-
test_shard:: install_plugins
38-
@mkdir -p bin
39-
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
40-
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
41-
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./... ${SHARD_CMD}
42-
43-
# Run the tests and record profiling data. This is used for partitioning tests into shards for CI.
44-
test_profile:: install_plugins
45-
@mkdir -p bin
46-
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
47-
rm -f test-timings.jsonl
48-
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
49-
go test -count=1 -timeout 2h -parallel ${TESTPARALLELISM} ./... -json | \
50-
jq -c -r 'select((.Action == "pass" or .Action == "fail") and .Test != null)' | tee test-timings.jsonl
35+
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} $(value RUN_TEST_CMD)
5136

5237
# Run tests while accepting current output as expected output "golden"
5338
# tests. In case where system behavior changes intentionally this can

0 commit comments

Comments
 (0)