-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix 611 #624
Fix 611 #624
Conversation
Diff for pulumi-random with merge commit 8042e0b |
Diff for pulumi-azuread with merge commit 8042e0b |
Diff for pulumi-gcp with merge commit 8042e0b |
Diff for pulumi-azure with merge commit 8042e0b |
Working through an import cycle, need to move code around. |
Diff for pulumi-aws with merge commit 8042e0b |
Diff for pulumi-random with merge commit 62de229 |
Diff for pulumi-azuread with merge commit 62de229 |
Diff for pulumi-gcp with merge commit 62de229 |
Diff for pulumi-azure with merge commit 62de229 |
Diff for pulumi-random with merge commit 8bcdf03 |
Diff for pulumi-azuread with merge commit 8bcdf03 |
Diff for pulumi-gcp with merge commit 8bcdf03 |
Diff for pulumi-aws with merge commit 62de229 |
Diff for pulumi-random with merge commit 88d52c7 |
Diff for pulumi-gcp with merge commit 88d52c7 |
Diff for pulumi-azuread with merge commit 88d52c7 |
Diff for pulumi-azure with merge commit 8bcdf03 |
Diff for pulumi-azuread with merge commit 60f4c4a |
Diff for pulumi-random with merge commit 60f4c4a |
…622) * Switch pkg type from string to tokens.Package * Use tokens.Module instead of string where possible * Add ability to save generated schema * Compute module placement via type gen paths * Undo accidental docs diffs * Simplify diff * Remove debug helpers * Remove diff * Satisfy lint * PULUMI_ACCEPT=1 go test -run TestRegress611
Diff for pulumi-random with merge commit 3be86d5 |
Diff for pulumi-azuread with merge commit 3be86d5 |
Diff for pulumi-random with merge commit 2f2dd15 |
Diff for pulumi-azuread with merge commit 2f2dd15 |
Diff for pulumi-gcp with merge commit 2f2dd15 |
Diff for pulumi-gcp with merge commit 3be86d5 |
Diff for pulumi-azure with merge commit 3be86d5 |
Diff for pulumi-azure with merge commit 2f2dd15 |
Diff for pulumi-aws with merge commit 2f2dd15 |
Diff for pulumi-aws with merge commit 3be86d5 |
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.
Couple of minor comments. I will follow up with fixing them. Thanks for adding the testing framework!
assert.Equal(t, schemaToString(expectedSpec), schemaToString(actualSpec)) | ||
} | ||
|
||
if os.Getenv("PULUMI_ACCEPT") != "" { |
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.
Nice! Should probably add some documentation around this to update the reference schema.
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.
Added a Makefile target with comment.
Diff for pulumi-azuread with merge commit d6f047d |
Diff for pulumi-random with merge commit d6f047d |
Diff for pulumi-gcp with merge commit d6f047d |
Diff for pulumi-azure with merge commit d6f047d |
Diff for pulumi-aws with merge commit d6f047d |
Diff for pulumi-azuread with merge commit 69e30f1 |
Diff for pulumi-random with merge commit 69e30f1 |
Diff for pulumi-gcp with merge commit 69e30f1 |
Diff for pulumi-azure with merge commit 69e30f1 |
Fixes #611
First introduces a test case reproducing 611, in the golden test style reminiscent of what Pulumi uses to test SDK generation (example).
How this works:
PULUMI_ACCEPT=1 go test
to rewrite the expected file to actual value, check it withgit diff
, and commit if the new output makes sense to serve as the subsequent expected valueThe test provider is extracted from a subset of AWS from #611
Extracting the test provider subset is what caused most trouble. The values from "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" Provider type that serve as a logical input to our schema generation process are not serializable as they contain funcs. Therefore it is difficult to write code that automatically computes subset. I got by with a semi-manual procedure that ended relying on "github.com/hexops/valast" package and some custom code to get back a Go literal that can be coaxed into an example provider value.
NOTE: ioutil deprecation changes unrelated, added to pass golangci-lint CI checks.