pulumi/tests
bors[bot] 072d7b58f0
Merge #13046
13046: Allow mapping requests to install plugins r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Enabling fix for https://github.com/pulumi/pulumi-terraform-bridge/issues/1130

This adds two new bits of logic to the plugin mapper.

Firstly when getting a mapping request for a given package X, as well as searching to see if we have an X plugin already installed to call it's `GetMapping` method first, we now also try to install X if we don't already have it. The install failing is not considered an error, we'll just try the other plugins to see if they map and then possibly return empty (as before).

Secondly the converter can pass a hint to what the pulumi plugin for the ecosystem plugin is. If no hint is given we assume the pulumi plugin name is the same as the ecosystem name. But this can be used for example in the terraform converter to tell the engine that for example the terraform provider "azurerm" is called "azure" in pulumi.

The hint is just a hint, if the name doesn't match all the other plugins will be searched as before.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
2023-05-31 17:08:17 +00:00
..
benchmarks/go-alias-norm all: cloudflare/circl 1.1.0 => 1.3.3 2023-05-11 13:51:01 -07:00
examples Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
integration Merge #13021 #13054 2023-05-30 19:48:20 +00:00
testdata Add per-language smoke tests to the integration tests 2023-05-06 09:23:19 +01:00
testprovider all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
.gitignore ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
README.md Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
about_test.go test: fix regex used to test Go version output in about command. (#10499) 2022-08-29 11:53:03 -07:00
config_test.go filestate: Re-add project support 2023-03-31 13:21:36 -07:00
go.mod Merge #13046 2023-05-31 17:08:17 +00:00
go.sum Merge #13046 2023-05-31 17:08:17 +00:00
history_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
login_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
main_test.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
remote_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
roundtrip_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
smoke_test.go Fix up test loop variables 2023-05-10 20:16:24 +01:00
stack_test.go filestate: Re-add project support 2023-03-31 13:21:36 -07:00

README.md

Integration Tests

This module provides integration tests for the Pulumi CLI.

The tests can be run via:

make test_all

Usage of Go build tags

In order to speed up integration tests in GitHub actions, Go build tags are used to conditionally compile the desired test cases.

// integration_nodejs_test.go
//go:build (nodejs || all) && !xplatform-acceptance

// integration_nodejs_acceptance_test.go
//go:build nodejs || all