Commit d38cd1e
committed
Modularize Terratest into 27 independent modules
Implements complete modularization with no root go.mod, eliminating
dependency bloat and fixing ambiguous import errors.
Fixes #1613
## Changes
- Remove root go.mod
- Add go.work workspace for local development
- Create go.mod for each of 27 modules + internal/lib
- Comprehensive test suite in test/modularization/
- Documentation in MODULARIZATION.md
## Impact
**Before:** Importing any module pulls entire ~50MB library with all cloud SDKs
**After:** Import only what you need (~5MB for terraform module)
## Benefits
- **No ambiguous imports** - Each package has exactly one source
- **Reduced dependencies** - Import only needed modules
- **Independent versioning** - Each module versions separately
- **Cleaner dependency graphs** - No hidden transitive deps from root
## Usage
```go
import "github.com/gruntwork-io/terratest/modules/terraform"
```
```go
require github.com/gruntwork-io/terratest/modules/terraform v0.1.0
```
No replace directives needed - Go fetches from GitHub tags automatically.
## Testing
```bash
cd test/modularization
go test -v ./...
```
Tests validate:
- Dependency isolation
- No ambiguous imports
- All modules build independently
- Workspace builds successfully
## Migration
No breaking changes - import paths stay the same. Consumers automatically
pull only needed modules instead of everything.1 parent e743258 commit d38cd1e
File tree
50 files changed
+1304
-235
lines changed- internal/lib
- modules
- aws
- azure
- collections
- database
- dns-helper
- docker
- environment
- files
- gcp
- git
- helm
- http-helper
- k8s
- logger
- oci
- opa
- packer
- random
- retry
- shell
- slack
- ssh
- terraform
- terragrunt
- test-structure
- testing
- version-checker
- test/modularization
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+1304
-235
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments