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

Require local provider in tests #2953

Merged
merged 7 commits into from
Nov 16, 2023

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Nov 3, 2023

This PR adds a test main for the aws provider which checks that the aws provider used in the tests is a local one.

The default behaviour is for the pulumi binary to download a provider which leads to some quite confusing behaviour.

@VenelinMartinov VenelinMartinov marked this pull request as draft November 3, 2023 11:47
@VenelinMartinov VenelinMartinov changed the base branch from master to vvm/run_credentials_validation_only_once November 3, 2023 11:47
@VenelinMartinov VenelinMartinov requested a review from t0yv0 November 3, 2023 11:51
@VenelinMartinov VenelinMartinov marked this pull request as ready for review November 3, 2023 11:51
@VenelinMartinov VenelinMartinov changed the title [DRAFT] Require local provider in tests Require local provider in tests Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

examples/main_test.go Outdated Show resolved Hide resolved
examples/main_test.go Outdated Show resolved Hide resolved
@t0yv0 t0yv0 requested a review from a team November 3, 2023 13:44
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, nice this is a good stop-gap while we still use the $PATH.

The long term aim here is to ditch ever relying on the $PATH and rather use either:

  • Starting the provider first then connecting the test to the running provider via PULUMI_DEBUG_PROVIDERS.
  • Using the plugin configuration section of the Pulumi.yaml to specify where to run the provider from.

Either of these approaches is preferred in the long term as their failure mode is more predictable - if the explicitly specified provider is not found, then the whole run immediately fails as we can also disable using ambient providers.

Base automatically changed from vvm/run_credentials_validation_only_once to master November 3, 2023 21:36
Makefile Outdated Show resolved Hide resolved
VenelinMartinov added a commit to pulumi/ci-mgmt that referenced this pull request Nov 15, 2023
This PR adds a new make target for providers `provider_no_deps` - this
one will just run the go build command without `tfgen` and
`install_plugins`. This is needed since `tfgen` and `install_plugins`
have no caching, so will rerun each time and I'd like to use the `go
build` in pulumi/pulumi-aws#2953
@VenelinMartinov VenelinMartinov merged commit 94500c9 into master Nov 16, 2023
16 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/require_local_provider_in_tests branch November 16, 2023 17:48
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.

3 participants