-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
Terratest fails when running tests with Terragrunt v0.85.0 or later due to the use of the deprecated --terragrunt-non-interactive flag, which was replaced with --non-interactive as part of Terragrunt's CLI redesign.
To Reproduce
Steps to reproduce the behavior:
- Install Terragrunt v0.85.0 or later
- Run any terratest test that uses terragrunt as the TerraformBinary
- Observe the failure
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../examples/terragrunt-example",
TerraformBinary: "terragrunt",
})
terraform.Apply(t, terraformOptions) // This will failExpected behavior
Tests should run successfully with modern Terragrunt versions.
Actual behavior
Tests fail with error:
Error: Failed to parse command-line flags
│
│ flag provided but not defined: -terragrunt-non-interactive
Terminal output
TestTerragruntExample 2025-09-09T17:07:03+10:00 logger.go:67: time=2025-09-09AEST17:07:03+10:00 level=stderr tf-path=terraform msg=│ Error: Failed to parse command-line flags
TestTerragruntExample 2025-09-09T17:07:03+10:00 logger.go:67: time=2025-09-09AEST17:07:03+10:00 level=stderr tf-path=terraform msg=│
TestTerragruntExample 2025-09-09T17:07:03+10:00 logger.go:67: time=2025-09-09AEST17:07:03+10:00 level=stderr tf-path=terraform msg=│ flag provided but not defined: -terragrunt-non-interactive
Versions
- Terratest version: Latest (main branch - commit a4af63b)
- Terragrunt version: v0.86.2
- Terraform version: v1.13.1
- Go version: v1.24.2
- Environment details: Ubuntu 24.04.2 LTS
Additional context
This issue is caused by Terragrunt's CLI redesign that deprecated all --terragrunt-* prefixed flags in version 0.85.0 (released Aug 15, 2025). The --terragrunt-non-interactive flag was replaced with --non-interactive.
- Issue terratest and terragrunt 0.85 onwards #1586 identifies this exact problem:
Also:
terratest/modules/terraform/cmd.go
Line 58 in 1ce1b74
args = append(args, "--terragrunt-non-interactive") That flag got
deprecatedremoved in v0.85.
Originally posted by @tgeijg in #1586
- No existing PRs address this issue in Terratest or Terragrunt repos
Related:
- Official Terragrunt CLI redesign: https://terragrunt.gruntwork.io/docs/migrate/cli-redesign/
- Related issue: terratest and terragrunt 0.85 onwards #1586 (confirmed our problem, no solution provided)
- Official deprecation schedule: Road to 1.0 Deprecated Feature Removal Schedule terragrunt#3535
- Official CLI redesign RFC: CLI Redesign terragrunt#3445
Root Cause
The issue is in /modules/terraform/cmd.go line 59:
args = append(args, "--terragrunt-non-interactive") // This flag no longer existsProposed Solution
Update to use the new flag:
args = append(args, "--non-interactive") // Modern Terragrunt flag