command/hook_ui: Increase max length of state IDs (#13317)

This commit is contained in:
Radek Simko 2017-04-04 15:41:54 +01:00 committed by GitHub
parent 0dddb48239
commit fc72a20c66
2 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ import (
)
const defaultPeriodicUiTimer = 10 * time.Second
const maxIdLen = 20
const maxIdLen = 80
type UiHook struct {
terraform.NilHook

View File

@ -70,10 +70,10 @@ func TestUiHookPreApply_periodicTimer(t *testing.T) {
close(uiState.DoneCh)
<-uiState.done
expectedOutput := `data.aws_availability_zones.available: Destroying... (ID: 2017-03-0...0000 UTC)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 1s elapsed)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 2s elapsed)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 3s elapsed)
expectedOutput := `data.aws_availability_zones.available: Destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 1s elapsed)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 2s elapsed)
data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 3s elapsed)
`
output := ui.OutputWriter.String()
if output != expectedOutput {
@ -138,7 +138,7 @@ func TestUiHookPreApply_destroy(t *testing.T) {
t.Fatalf("Expected hook to continue, given: %#v", action)
}
expectedOutput := "data.aws_availability_zones.available: Destroying... (ID: 2017-03-0...0000 UTC)\n"
expectedOutput := "data.aws_availability_zones.available: Destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC)\n"
output := ui.OutputWriter.String()
if output != expectedOutput {
t.Fatalf("Output didn't match.\nExpected: %q\nGiven: %q", expectedOutput, output)