Skip to content
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

Upload unit test coverage for bridged providers by default #1224

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

blampe
Copy link
Contributor

@blampe blampe commented Dec 12, 2024

Turn on codecov reporting for provider unit tests.

@blampe
Copy link
Contributor Author

blampe commented Dec 12, 2024

This change is part of the following stack:

Change managed by git-spice.

Comment on lines -404 to -432
for _, j := range wf.Jobs {
for _, s := range j.Steps {
switch s.Name {
case "aws-actions/configure-aws-credentials":
config.ActionVersions.ConfigureAwsCredentials = s.Uses
case "google-github-actions/setup-gcloud":
config.ActionVersions.SetupGcloud = s.Uses
case "google-github-actions/auth":
config.ActionVersions.GoogleAuth = s.Uses
case "actions/checkout":
config.ActionVersions.Checkout = s.Uses
case "actions/download-artifact":
config.ActionVersions.DownloadArtifact = s.Uses
case "dorny/paths-filter":
config.ActionVersions.PathsFilter = s.Uses
case "thollander/actions-comment-pull-request":
config.ActionVersions.PrComment = s.Uses
case "actions/upload-artifact":
config.ActionVersions.UploadArtifact = s.Uses
case "pulumi/pulumi-upgrade-provider-action":
config.ActionVersions.UpgradeProviderAction = s.Uses
case "jlumbroso/free-disk-space":
config.ActionVersions.FreeDiskSpace = s.Uses
case "pulumi/provider-version-action":
config.ActionVersions.ProviderVersionAction = s.Uses
}
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused / leftover.

This is some hairy logic to preserve YAML comments. It would probably be simpler to forgo config.ActionVersions and just let Renovate manage the template files directly, but we can do that later.

@blampe blampe requested a review from t0yv0 December 12, 2024 19:54
@@ -239,7 +239,7 @@ test:
.PHONY: test

test_provider:
cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM)
cd provider && go test -v -short -coverprofile="coverage.txt" -coverpkg=./... ./... -parallel $(TESTPARALLELISM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to spell out packages from ./upstream into coverpkgs or it's happening automatically? e.g. how are we covering the Terraform provider code itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can capture coverage for multiple modules like so:

-coverpkg="./...,github.com/hashicorp/terraform-provider-..."

This captures all of our local modules and any TF provider imports.

I don't know how this will render in Codecov (I'm guessing it won't show any TF information) but it can be helpful locally.

Base automatically changed from blampe/test-consolidate to master December 12, 2024 23:01
blampe added a commit to pulumi/pulumi-aws that referenced this pull request Dec 12, 2024
This removes the `go_test_shim` job defined in `extraTests` by making it
a normal provider unit test instead of something that needs to be run as
part of upstream.

We currently attempt to upload coverage as part of this test, but it
[doesn't work](https://app.codecov.io/gh/pulumi/pulumi-aws).
pulumi/ci-mgmt#1224 will start uploading unit test
coverage by default.
@blampe blampe enabled auto-merge December 12, 2024 23:41
@blampe blampe added this pull request to the merge queue Dec 13, 2024
Merged via the queue into master with commit 87d055d Dec 13, 2024
6 checks passed
@blampe blampe deleted the blampe/codecov branch December 13, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants