pulumi/tests/integration
Abhinav Gupta b51caa6ab4
cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815)
Switch the cmdutil.ReadConsole and cmdutil.ReadConsoleNoEcho functions
to use the bubbletea library to render the prompt,
using the textinput widget provided by the accompanying bubbles library.
The resulting input widgets support arrow keys, back space,
and some basic readline-style bindings including Ctrl-A, Alt-B, etc.

I went through all uses of ReadConsole or ReadConsoleNoEcho.
Only the one in new.go had a non-compliant prompt that I had to adjust.

Note: One divergence in behavior I opted for was that
password prompts will echo '*' characters as the user is typing
and then no echo once they've accepted or canceled the value.
Previously, the prompt did not echo anything in either case.

<details>

  <summary>
  Introduction if you're unfamiliar with bubbletea
  </summary>

  bubbletea operates by modeling the widget state as
  an immutable data structure that receives messages for events.
  On receiving a message (key press, e.g.) the model's Update method
  returns a new model instance representing its new state.
  Update may also optionally return additional commands for the program,
  e.g. stop running, or print something and move on.
  The model's View method returns what should be drawn in the terminal
  based on the model's current state.
This programming model makes it reasonably straightforward to unit test
  some of the core functionality of independent widgets
  as demonstrated in this PR.

</details>

Resolves #1565

---

Demos:

<details>
  <summary>Plain text</summary>
  

![prompt-plain](https://github.com/pulumi/pulumi/assets/41730/66258fc8-f772-4d01-bc7c-1f7b116aebaa)
</details>

<details>
  <summary>Secret</summary>


![prompt-secret](https://github.com/pulumi/pulumi/assets/41730/372f862e-9186-4d47-ba7d-0107c47f52f6)
</details>

<details>
  <summary>Secret prompt with padding</summary>


![prompt-secret-2](https://github.com/pulumi/pulumi/assets/41730/e9b7c253-4c9d-4235-9fa6-197aa0522033)
</details>
2023-08-30 17:08:44 +00:00
..
about deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
aliases deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
cloud_secrets_provider Enable full strict mode. (#3218) 2019-09-11 16:21:35 -07:00
component_provider_schema Add RunPlugin support for python 2023-03-06 21:35:39 +00:00
config_basic deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
config_capture_e2e/nodejs Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
config_missing deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
config_secrets_warn deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_error_apply Update @types/node version in tests 2023-02-07 14:20:27 +00:00
construct_component_methods deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_methods_errors deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_methods_provider [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
construct_component_methods_resources deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_methods_unknown deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_output_values deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_plain deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_provider deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_provider_explicit deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_component_provider_propagation cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
construct_component_resource_options cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
construct_component_slow Update @types/node version in tests 2023-02-07 14:20:27 +00:00
construct_component_unknown deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
construct_nested_component/go cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
custom_timeouts Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
delete_before_create Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
deleted_with deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
dependency_steps Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
double_pending_delete Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
duplicate_urns Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
dynamic Pass PULUMI_CONFIG through to provider plugins 2023-04-05 10:17:18 +01:00
ee_perf Use prefered `new pulumi.Config()` form 2019-01-31 16:11:57 -08:00
empty deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
enums [sdk/python] Fix enum test for python 11 behavior change 2023-03-22 07:23:46 -07:00
exclude_protected Implement the --exclude-protected feature (#8359) 2021-11-15 11:45:14 -08:00
explicit_provider Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
gather_plugin deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
get_created Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
get_resource deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
go deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
invalid_package_json Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
large_resource deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
nodejs Warn about undefined stack outputs 2023-07-28 14:33:04 +01:00
partial_state Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
partial_values Propagate inputs to outputs during preview. (#3327) 2019-11-11 12:09:34 -08:00
policy unused: Remove unused functions and types 2023-01-12 09:55:34 -08:00
printf deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
project_main deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
project_main_abs Enable absolute and relative parent paths for pulumi main (#6734) 2021-04-08 21:39:52 -07:00
project_main_parent/foo Enable absolute and relative parent paths for pulumi main (#6734) 2021-04-08 21:39:52 -07:00
protect_resources Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
provider_secret_config Enable full strict mode. (#3218) 2019-09-11 16:21:35 -07:00
python Test duplicate outputs 2023-06-29 10:46:37 +01:00
python_await [sdk/python] - Await all async tasks (#6606) 2021-03-30 10:56:17 -07:00
query Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
read Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
recreate_resource_check Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
refresh/go deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
resource_refs_get_resource deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
rotate_passphrase deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
secret_outputs [sdk/python] Fix secret regression (#5496) 2020-10-01 14:57:51 -07:00
single_resource Suppress JSON outputs in preview correctly (#2771) 2019-05-25 12:10:38 +02:00
stack_bad_parenting Consistent dependencies (#2517) 2019-03-05 20:34:51 -08:00
stack_dependencies Remove existing lock files 2018-11-12 15:33:58 -08:00
stack_outputs Remove dotnet 2022-12-13 16:13:53 +00:00
stack_parenting Consistent dependencies (#2517) 2019-03-05 20:34:51 -08:00
stack_project_name Actually fix the naming test (#10554) 2022-08-31 20:52:23 +01:00
stack_reference deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
stack_reference_multi/python Regression tests for StackReference in the Python SDK (#3913) 2020-02-17 10:40:46 -08:00
stack_reference_secrets/nodejs Remove dotnet 2022-12-13 16:13:53 +00:00
state_rename_parent deps: Upgrade google.golang.org/{genproto, grpc} 2023-07-27 16:24:33 -07:00
steps Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
targets Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
transformations Revert package.json lookup fix. 2023-05-15 14:14:57 -04:00
tsconfig Add tsconfig option to specify tsconfig path (#8452) 2021-11-22 11:42:39 -08:00
types Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
unsafe_snapshot_tests/bad_resource Update tests/integration/unsafe_snapshot_tests/bad_resource/resource.ts 2022-09-15 08:00:36 -07:00
.gitignore ci: Enable async component builds 2022-09-14 10:06:05 -07:00
appdash_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
component_setup.sh Engine and Golang support for shimless providers 2022-11-14 11:25:41 +00:00
integration_acceptance_test.go Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
integration_go_acceptance_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
integration_go_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
integration_nodejs_acceptance_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
integration_nodejs_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
integration_python_acceptance_test.go Always mark dynamic provider code as secret 2023-07-06 13:50:59 +01:00
integration_python_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
integration_test.go Fix `stack rm` removing config files for the wrong project 2023-06-21 10:52:25 +01:00
integration_util_test.go [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00