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

Add tests that return failures from Call #8424

Merged
merged 4 commits into from Nov 16, 2021
Merged

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Nov 16, 2021

This PR adds some integration tests that return failures from Call, addressing a couple issues found in the process:

  • [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
  • [sdk/go] - Allow specifying Call failures from the provider.

Fixes #7649

@justinvp justinvp mentioned this pull request Nov 16, 2021
2 tasks
@justinvp justinvp requested a review from a team November 16, 2021 01:21
const deps = new provproto.CallResponse.ReturnDependencies();
deps.setUrnsList(await Promise.all(Array.from(resources).map(r => r.urn.promise())));
returnDependenciesMap.set(key, deps);
if (result.outputs) {
Copy link
Member

Choose a reason for hiding this comment

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

In case result.outputs is falsey, we don't need to resp.setReturn()? Use default value?

@@ -20,6 +20,12 @@
- [sdk/nodejs] - Unmarshal output values in component provider.
[#8205](https://github.com/pulumi/pulumi/pull/8205)

- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
Copy link
Member

Choose a reason for hiding this comment

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

OK this here explains it.

@justinvp justinvp merged commit ba39ed9 into master Nov 16, 2021
@pulumi-bot pulumi-bot deleted the justin/methods_errors branch November 16, 2021 16:58
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.

Methods: Additional test coverage
2 participants