pulumi/pkg/resource/deploy
Kyle Dixler 485718f533
[ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997)
covers
- step.go
- step_executor.go
- step_generator.go
- import.go

They all depend on an added field to steps that use providers in
`Apply()`

# Includes changes to a non-test file: step.go

steps query the deployment for providers. There is not a straightforward
way of mocking a provider for a step. I've added a field called
`provider plugin.Provider` to steps that use providers to be used
instead of querying the Deployment with getProvider().

This approach aims to minimize the cognitive complexity and potential
for errors in comparison to the branching alternative due to the
behavior of `:=` and assigning the value to an existing value while also
defining a new variable err.

```diff
-               prov, err := getProvider(s, s.provider)
-               if err != nil {
-                       return resource.StatusOK, nil, err
+               prov := s.provider
+               if prov == nil {
+                       var err error
+                       prov, err = getProvider(s)
+                       if err != nil {
+                               return resource.StatusOK, nil, err
+                       }
                }
```
2023-12-22 21:14:04 +00:00
..
deploytest [ci] `pkg/resource/deploy/deploytest/provider.go` coverage (#14970) 2023-12-22 19:13:20 +00:00
providers Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
builtins.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
builtins_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
deployment.go Check qualified type for root stackness (#14714) 2023-12-04 10:36:51 +00:00
deployment_executor.go Fix handling of delete failures for targeted destroys (#14735) 2023-12-05 17:19:10 +00:00
deployment_executor_test.go Fix handling of delete failures for targeted destroys (#14735) 2023-12-05 17:19:10 +00:00
deployment_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
import_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
manifest_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
plan.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
plan_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
snapshot.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
snapshot_test.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
source.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
source_error.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_error_test.go [ci] `pkg/resource/deploy/source_error.go` coverage (#14982) 2023-12-22 20:57:52 +00:00
source_eval.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
source_eval_test.go [ci] `pkg/resource/deploy/source_eval.go` coverage (#14979) 2023-12-22 21:14:04 +00:00
source_null.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_query.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
source_query_test.go [ci] `pkg/resource/deploy/source_query.go` coverage (#14955) 2023-12-22 19:07:09 +00:00
state_builder.go Fix duplicate resource error from failed delete operations (#14042) 2023-09-26 15:18:35 +00:00
state_builder_test.go When changing parents also fix URNs (#13935) 2023-09-14 19:52:27 +00:00
step.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
step_executor.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
step_executor_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
step_generator.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
step_generator_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
step_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
target.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
target_test.go [ci] `pkg/resource/deploy/target.go` coverage (#14981) 2023-12-22 20:57:21 +00:00