interrupted execution now exits with an error

This commit is contained in:
James Bardin 2020-10-28 14:33:27 -04:00
parent 95f30451d9
commit f987b69777
2 changed files with 3 additions and 7 deletions

View File

@ -924,7 +924,7 @@ func TestApply_shutdown(t *testing.T) {
"-auto-approve",
testFixturePath("apply-shutdown"),
}
if code := c.Run(args); code != 0 {
if code := c.Run(args); code != 1 {
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
}

View File

@ -845,12 +845,8 @@ func TestPlan_shutdown(t *testing.T) {
"-state=nonexistent.tfstate",
testFixturePath("apply-shutdown"),
})
if code != 0 {
// FIXME: In retrospect cancellation ought to be an unsuccessful exit
// case, but we need to do that cautiously in case it impacts automation
// wrappers. See the note about this in the terraform.stopHook
// implementation for more.
t.Errorf("wrong exit code %d; want 0\noutput:\n%s", code, ui.OutputWriter.String())
if code != 1 {
t.Errorf("wrong exit code %d; want 1\noutput:\n%s", code, ui.OutputWriter.String())
}
select {