-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS: Add tests showing state subcommands being used with PSS
#37891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SarahFrench
wants to merge
18
commits into
main
Choose a base branch
from
pss/pss-with-state-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+920
−11
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
10c5e22
test: Add E2E tests for `state list` and `state show` commands
SarahFrench 9aa680d
test: Update `mockPluggableStateStorageProvider` to log a warning dur…
SarahFrench 33635cd
test: Update `mockPluggableStateStorageProvider` helper to include a …
SarahFrench 4d94e87
test: Add command-level test for `state list` showing integration wit…
SarahFrench b9a1d3f
test: Add command-level test for `state show` showing integration wit…
SarahFrench 6cb5625
test: Add command-level test for `state pull` showing integration wit…
SarahFrench 1bdfba5
test: Add command-level test for `state identities` showing integrati…
SarahFrench bbfbf63
test: Add command-level test for `state rm` showing integration with …
SarahFrench 0536d82
test: Add command-level test for `state mv` showing integration with …
SarahFrench 4804cc3
test: Add command-level test for `state push` showing integration wit…
SarahFrench 55bfebc
test: Add command-level test for `state replace-provider` showing int…
SarahFrench 723c90d
test: Change shared test fixture to not be named after a specific com…
SarahFrench c3b7923
test: Update test to use shared test fixture
SarahFrench c392a6f
test: Remove redundant test fixture
SarahFrench 101f432
fix: Re-add logic for setting chunk size in the context of E2E tests …
SarahFrench 1b0d141
refactor: Let panic happen if there's incompatibility between mock re…
SarahFrench 6ecb90a
test: Refactor to contain paths in reused variable, remove unnecessar…
SarahFrench c2d9c42
test: Remove unneeded test code
SarahFrench File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...al/command/e2etest/testdata/initialized-directory-with-state-store-fs/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...d/e2etest/testdata/initialized-directory-with-state-store-fs/.terraform/terraform.tfstate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "version": 3, | ||
| "terraform_version": "1.15.0", | ||
| "state_store": { | ||
| "type": "simple6_fs", | ||
| "provider": { | ||
| "version": "0.0.1", | ||
| "source": "registry.terraform.io/hashicorp/simple6", | ||
| "config": {} | ||
| }, | ||
| "config": { | ||
| "workspace_dir": "states" | ||
| }, | ||
| "hash": 3942813381 | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
internal/command/e2etest/testdata/initialized-directory-with-state-store-fs/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| terraform { | ||
| required_providers { | ||
| simple6 = { | ||
| source = "registry.terraform.io/hashicorp/simple6" | ||
| } | ||
| } | ||
|
|
||
| state_store "simple6_fs" { | ||
| provider "simple6" {} | ||
|
|
||
| workspace_dir = "states" | ||
| } | ||
| } | ||
|
|
||
| variable "name" { | ||
| default = "world" | ||
| } | ||
|
|
||
| resource "terraform_data" "my-data" { | ||
| input = "hello ${var.name}" | ||
| } | ||
|
|
||
| output "greeting" { | ||
| value = resource.terraform_data.my-data.output | ||
| } |
40 changes: 40 additions & 0 deletions
40
...etest/testdata/initialized-directory-with-state-store-fs/states/default/terraform.tfstate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "version": 4, | ||
| "terraform_version": "1.15.0", | ||
| "serial": 1, | ||
| "lineage": "9e13d881-e480-7a63-d47a-b4f5224e6743", | ||
| "outputs": { | ||
| "greeting": { | ||
| "value": "hello world", | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "resources": [ | ||
| { | ||
| "mode": "managed", | ||
| "type": "terraform_data", | ||
| "name": "my-data", | ||
| "provider": "provider[\"terraform.io/builtin/terraform\"]", | ||
| "instances": [ | ||
| { | ||
| "schema_version": 0, | ||
| "attributes": { | ||
| "id": "d71fb368-2ba1-fb4c-5bd9-6a2b7f05d60c", | ||
| "input": { | ||
| "value": "hello world", | ||
| "type": "string" | ||
| }, | ||
| "output": { | ||
| "value": "hello world", | ||
| "type": "string" | ||
| }, | ||
| "triggers_replace": null | ||
| }, | ||
| "sensitive_attributes": [], | ||
| "identity_schema_version": 0 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "check_results": null | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.