Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Terraform
Commits
86f93a2c
Commit
86f93a2c
authored
3 years ago
by
Omar Ismail
Committed by
Chris Arcand
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Cloud UX test fixes
parent
09d5b70b
main
MatthewTestBranch
add-cont-valid-callout
add-internals-to-sidebar
add-jsonstate-to-cloudbackendstate
add-jsonstate-to-cloudbackendstate2
add-learn-callout-moved-blocks
add-new-intro-docs
add-note-about-spaces
add-tutorial-custom-conditions
add-version-notes-1.2
add-warnings-backends
alisdair/disable-preconditions-postconditions
alisdair/fix-configload-snapshot-panic
alisdair/metadata-functions-command
alisdair/resource-instance-object-dependencies
b-1.1-module-source-git
b-check-output-multi-expand
b-check-resource-multi-expand
b-flatten-panic
b-move-implied-cross-package
b-type-conversion-funcs-null
b-yamldecode-emptydoc-null
backport/29156_do_not_log_sensitive_values/nearly-safe-bullfrog
backport/4th-alternate-mirror-directory-fix/closely-key-civet
backport/add-cont-valid-callout/luckily-golden-wildcat
backport/add-format-function-guidance/ultimately-lucky-halibut
backport/add-internals-to-sidebar/willingly-bright-sunbird
backport/add-learn-callout-moved-blocks/multiply-awaited-cub
backport/add-new-intro-docs/strangely-lucky-bluegill
backport/add-powershell-warning/certainly-amazing-lemur
backport/add-version-notes-1.2/amazingly-premium-woodcock
backport/add-warnings-backends/physically-many-mantis
backport/alisdair/fix-30641/firmly-musical-lemming
backport/alisdair/fix-show-plan-against-non-default-state/blatantly-balanced-porpoise
backport/alisdair/pre-convert-optional-defaults/virtually-able-mouse
backport/alisdair/redact-sensitive-values-from-function-errors/definitely-assured-mantis
backport/b-check-resource-multi-expand/extremely-key-sheep
backport/backport/cstella84/patch-add-hyperlink-for-referenced-argument/manually-patient-locust
backport/barrettclark/update-go-slug/severely-destined-crow
backport/bugfix_typos/hardly-sharp-mosquito
backport/clarify-backend-state-storage/ultimately-causal-ladybird
backport/cstella84/patch-add-hyperlink-for-referenced-argument
backport/doc-provisioner-scp/definitely-capital-bug
backport/doc-refactoring-nav-link/honestly-sweet-sawfly
backport/doc-s3-fix/utterly-close-rabbit
backport/docs-fix-typo/usefully-blessed-monkey
backport/docs-for-each-list-toset/basically-still-zebra
backport/docs/unknwon-value/completely-musical-lionfish
backport/f-build-go1.19.3/largely-peaceful-grouper
backport/f-non-existing-module-instance-crash/neatly-perfect-kiwi
backport/file-provisioner-powershell-warning/noticeably-adequate-mullet
backport/fix-apt-page/abnormally-relative-quagga
backport/fix-backends-link/strangely-emerging-crane
backport/fix-backends-link/vertically-noble-hornet
backport/fix-broken-link/certainly-measured-chipmunk
backport/fix-broken-links-1-10/firmly-equal-rabbit
backport/fix-cdktf-link/highly-pumped-snapper
backport/fix-glossary-table-contents/uniquely-pro-garfish
backport/fix-grammar/precisely-polite-tortoise
backport/fix-internals-overview/globally-allowed-kid
backport/fix-internals-overview/noticeably-up-rodent
backport/fix-intro-page-images/constantly-capable-shiner
backport/fix-last-intro-nits/infinitely-workable-redfish
backport/fix-links-devdot/strictly-notable-sparrow
backport/fix-links-release/seemingly-living-dinosaur
backport/fix-remote-backend-references/primarily-tops-mite
backport/fix-workspace-name-docs/ideally-uncommon-pheasant
backport/jbardin/cancel-auto-approve/extremely-brave-bear
backport/jbardin/k8s-mod-update/likely-probable-falcon
backport/jbardin/static-validate-nested-types/possibly-crack-mouse
backport/kevin/rewrite-internal-redirects/quietly-helped-pelican
backport/main/cleanly-mature-scorpion
backport/mg_no_code_prov_followup/marginally-relevant-eagle
backport/mktg-tf-76ef54dc3c574e032725e0341be8e1d2/constantly-smart-kingfish
backport/mktg-tf-76ef54dc3c574e032725e0341be8e1d2/distinctly-sharp-ferret
backport/mktg-tf-76ef54dc3c574e032725e0341be8e1d2/friendly-evident-grouse
backport/module-invocation-warning/fully-fitting-buzzard
backport/nvanthao/update-docs-implicit-provider/locally-neutral-lemur
backport/optional-type-attributes-note/inherently-dear-goat
backport/patch-1/gladly-mature-oarfish
backport/patch-1/manually-fine-mantis
backport/patch-1/nationally-working-kite
backport/patch-1/noticeably-comic-manatee
backport/patch-1/rarely-informed-gopher
backport/patch-1/sensibly-saving-swine
backport/patch-1/usually-clear-shad
backport/patch-1/vaguely-deciding-beagle
backport/patch-1/virtually-more-rhino
backport/patch-1/wholly-verified-racer
backport/patch-1/willingly-usable-husky
backport/patch-1/yearly-rich-skunk
backport/patch-2/badly-game-spider
backport/patch-2/finally-amazed-catfish
backport/patch-2/openly-clean-tick
backport/patch-2/weekly-selected-tiger
backport/remove-future-statement-import/briefly-viable-glowworm
backport/remove-provisioners/readily-correct-ferret
backport/remove-provisioners/widely-singular-hound
backport/replace-flag-clarifications/definitely-saved-elf
backport/replace-flag-updates/nominally-assured-weevil
backport/startsswith-to-startswith/highly-gorgeous-katydid
backport/system-parameter/infinitely-open-bluebird
backport/tweak-multi-to-multi-migration-tfc/suddenly-real-duckling
backport/update-cloud-block-pages/verbally-key-kangaroo
backport/update-console-docs/closely-genuine-javelin
backport/update-for-each-example/early-crucial-piranha
backport/update-plan-page/lightly-outgoing-halibut
backport/update-run-task-result/factually-star-sunfish
backport/update_docs_for_30072/gradually-trusting-wahoo
backport/workspaces-confusion-fixes/secondly-huge-titmouse
barrettclark/fix-state-outputs-read-permissions
brandonc/changelog_nested_sensitive
brandonc/changelog_sensitive_diff_fixes
brandonc/cloud_upgrade_013
brandonc/nested_attr_sensitive
brandonc/output_cloud_reads
brandonc/providers-estimate
brandonc/run_variables_types
brandonc/scheme_override_cloud
build-pr-checks
build-workflow-dev/cgo-enabled
build-workflow-dev/liamcervante/equivalence-test-action
bump-gcp-storage-dependency
bump-gcp-storage-dependency-2
cloud-e2e-fix
cloud-integration-changelog-entry
dependabot/go_modules/github.com/bmatcuk/doublestar-1.3.4
dependabot/go_modules/github.com/mattn/go-shellwords-1.0.12
dev-portal-updates-docs
dividers-devdot-fixes
doc-provisioner-scp
doc-refactoring-nav-link
doc-unicode-hcl
doc-yamlencode-stable
docs-for-each-list-toset
docs-readme-updates-versioned-docs
ds.submodule-nav-main
f-addrs-static-checkable
f-build-go1.19.3
f-cli-hide-fast-refresh
f-cmd-web
f-diagnostics-cli-reorg
f-dynamic-provider-assignment
f-e2etest-deps-forbidden
f-expand-root-outputs
f-fileexists-errmsg
f-functions-in-providers
f-implied-move-module-call
f-init-provider-source-feedback
f-jsonstate-2
f-moduletest-2
f-new-build-pipeline
f-ng-workflow
f-output-value-types
f-partial-plan-on-error
f-partial-plan-on-error-ui
f-persistent-checks-old
f-svcauth-environment
f-testing-with-conditions
f/azurerm-backend-msal
fix-apt-page
fix-broken-link
fix-broken-links-1-10
fix-cdktf-link
fix-dividers-for-devdot
fix-future-facing-language
fix-future-lang-2
fix-internals-overview
fix-intro-page-images
fix-last-intro-nits
fix-links-devdot
fix-links-release
fix-postconditions-example
fix-preconditions
fix-provisioners-content
fix-readme-again
gcs-backend-add-kms
gcs-backend-add-private-connect-support
gcs-refactor-credential-handling
gs/add-pre-plan-run-tasks
jbardin/1.3-destroy-perf
jbardin/backport-31576
jbardin/call-plan-destroy
jbardin/data-source-destroy-edges
jbardin/lookup-objects
jbardin/output-perf
jbardin/plan-orphan-deleted
jbardin/remove-deprecated-backends
jbardin/resolved-provided-by
jbardin/terraform-data
jbardin/terraform-null
jbardin/trigger-replacement
jbardin/variable-eval
kevin/local-preview-post-split
kevin/preview
kevin/remove-guides-docs
kevin/vercel-config
kmoe/http-backend-debug-log
kmoe/init-checksum-miss-error
kmoe/misc-help-text
kmoe/unused-resource-attributes
lafentres/autolabel-dependabot-prs
lafentres/refactor-show-command
laura-update-docs-readme
laura-update-pre-post-conditions
liamcervante/cicd-go-vet
liamcervante/structured-run-output
link_workflow_tutorials
migrate-go-tfe-1_0
nf/nov21-migrate-away-from-cloud
preapply-runtasks-cli-output
preapply-runtasks-clioutput
release-notes-env-credentials
replace-flag-updates
rt-backport-changelog
rt-changelog-entry-1.1
run-tasks-backport
sebasslash/add-cloud-e2e-test-workflow
sebasslash/add-tf-hostname-env-var
sebasslash/add-tf-org-env-var
sebasslash/env-cloud-e2e-tests
sebasslash/err-approval-input-false
sebasslash/resolve-flaky-env-var-test
sebasslash/tf-workspace-cloud-config
stable-website
tags-reconfigure-msg
tchupp/override-local-vars
test-branch-protection-workflow
tfc-integration-docs
uk1288/backport-cloud-integration-panic-fix
uk1288/fix-for-cloud-integration-panic
uk1288/update-changelog-md
uk1288/update-changelog-md-v1-1
update-TF-WORKSPACE-variable
update-cidrnetmask-docs
update-depends-on-docs
update-for-each-example
update-packaging-action-name
update_gen_meta
uturunku1-patch-1
uturunku1-patch-2
v1.1
v1.4.0-alpha20221109
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc1
v1.3.0-dev
v1.3.0-beta1
v1.3.0-alpha20220817
v1.3.0-alpha20220803
v1.3.0-alpha20220706
v1.3.0-alpha20220622
v1.3.0-alpha20220608
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc2
v1.2.0-rc1
v1.2.0-beta1
v1.2.0-alpha20220413
v1.2.0-alpha-20220328
v1.1.9
v1.1.8
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.1.0-rc1
v1.1.0-beta2
v1.1.0-beta1
v1.1.0-alpha20211029
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
internal/cloud/e2e/apply_auto_approve_test.go
+5
-5
internal/cloud/e2e/apply_auto_approve_test.go
internal/cloud/e2e/helper_test.go
+1
-1
internal/cloud/e2e/helper_test.go
internal/cloud/e2e/migrate_state_multi_to_tfc_test.go
+2
-2
internal/cloud/e2e/migrate_state_multi_to_tfc_test.go
internal/cloud/e2e/migrate_state_remote_backend_to_tfc_test.go
+14
-14
...nal/cloud/e2e/migrate_state_remote_backend_to_tfc_test.go
internal/cloud/e2e/migrate_state_single_to_tfc_test.go
+4
-4
internal/cloud/e2e/migrate_state_single_to_tfc_test.go
internal/cloud/e2e/migrate_state_tfc_to_other_test.go
+1
-1
internal/cloud/e2e/migrate_state_tfc_to_other_test.go
internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go
+14
-14
internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go
with
41 additions
and
41 deletions
+41
-41
internal/cloud/e2e/apply_auto_approve_test.go
+
5
-
5
View file @
86f93a2c
...
...
@@ -18,7 +18,7 @@ import (
func
Test_terraform_apply_autoApprove
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
tfVersion
:=
"1.1.0-tfc-integration"
if
!
hasTerraformVersion
(
v
ersion
)
{
if
!
hasTerraformVersion
(
t
,
tfV
ersion
)
{
t
.
Skip
(
"Skipping test because TFC does not have current terraform version."
)
}
...
...
@@ -42,7 +42,7 @@ func Test_terraform_apply_autoApprove(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"apply"
},
...
...
@@ -82,7 +82,7 @@ func Test_terraform_apply_autoApprove(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"apply"
},
...
...
@@ -122,7 +122,7 @@ func Test_terraform_apply_autoApprove(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"apply"
,
"-auto-approve"
},
...
...
@@ -160,7 +160,7 @@ func Test_terraform_apply_autoApprove(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"apply"
,
"-auto-approve"
},
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/helper_test.go
+
1
-
1
View file @
86f93a2c
...
...
@@ -197,7 +197,7 @@ func writeMainTF(t *testing.T, block string, dir string) {
}
// Ensure that TFC/E has a particular terraform version.
func
hasTerraformVersion
(
version
string
)
bool
{
func
hasTerraformVersion
(
t
*
testing
.
T
,
version
string
)
bool
{
opts
:=
tfe
.
AdminTerraformVersionsListOptions
{
ListOptions
:
tfe
.
ListOptions
{
PageNumber
:
1
,
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/migrate_state_multi_to_tfc_test.go
+
2
-
2
View file @
86f93a2c
...
...
@@ -68,7 +68,7 @@ func Test_migrate_multi_to_tfc_cloud_name_strategy(t *testing.T) {
userInput
:
[]
string
{
"yes"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to Terraform Cloud?`
,
`
Successfully configured Terraform Clou
d!`
},
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -309,7 +309,7 @@ func Test_migrate_multi_to_tfc_cloud_tags_strategy(t *testing.T) {
`Would you like to rename your workspaces?`
,
"What pattern would you like to add to all your workspaces?"
,
"The currently selected workspace (prod) does not exist."
,
"Terraform has been successfully initialized!"
},
"Terraform
Cloud
has been successfully initialized!"
},
},
{
command
:
[]
string
{
"workspace"
,
"select"
,
"app-prod"
},
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/migrate_state_remote_backend_to_tfc_test.go
+
14
-
14
View file @
86f93a2c
...
...
@@ -50,9 +50,9 @@ func Test_migrate_remote_backend_name_to_tfc_name(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`Do you want to copy existing state to
the new backen
d?`
,
expectedCmdOutput
:
`Do you want to copy existing state to
Terraform Clou
d?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured Terraform Clou
d!`
},
postInputOutput
:
[]
string
{
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -102,7 +102,7 @@ func Test_migrate_remote_backend_name_to_tfc_name(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`Terraform has been successfully initialized!`
,
expectedCmdOutput
:
`Terraform
Cloud
has been successfully initialized!`
,
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -232,9 +232,9 @@ func Test_migrate_remote_backend_name_to_tfc_name_different_org(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`Do you want to copy existing state to
the new backen
d?`
,
expectedCmdOutput
:
`Do you want to copy existing state to
Terraform Clou
d?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured Terraform Clou
d!`
},
postInputOutput
:
[]
string
{
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -376,8 +376,8 @@ func Test_migrate_remote_backend_name_to_tfc_tags(t *testing.T) {
expectedCmdOutput
:
`Terraform Cloud configuration only allows named workspaces!`
,
userInput
:
[]
string
{
"cloud-workspace"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to
the new backen
d?`
,
`
Successfully configured the backend "cloud"
!`
},
`Do you want to copy existing state to
Terraform Clou
d?`
,
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -513,10 +513,10 @@ func Test_migrate_remote_backend_prefix_to_tfc_name(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`Do you want to copy existing state to
the new backen
d?`
,
expectedCmdOutput
:
`Do you want to copy existing state to
Terraform Clou
d?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured Terraform Clou
d!`
},
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -581,7 +581,7 @@ func Test_migrate_remote_backend_prefix_to_tfc_name(t *testing.T) {
expectedCmdOutput
:
`Do you want to copy only your current workspace?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured the backend "cloud"
!`
},
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -731,11 +731,11 @@ func Test_migrate_remote_backend_prefix_to_tfc_tags(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`The
"cloud" backen
d configuration only allows named workspaces!`
,
expectedCmdOutput
:
`The
Terraform Clou
d configuration only allows named workspaces!`
,
userInput
:
[]
string
{
"cloud-workspace"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to
the new backen
d?`
,
`
Successfully configured the backend "cloud"
!`
},
`Do you want to copy existing state to
Terraform Clou
d?`
,
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"list"
},
...
...
@@ -801,7 +801,7 @@ func Test_migrate_remote_backend_prefix_to_tfc_tags(t *testing.T) {
expectedCmdOutput
:
`Would you like to rename your workspaces?`
,
userInput
:
[]
string
{
"1"
,
"*"
},
postInputOutput
:
[]
string
{
`What pattern would you like to add to all your workspaces?`
,
`
Successfully configured the backend "cloud"
!`
},
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/migrate_state_single_to_tfc_test.go
+
4
-
4
View file @
86f93a2c
...
...
@@ -50,9 +50,9 @@ func Test_migrate_single_to_tfc(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
},
expectedCmdOutput
:
`Do you want to copy existing state to
the
Terraform Cloud?`
,
expectedCmdOutput
:
`Do you want to copy existing state to Terraform Cloud?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured Terraform Clou
d!`
},
postInputOutput
:
[]
string
{
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"list"
},
...
...
@@ -104,8 +104,8 @@ func Test_migrate_single_to_tfc(t *testing.T) {
expectedCmdOutput
:
`Terraform Cloud configuration only allows named workspaces!`
,
userInput
:
[]
string
{
"new-workspace"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to
the new backen
d?`
,
`
Successfully configured Terraform Clou
d!`
},
`Do you want to copy existing state to
Terraform Clou
d?`
,
`
Terraform Cloud has been successfully initialize
d!`
},
},
{
command
:
[]
string
{
"workspace"
,
"list"
},
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/migrate_state_tfc_to_other_test.go
+
1
-
1
View file @
86f93a2c
...
...
@@ -28,7 +28,7 @@ func Test_migrate_tfc_to_other(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
},
},
...
...
This diff is collapsed.
Click to expand it.
internal/cloud/e2e/migrate_state_tfc_to_tfc_test.go
+
14
-
14
View file @
86f93a2c
...
...
@@ -17,7 +17,7 @@ import (
func
Test_migrate_tfc_to_tfc_single_workspace
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
tfVersion
:=
"1.1.0-tfc-integration"
if
!
hasTerraformVersion
(
v
ersion
)
{
if
!
hasTerraformVersion
(
t
,
tfV
ersion
)
{
t
.
Skip
(
"Skipping test because TFC does not have current terraform version."
)
}
...
...
@@ -49,7 +49,7 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -76,9 +76,9 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`Do you want to copy existing state to
the new backen
d?`
,
expectedCmdOutput
:
`Do you want to copy existing state to
Terraform Clou
d?`
,
userInput
:
[]
string
{
"yes"
},
postInputOutput
:
[]
string
{
`
Successfully configured the backend "cloud"
!`
},
postInputOutput
:
[]
string
{
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -117,7 +117,7 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`
Successfully configured the backend "cloud"
!`
,
expectedCmdOutput
:
`
Terraform Cloud has been successfully initialized
!`
,
},
{
command
:
[]
string
{
"apply"
},
...
...
@@ -136,11 +136,11 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) {
commands
:
[]
tfCommand
{
{
command
:
[]
string
{
"init"
,
"-migrate-state"
,
"-ignore-remote-version"
},
expectedCmdOutput
:
`The
"cloud" backen
d configuration only allows named workspaces!`
,
expectedCmdOutput
:
`The
Terraform Clou
d configuration only allows named workspaces!`
,
userInput
:
[]
string
{
"new-workspace"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to
the new backen
d?`
,
`
Successfully configured the backend "cloud"
!`
},
`Do you want to copy existing state to
Terraform Clou
d?`
,
`
Terraform Cloud has been successfully initialized
!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -240,7 +240,7 @@ func Test_migrate_tfc_to_tfc_single_workspace(t *testing.T) {
func
Test_migrate_tfc_to_tfc_multiple_workspace
(
t
*
testing
.
T
)
{
ctx
:=
context
.
Background
()
tfVersion
:=
"1.1.0-tfc-integration"
if
!
hasTerraformVersion
(
v
ersion
)
{
if
!
hasTerraformVersion
(
t
,
tfV
ersion
)
{
t
.
Skip
(
"Skipping test because TFC does not have current terraform version."
)
}
...
...
@@ -276,7 +276,7 @@ func Test_migrate_tfc_to_tfc_multiple_workspace(t *testing.T) {
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`The currently selected workspace (default) does not exist.`
,
userInput
:
[]
string
{
"1"
},
postInputOutput
:
[]
string
{
`Terraform has been successfully initialized!`
},
postInputOutput
:
[]
string
{
`Terraform
Cloud
has been successfully initialized!`
},
},
{
command
:
[]
string
{
"apply"
},
...
...
@@ -319,8 +319,8 @@ func Test_migrate_tfc_to_tfc_multiple_workspace(t *testing.T) {
expectedCmdOutput
:
`Do you want to copy only your current workspace?`
,
userInput
:
[]
string
{
"yes"
,
"yes"
},
postInputOutput
:
[]
string
{
`Do you want to copy existing state to
the new backen
d?`
,
`Terraform has been successfully initialized!`
},
`Do you want to copy existing state to
Terraform Clou
d?`
,
`Terraform
Cloud
has been successfully initialized!`
},
},
{
command
:
[]
string
{
"workspace"
,
"show"
},
...
...
@@ -370,7 +370,7 @@ func Test_migrate_tfc_to_tfc_multiple_workspace(t *testing.T) {
command
:
[]
string
{
"init"
},
expectedCmdOutput
:
`The currently selected workspace (default) does not exist.`
,
userInput
:
[]
string
{
"1"
},
postInputOutput
:
[]
string
{
`Terraform has been successfully initialized!`
},
postInputOutput
:
[]
string
{
`Terraform
Cloud
has been successfully initialized!`
},
},
{
command
:
[]
string
{
"apply"
,
"-auto-approve"
},
...
...
@@ -401,7 +401,7 @@ func Test_migrate_tfc_to_tfc_multiple_workspace(t *testing.T) {
postInputOutput
:
[]
string
{
`What pattern would you like to add to all your workspaces?`
,
`The currently selected workspace (app-staging) does not exist.`
,
`
Successfully configured the backend "cloud"
!`
},
`
Terraform Cloud has been successfully initialized
!`
},
},
},
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help