-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test sharding #2810
base: vvm/refactor_sdkv2_detailed_diff_tests
Are you sure you want to change the base?
Test sharding #2810
Conversation
bce5fde
to
fef033d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## vvm/refactor_sdkv2_detailed_diff_tests #2810 +/- ##
==========================================================================
- Coverage 68.63% 68.62% -0.02%
==========================================================================
Files 325 325
Lines 41550 41550
==========================================================================
- Hits 28518 28513 -5
- Misses 11425 11430 +5
Partials 1607 1607 ☔ View full report in Codecov by Sentry. |
a542264
to
6a4085f
Compare
6a4085f
to
a4005fd
Compare
This change is part of the following stack: Change managed by git-spice. |
2cba967
to
eb555c7
Compare
3b22893
to
c3b2b2c
Compare
e7dd711
to
223f70f
Compare
a381fb5
to
817019b
Compare
223f70f
to
e7946a2
Compare
817019b
to
2c18440
Compare
e7946a2
to
e020e7f
Compare
03ba81e
to
138e1d0
Compare
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \ | ||
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./... ${SHARD_CMD} | ||
|
||
test_profile:: install_plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a comment explaining what it does.
@@ -33,6 +33,20 @@ test:: install_plugins | |||
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \ | |||
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./... | |||
|
|||
test_shard:: install_plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs a comment explaining what it does, and that it is provided for CI.
pulumi-hcl-lint | ||
|
||
schema-tpsdkv2.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding this. We should fix the test that erroneously generates this file instead of ignoring it.
- platform: windows-latest | ||
shard: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea that every OS runs shard 0, and only ubuntu runs the rest of the shards? If so, that needs a comment explaining so.
Also, why don't we shard all OSs?
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW" | ||
- platform: macos-latest | ||
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW" | ||
- platform: windows-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of defining shard
as [0, 1, 2, 3, ...]
, then excluding each option we don't want, can we define shard
as [0]
and then add explicit includes for other shard options. That will reduce the length of the shard list by half.
- name: Build | ||
run: make build | ||
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is github.com/VenelinMartinov/sharder
different from github.com/pulumi/shard
? Why can't we use github.com/pulumi/shard
?
This PR implements a test sharding strategy to speed up the bridge tests from 1 hour 30 minutes to under 15 minutes.
It uses https://github.com/VenelinMartinov/sharder which is a package for generating regexes to plug into
go test
based on the test profile data. The script is based on the previous work by @blampe in https://github.com/pulumi/shard.This PR also adds two new
make
commands:make test_profile
this regenerates the test profile data, so that shard partitioning can be more fairmake test_shard
. This is only run in CI. This command picks up theSHARD_CMD
env var to determine which tests to run.SHARD_CMD
is populated in CI by thesharder
package and contains a regex which should match the correct tests to run.Sharding is only done for
ubuntu
tests as they take the longest.Example run: https://github.com/pulumi/pulumi-terraform-bridge/actions/runs/12656374664