Closed phramz closed 1 month ago
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the projectPR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the projectIdeally we would also have a test showing that this works.
Regarding a test ... I'm not sure where and how to ideally implement such a test. Would be an acceptance test unless we can mock the exec
package somehow (probably a little refactoring).
Any thoughts or ideas on this @tgummerer
I think an integration test would be fine here, maybe creating two different stacks with different outputs based on the environment variables you are introducing here? pkg/tests/integration_test.go
has some examples of current integration tests.
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the projectI think an integration test would be fine here, maybe creating two different stacks with different outputs based on the environment variables you are introducing here?
pkg/tests/integration_test.go
has some examples of current integration tests.
@tgummerer I'm having a hard time setting up the integration tests to run locally. Obviously Pulumi is not using my updated binary as language plugin. So my changes don't have any effect during the test. Is there a doc or could you give me a hint on how to run them locally.
I already pushed an unfinished test PTAL.
Installing the binary will give me an error:
error: the yaml language plugin is bundled with Pulumi, and cannot be directly installed with this command. If you need to reinstall this plugin, reinstall Pulumi via your package manager or install script.
/run-acceptance-tests
Please view the results of the PR Build + Acceptance Tests Run Here
Installing the binary will give me an error:
How exactly were you trying to install the binary? I believe you should be able to run make install
to install the binary (and then prepend $GOBIN
to the $PATH
.) There's also a make test
Makefile target that should run all tests. Does that not work for you?
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the projectInstalling the binary will give me an error:
How exactly were you trying to install the binary? I believe you should be able to run
make install
to install the binary (and then prepend$GOBIN
to the$PATH
.) There's also amake test
Makefile target that should run all tests. Does that not work for you?
Thanks! It was indeed a PATH issue having both Pulumi from source and Brew in place.
I finished/fixed the test, fingers crossed it'll pass now.
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the project/run-acceptance-tests
Please view the results of the PR Build + Acceptance Tests Run Here
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the project/run-acceptance-tests
Please view the results of the PR Build + Acceptance Tests Run Here
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the project/run-acceptance-tests
Please view the results of the PR Build + Acceptance Tests Run Here
PR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the projectPR is now waiting for a maintainer to take action.
Note for the maintainer: Commands available:
/run-acceptance-tests
- used to test run the acceptance tests for the project/run-acceptance-tests
Please view the results of the PR Build + Acceptance Tests Run Here
Thank you again, and thanks for the patience while we worked out the best way to also make this backwards compatible.
I'm gonna leave this PR open until tomorrow just in case anyone else has any comments, but this looks good to me!
That went really smooth, kudos and big thanks to you!
This PR adds a new environment variable
PULUMI_STACK
to the compiler run.The possibility to determine the stack from the compiler makes it a lot more flexibel when dealing with stack specific resources.
Here an example (I'm using Jinja2 though the issue itself is not compiler specific):
A more complex scenario would be to add HA resources to a production stack where an integration system is zonal set up to reduce cloud costs.
My approach seems a bit naive to be honest, but I couldn't figure out a better way without breaking interfaces. Also this solution only works from the
Run
-call context, soGetRequiredPlugins
might not be accurate when plugins are stack specific.WDYT?