opentofu/command/012_config_upgrade_test.go
Martin Atkins f0ccee854c command/0.13upgrade: Remove this subcommand
We only preserve these major upgrade versions for one major version after
they are added, because our upgrade path assumes moving forward only one
major version at a time. Now that our main branch is tracking towards
Terraform 0.14, we no longer need the 0.13upgrade subcommand.

This also includes some minor adjustments to the 0.12upgrade command to
align the terminology used in the output of both commands. We usually
use the word "deprecated" to mean that something is still available but
no longer recommended, but neither of these commands is actually available
so "removed" is clearer.

We could in principle have removed even the removal notice for 0.12upgrade
here, but it's relatively little code and not a big deal to keep around
to help prompt those who might try to upgrade directly from 0.11 to 0.14.
We may still remove the historical configuration upgrade commands prior to
releasing Terraform 1.0, though.
2020-09-29 10:00:35 -07:00

27 lines
478 B
Go

package command
import (
"strings"
"testing"
"github.com/mitchellh/cli"
)
func TestZeroTwelveUpgrade_deprecated(t *testing.T) {
ui := new(cli.MockUi)
c := &ZeroTwelveUpgradeCommand{
Meta: Meta{
Ui: ui,
},
}
if code := c.Run([]string{}); code != 0 {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
}
output := ui.OutputWriter.String()
if !strings.Contains(output, "The 0.12upgrade command has been removed.") {
t.Fatal("unexpected output:", output)
}
}