-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add import to pulumitest #91
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 37.35% 38.38% +1.03%
==========================================
Files 43 48 +5
Lines 2677 2816 +139
==========================================
+ Hits 1000 1081 +81
- Misses 1569 1616 +47
- Partials 108 119 +11 ☔ View full report in Codecov by Sentry. |
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.
LGTM with one comment.
Also, it's helpful when the PR description states the "why" of the change, intended usage etc.
Thanks, I've added notes on usage in AWS, GCP, Azure and the bridge. |
This PR has been shipped in release v0.0.14. |
@corymhall we were just talking this morning about the need for better import testing facilities. Looks like there is a start here, there's some examples here that write asserts against the generated program source code, but it does not yet help with tasks like taking the generated program and actually running it. Perhaps something that can be of interest to build on. |
Fixes an issue with the SDKv2 and PF input extraction. During import we wrongly return values for properties which are fully computed which causes invalid programs to be generated. ~The object check in `CastToTypeObject` was wrong for SDKV2 objects: https://github.com/pulumi/pulumi-terraform-bridge/blob/48fd41bd16e2f7f933bb9390ab7619d52faabb6d/pkg/tfshim/util/types.go#L36~ The `CastToTypeObject` object check is wrong for both SDKv2 and PF. For the SDKV2 only sets and lists can have a `Resource` `.Elem`. For PF it list-nested blocks are represented with a `Resource` `.Elem` in the shim layer, so the check did not catch these. PF details here: #2231 This fixes the check and adds regression tests for the broken imports which resulted from 2180. Test coverage added in #2224 for sdkv2 and #2225 for pf. fixes #2180 depends on pulumi/providertest#91 stacked on #2225
Adds an import function to pulumitest
The code was adapted from pulumi/pulumi-aws#3859 through pulumi/pulumi-gcp#1946
This is already used in GCP and AWS, I believe the azure provider needed it too at some point.
This is also needed for tests in the bridge: pulumi/pulumi-terraform-bridge#2180