Skip to content

Upgrade terragrunt module tests to v0.93.10#1627

Merged
james00012 merged 1 commit intomainfrom
update-terragrunt-test-version
Nov 21, 2025
Merged

Upgrade terragrunt module tests to v0.93.10#1627
james00012 merged 1 commit intomainfrom
update-terragrunt-test-version

Conversation

@james00012
Copy link
Copy Markdown
Contributor

@james00012 james00012 commented Nov 21, 2025

Description

Upgrades the terragrunt module tests to use terragrunt v0.93.10 while keeping other modules on v0.80.4. This allows us to test the latest terragrunt features without forcing an upgrade across all tests.

Changes

CircleCI Configuration

  • Add TERRAGRUNT_TEST_VERSION environment variable set to v0.93.10 for terragrunt-specific tests
  • Create install_terragrunt_latest anchor for installing the specified terragrunt version
  • Separate CircleCI test jobs into 4 distinct jobs for better isolation:
    • terraform_test: All modules except terragrunt, using terraform binary
    • terraform_test_tofu: All modules except terragrunt, using tofu binary
    • terragrunt_test: Terragrunt module only, using terraform + v0.93.10
    • terragrunt_test_tofu: Terragrunt module only, using tofu + v0.93.10

Terragrunt Module Code

  • format.go: Update command from hclfmt to hcl format (new v0.93.10 syntax)
  • Test assertions: Use common output patterns compatible with both Terraform and OpenTofu
    • Changed from exact string matches like "Terraform has been successfully initialized!"
    • Now use common patterns like "successfully initialized" that work with both tools
  • TestEnvVarsPropagation: Add auto-detection to use whichever IaC binary is available (terraform or tofu)

Test Quality Improvements

  • format_test.go: Enhanced to verify actual formatting behavior by reading and checking formatted files
  • stack_generate_test.go: Removed duplicate tests that didn't add coverage

Testing

All terragrunt module tests pass locally with v0.93.10 using both terraform and tofu as the underlying IaC binary.

Update CircleCI configuration and terragrunt module tests to use
terragrunt v0.93.10 while maintaining backward compatibility with v0.80.4
for other modules.

## Changes

### CircleCI Configuration
- Add `TERRAGRUNT_TEST_VERSION` env var (v0.93.10) for terragrunt module tests
- Create `install_terragrunt_latest` anchor for manual terragrunt installation
- Separate test jobs into 4 distinct jobs:
  - `terraform_test`: All modules except terragrunt, using terraform
  - `terraform_test_tofu`: All modules except terragrunt, using tofu
  - `terragrunt_test`: Terragrunt module only, using terraform + v0.93.10
  - `terragrunt_test_tofu`: Terragrunt module only, using tofu + v0.93.10

### Terragrunt Module Updates
- Update `format.go`: Change from `hclfmt` to `hcl format` (v0.93.10 syntax)
- Fix test assertions to use common output patterns compatible with both
  Terraform and OpenTofu (e.g., "successfully initialized" instead of exact
  "Terraform has been successfully initialized!")
- Add auto-detection in `TestEnvVarsPropagation` to handle both terraform
  and tofu binaries
- Improve `format_test.go` to verify actual formatting behavior, not just
  command execution
- Remove duplicate tests in `stack_generate_test.go`

## Testing
All terragrunt module tests pass locally with v0.93.10 and both terraform
and tofu as underlying IaC binaries.

Fixes #1609
@james00012 james00012 force-pushed the update-terragrunt-test-version branch from e673394 to 3ca2be6 Compare November 21, 2025 03:09
@james00012 james00012 changed the title Update terragrunt_test to use latest version v0.93.10 Upgrade terragrunt module tests to v0.93.10 Nov 21, 2025
@james00012 james00012 merged commit e743258 into main Nov 21, 2025
2 of 3 checks passed
@james00012 james00012 deleted the update-terragrunt-test-version branch November 21, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants