"passing ephemeral variable through vars file":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
"with planfile passing ephemeral variable through vars file":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
constplanVarFile=`
foo="bar"
`
@ -1100,12 +1098,13 @@ foo = "bar"
code:=c.Run(args)
output:=done(t)
ifcode!=0{
t.Fatal("should've succeeded: ",output.Stderr())
t.Fatal("should've succeeded: ",output.All())
}
},
"passing ephemeral variable through environment variable":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
"with planfile passing ephemeral variable through environment variable":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
t.Setenv("TF_VAR_foo","bar")
defert.Setenv("TF_VAR_foo","")
args:=[]string{
"-state",statePath,
@ -1114,24 +1113,114 @@ foo = "bar"
code:=c.Run(args)
output:=done(t)
ifcode!=0{
t.Fatal("should've succeeded: ",output.Stderr())
t.Fatal("should've succeeded: ",output.All())
}
},
"with planfile passing ephemeral variable through interactive prompts":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
close:=testInteractiveInput(t,[]string{"bar"})
deferclose()
args:=[]string{
"-state",statePath,
planPath,
}
code:=c.Run(args)
output:=done(t)
ifcode==0{
// We don't support interactive inputs for apply-time variables
t.Fatal("should have failed: ",output.All())
}
},
"without planfile only passing ephemeral variable":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){
"without planfile passing ephemeral variable through vars file":func(t*testing.T,c*ApplyCommand,statePath,planPathstring,donefunc(*testing.T)*terminal.TestOutput){