mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-16 07:01:11 -05:00
- Add plausible unredacted plan json for `plan-json-{basic,full}` testdata --
Created by just running the relevant terraform commands locally.
- Add plan-json-no-changes testdata --
The unredacted json was organically grown, but I edited the log and redacted
json by hand to match what I observed from a real but unrelated
planned-and-finished run in TFC.
- Add plan-json-basic-no-unredacted testdata --
This mimics a lack of admin permissions, resulting in a 404.
- Hook up `MockPlans.ReadJSONOutput` to test fixtures, when present.
This method has been implemented for ages, and has had a backing store for
unredacted plan json, but has been effectively a no-op since nothing ever
fills that backing store. So, when creating a mock plan, make an attempt to
read unredacted json and stow it in the mocks on success.
- Make it possible to get the entire MockClient for a test backend
In order to test some things, I'm going to need to mess with the internal
state of runs and plans beyond what the go-tfe client API allows. I could add
magic special-casing to the mock API methods, or I could locate the
shenanigans next to the test that actually exploits it. The latter seems more
comprehensible, but I need access to the full mock client struct in order to
mess with its interior.
- Fill in some missing expectations around HasChanges when retrieving a run +
plan.
117 lines
4.3 KiB
JSON
117 lines
4.3 KiB
JSON
{
|
|
"plan_format_version": "1.1",
|
|
"resource_drift": [],
|
|
"resource_changes": [
|
|
{
|
|
"address": "null_resource.foo",
|
|
"mode": "managed",
|
|
"type": "null_resource",
|
|
"name": "foo",
|
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
|
"change": {
|
|
"actions": [
|
|
"create"
|
|
],
|
|
"before": null,
|
|
"after": {
|
|
"triggers": null
|
|
},
|
|
"after_unknown": {
|
|
"id": true
|
|
},
|
|
"before_sensitive": false,
|
|
"after_sensitive": {}
|
|
}
|
|
}
|
|
],
|
|
"relevant_attributes": [],
|
|
"output_changes": {},
|
|
"provider_schemas": {
|
|
"registry.terraform.io/hashicorp/null": {
|
|
"provider": {
|
|
"version": 0,
|
|
"block": {
|
|
"description_kind": "plain"
|
|
}
|
|
},
|
|
"resource_schemas": {
|
|
"null_resource": {
|
|
"version": 0,
|
|
"block": {
|
|
"attributes": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "This is set to a random value at create time.",
|
|
"description_kind": "plain",
|
|
"computed": true
|
|
},
|
|
"triggers": {
|
|
"type": [
|
|
"map",
|
|
"string"
|
|
],
|
|
"description": "A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.",
|
|
"description_kind": "plain",
|
|
"optional": true
|
|
}
|
|
},
|
|
"description": "The `null_resource` resource implements the standard resource lifecycle but takes no further action.\n\nThe `triggers` argument allows specifying an arbitrary set of values that, when changed, will cause the resource to be replaced.",
|
|
"description_kind": "plain"
|
|
}
|
|
}
|
|
},
|
|
"data_source_schemas": {
|
|
"null_data_source": {
|
|
"version": 0,
|
|
"block": {
|
|
"attributes": {
|
|
"has_computed_default": {
|
|
"type": "string",
|
|
"description": "If set, its literal value will be stored and returned. If not, its value defaults to `\"default\"`. This argument exists primarily for testing and has little practical use.",
|
|
"description_kind": "plain",
|
|
"optional": true,
|
|
"computed": true
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"description": "This attribute is only present for some legacy compatibility issues and should not be used. It will be removed in a future version.",
|
|
"description_kind": "plain",
|
|
"deprecated": true,
|
|
"computed": true
|
|
},
|
|
"inputs": {
|
|
"type": [
|
|
"map",
|
|
"string"
|
|
],
|
|
"description": "A map of arbitrary strings that is copied into the `outputs` attribute, and accessible directly for interpolation.",
|
|
"description_kind": "plain",
|
|
"optional": true
|
|
},
|
|
"outputs": {
|
|
"type": [
|
|
"map",
|
|
"string"
|
|
],
|
|
"description": "After the data source is \"read\", a copy of the `inputs` map.",
|
|
"description_kind": "plain",
|
|
"computed": true
|
|
},
|
|
"random": {
|
|
"type": "string",
|
|
"description": "A random value. This is primarily for testing and has little practical use; prefer the [hashicorp/random provider](https://registry.terraform.io/providers/hashicorp/random) for more practical random number use-cases.",
|
|
"description_kind": "plain",
|
|
"computed": true
|
|
}
|
|
},
|
|
"description": "The `null_data_source` data source implements the standard data source lifecycle but does not\ninteract with any external APIs.\n\nHistorically, the `null_data_source` was typically used to construct intermediate values to re-use elsewhere in configuration. The\nsame can now be achieved using [locals](https://www.terraform.io/docs/language/values/locals.html).\n",
|
|
"description_kind": "plain",
|
|
"deprecated": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"provider_format_version": "1.0"
|
|
}
|