-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[sdk/go] Specify known when creating outputs for construct #7343
Conversation
If an input is an unknown value or contains unknowns, specify known = false when creating the output.
Provides a Random resource that can be used by languages that don't support dynamic providers but need a custom resource for tests, to avoid having to take a dependency on the pulumi-random provider.
pathEnv := pathEnv(t, | ||
filepath.Join("..", "testprovider"), | ||
filepath.Join(testDir, test.componentDir)) | ||
integration.ProgramTest(t, &integration.ProgramTestOptions{ |
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.
Cool. Interesting so this was just bowing up before the change, no need for extra asserts?
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.
Right. Before the change, in the case of the Go-based provider, the Apply
inside the provider's component implementation will run because it thinks the value is known, which will panic and fail the test. With the fix, the Apply
won't run because we properly pass along unknown, so no panic, and the test succeeds. I wasn't really sure if there was a better way to test this from an integration test.
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. The more I see the one-liner fix with 1,880 lines of per-language tests, the more I worry about our future supporting N languages 🙂
If an input is an unknown value or contains unknowns, specify
false
forknown
when creating the output.Added integration tests to ensure this is behaving as expected for all languages.
Fixes #7318