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

Enable creation of TStack using IServiceProvider #5723

Conversation

nathanwinder-perficient
Copy link
Contributor

Enabled use of IServiceProvider for TStack instance creation. This supports the use of dependency injection when creating a stack.

  • Added an overload for RunAsync that accepts an IServiceProvider.
  • Updated existing RunAsync methods to use the factory pattern to create instance of TStack
  • Added a new method TestWithServiceProviderAsync for testing a stack that is generated using and IServiceProvider. I would like to use an overload of TestAsync but the backcompat rules would not allow it.

@mikhailshilkov
Copy link
Member

Hi @nathanwinder-perficient thanks for this PR!

One thing that we'd need to add is a test program similar to this one but with the new capability plus a corresponding Go test like here

@nathanwinder-perficient
Copy link
Contributor Author

@mikhailshilkov I added the integration test. I am using Windows and am not able to test that locally. I see that the test suite is failing and was failing before I added my test case. I tried to confirm that my test was passing but was unable to find it in the output of the test run.

Copy link
Member

@mikhailshilkov mikhailshilkov left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long but I reviewed the code, made some tweaks, ran the tests in #5836
LGTM

@mikhailshilkov mikhailshilkov merged commit 0bdf733 into pulumi:master Nov 30, 2020
@mikhailshilkov mikhailshilkov added this to the current milestone Nov 30, 2020
abhinav pushed a commit to pulumi/pulumi-dotnet that referenced this pull request Jan 11, 2023
* Enable creation of TStack using IServiceProvider to enable dependency injection.

* fixed line endings

* update change log

* Added PR link to change log

* fixed change log

* Added integration test

* Review adjustments

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
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.

None yet

2 participants