terraform/internal/backend/local
Martin Atkins 332ea1f233 backend/local: TestLocal_plan_context_error to fail terraform.NewContext
The original intent of this test was to verify that we properly release
the state lock if terraform.NewContext fails. This was in response to a
bug in an earlier version of Terraform where that wasn't true.

In the recent refactoring that made terraform.NewContext no longer
responsible for provider constraint/checksum verification, this test began
testing a failed plan operation instead, which left the error return path
from terraform.NewContext untested.

An invalid parallelism value is the one remaining case where
terraform.NewContext can return an error, so as a localized fix for this
test I've switched it to just intentionally set an invalid parallelism
value. This is still not ideal because it's still testing an
implementation detail, but I've at least left a comment inline to try to
be clearer about what the goal is here so that we can respond in a more
appropriate way if future changes cause this test to fail again.

In the long run I'd like to move this last remaining check out to be the
responsibility of the CLI layer, with terraform.NewContext either just
assuming the value correct or panicking when it isn't, but the handling
of this CLI option is currently rather awkwardly spread across the
command and backend packages so we'll save that refactoring for a later
date.
2021-09-14 10:35:08 -07:00
..
testdata core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_apply.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_apply_test.go save apply diagnostics on backend failure 2021-05-17 17:22:04 -04:00
backend_local.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_local_test.go fix temp directory handling in some tests 2021-09-13 13:45:04 -04:00
backend_plan.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_plan_test.go backend/local: TestLocal_plan_context_error to fail terraform.NewContext 2021-09-14 10:35:08 -07:00
backend_refresh.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
backend_refresh_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
backend_test.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
cli.go
hook_state.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
hook_state_test.go Move terraform/ to internal/terraform/ 2021-05-17 14:09:07 -07:00
local_test.go
testing.go fix temp directory handling in some tests 2021-09-13 13:45:04 -04:00