|
|
|
|
@ -29,8 +29,8 @@ func Test_migrate_remote_backend_name_to_tfc_name(t *testing.T) {
|
|
|
|
|
expectedCmdOutput: `Successfully configured the backend "remote"!`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
command: []string{"apply", "-auto-approve"},
|
|
|
|
|
postInputOutput: []string{`Apply complete!`},
|
|
|
|
|
command: []string{"apply", "-auto-approve"},
|
|
|
|
|
expectedCmdOutput: `Apply complete!`,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -43,9 +43,11 @@ func Test_migrate_remote_backend_name_to_tfc_name(t *testing.T) {
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Should Terraform migrate your existing state?`,
|
|
|
|
|
userInput: []string{"yes"},
|
|
|
|
|
postInputOutput: []string{`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
command: []string{"workspace", "show"},
|
|
|
|
|
@ -164,7 +166,11 @@ func Test_migrate_remote_backend_name_to_tfc_same_name(t *testing.T) {
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Terraform Cloud has been successfully initialized!`,
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
command: []string{"workspace", "show"},
|
|
|
|
|
@ -284,9 +290,11 @@ func Test_migrate_remote_backend_name_to_tfc_name_different_org(t *testing.T) {
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Should Terraform migrate your existing state?`,
|
|
|
|
|
userInput: []string{"yes"},
|
|
|
|
|
postInputOutput: []string{`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
command: []string{"workspace", "show"},
|
|
|
|
|
@ -415,10 +423,11 @@ func Test_migrate_remote_backend_name_to_tfc_tags(t *testing.T) {
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Terraform Cloud requires all workspaces to be given an explicit name.`,
|
|
|
|
|
userInput: []string{"cloud-workspace", "yes"},
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "cloud-workspace", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud requires all workspaces to be given an explicit name.`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -545,9 +554,10 @@ func Test_migrate_remote_backend_prefix_to_tfc_name_strategy_single_workspace(t
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Should Terraform migrate your existing state?`,
|
|
|
|
|
userInput: []string{"yes"},
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@ -823,10 +833,11 @@ func Test_migrate_remote_backend_prefix_to_tfc_tags_strategy_single_workspace(t
|
|
|
|
|
commands: []tfCommand{
|
|
|
|
|
{
|
|
|
|
|
command: []string{"init", "-ignore-remote-version"},
|
|
|
|
|
expectedCmdOutput: `Terraform Cloud requires all workspaces to be given an explicit name.`,
|
|
|
|
|
userInput: []string{"cloud-workspace", "yes"},
|
|
|
|
|
expectedCmdOutput: `Migrating from backend "remote" to Terraform Cloud.`,
|
|
|
|
|
userInput: []string{"yes", "cloud-workspace", "yes"},
|
|
|
|
|
postInputOutput: []string{
|
|
|
|
|
`Should Terraform migrate your existing state?`,
|
|
|
|
|
`Terraform Cloud requires all workspaces to be given an explicit name.`,
|
|
|
|
|
`Terraform Cloud has been successfully initialized!`},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
|