Skip to content

Commit

Permalink
command/hook_ui: Increase max length of state IDs (#13317)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Apr 4, 2017
1 parent 0dddb48 commit fc72a20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion command/hook_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const defaultPeriodicUiTimer = 10 * time.Second
const maxIdLen = 20
const maxIdLen = 80

type UiHook struct {
terraform.NilHook
Expand Down
10 changes: 5 additions & 5 deletions command/hook_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fc72a20

Please sign in to comment.