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

Launch providers into workspace directory #69

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Feb 16, 2024

Closes #65

Breaking changes:

  • providers.ProviderFactory signature change to accept an abstract providers.PulumiTest for contextual information.
  • providers.ResourceProviderServerFactory signature change to accept providers.PulumiTest.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 37.27%. Comparing base (8c45fd2) to head (dd332f3).
Report is 15 commits behind head on main.

Files Patch % Lines
providers/localBinary.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   33.45%   37.27%   +3.82%     
==========================================
  Files          42       42              
  Lines        2571     2664      +93     
==========================================
+ Hits          860      993     +133     
+ Misses       1606     1565      -41     
- Partials      105      106       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

Yup, definitely need this option. I think we should use the same functional arguments style as for all other options in the library rather than exposing the raw struct directly.

@EronWright
Copy link
Contributor Author

@danielrbradley I would argue that functional options are counter-productive in this case, because the ProviderFactory isn't a user-facing API, and that implementing a factory would be more difficult. Functional options are routinely converted to an options representation for further processing; why make each factory do this? ProviderOptions can be understood as the already-converted representation.

If you're still wanting it, let me know and I'll give it a try. Thanks!

@danielrbradley
Copy link
Member

Ok, been mulling this over a little more. Passing an argument for WorkDir to the provider assumes that the factory has to honnor it, but some implementations may well not use it. Therefore one subtle change would be to not pass in options but pass in some context about the program under test. This could be a simple interface with just a Source() method for now but could be added to if needed. This interface would already be implemented by the PulumiTest struct. E.g.

type PulumiTest interface {
	Source() string
}

@EronWright EronWright merged commit a0511ba into main Feb 26, 2024
4 checks passed
@EronWright EronWright deleted the eronwright/issue-65 branch February 26, 2024 21:51
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.

Start the providers in the workspace directory
2 participants