Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update regex to reflect 1.4 error changes #361

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tfexec/exit_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ var (

tfVersionMismatchErrRegexp = regexp.MustCompile(`Error: The currently running version of Terraform doesn't meet the|Error: Unsupported Terraform Core version`)
tfVersionMismatchConstraintRegexp = regexp.MustCompile(`required_version = "(.+)"|Required version: (.+)\b`)
configInvalidErrRegexp = regexp.MustCompile(`There are some problems with the configuration, described below.`)
configInvalidErrRegexp = regexp.MustCompile(
`There are some problems with the configuration, described below.|` +
`Error: Unsupported block type|Error: Unsupported argument`, // v1.4+
)

stateLockErrRegexp = regexp.MustCompile(`Error acquiring the state lock`)
stateLockInfoRegexp = regexp.MustCompile(`Lock Info:\n\s*ID:\s*([^\n]+)\n\s*Path:\s*([^\n]+)\n\s*Operation:\s*([^\n]+)\n\s*Who:\s*([^\n]+)\n\s*Version:\s*([^\n]+)\n\s*Created:\s*([^\n]+)\n`)
Expand Down
2 changes: 1 addition & 1 deletion tfexec/internal/e2etest/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func runTestVersions(t *testing.T, versions []string, fixtureName string, cb fun
alreadyRunVersions := map[string]bool{}
for _, tfv := range versions {
t.Run(fmt.Sprintf("%s-%s", fixtureName, tfv), func(t *testing.T) {
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
if !strings.HasPrefix(tfv, "refs/") && runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
v, err := version.NewVersion(tfv)
if err != nil {
t.Fatal(err)
Expand Down