Skip to content

Commit 2f54d44

Browse files
committed
v2 modularization: tier gates, test-external harness, workflow fixes
- Update check-acyclic-deps tier map to the 16-module tree (drop removed packages, use renamed names); all four CI gates (acyclic, single-source, siv-placement, no-replaces) pass. - Add test-external/ consumer-simulation (own go.mod, kept out of go.work) that pulls core + terraform under GOWORK=off; red until the coordinated v2 tags exist, by design. - Fix v2-release.yml tag-push list to the 16 modules (no shell/slack/oci/version-checker/cmd; renamed http-helper/dns-helper/test-structure).
1 parent 71137c9 commit 2f54d44

5 files changed

Lines changed: 42 additions & 32 deletions

File tree

.github/workflows/v2-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ jobs:
6666
# Same order as docs/v2-release-runbook.md.
6767
ORDER=(
6868
modules/core
69-
modules/shell modules/ssh modules/http-helper modules/dns-helper modules/version-checker
70-
modules/docker modules/packer modules/database modules/slack modules/oci modules/opa
69+
modules/ssh modules/httphelper modules/dnshelper
70+
modules/docker modules/packer modules/database modules/opa
7171
modules/aws modules/azure modules/gcp modules/k8s modules/helm
72-
modules/terraform modules/terragrunt modules/test-structure
73-
cmd/terratest_log_parser cmd/pick-instance-type
72+
modules/terraform modules/terragrunt modules/teststructure
73+
7474
)
7575
7676
for path in "${ORDER[@]}"; do
@@ -92,7 +92,7 @@ jobs:
9292
# Allow the proxy a moment to populate after push.
9393
sleep 30
9494
fail=0
95-
for path in modules/core modules/shell modules/ssh modules/http-helper modules/dns-helper modules/version-checker modules/docker modules/packer modules/database modules/slack modules/oci modules/opa modules/aws modules/azure modules/gcp modules/k8s modules/helm modules/terraform modules/terragrunt modules/test-structure cmd/terratest_log_parser cmd/pick-instance-type; do
95+
for path in modules/core modules/ssh modules/httphelper modules/dnshelper modules/docker modules/packer modules/database modules/opa modules/aws modules/azure modules/gcp modules/k8s modules/helm modules/terraform modules/terragrunt modules/teststructure; do
9696
url="https://proxy.golang.org/github.com/gruntwork-io/terratest/${path}/v2/@v/${VERSION}.info"
9797
code=$(curl -s -o /dev/null -w '%{http_code}' "$url")
9898
if [ "$code" = "200" ]; then

modules/core/go.mod

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
module github.com/gruntwork-io/terratest/modules/core/v2
22

33
go 1.26
4-
5-
require (
6-
github.com/gruntwork-io/go-commons v0.17.2
7-
github.com/jstemmer/go-junit-report v1.0.0
8-
github.com/mattn/go-zglob v0.0.6
9-
github.com/sirupsen/logrus v1.9.4
10-
github.com/stretchr/testify v1.11.1
11-
)
12-
13-
require (
14-
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
15-
github.com/davecgh/go-spew v1.1.1 // indirect
16-
github.com/go-errors/errors v1.4.2 // indirect
17-
github.com/pmezard/go-difflib v1.0.0 // indirect
18-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
19-
github.com/urfave/cli/v2 v2.10.3 // indirect
20-
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
21-
golang.org/x/sys v0.18.0 // indirect
22-
gopkg.in/yaml.v3 v3.0.1 // indirect
23-
)

scripts/check-acyclic-deps.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ set -uo pipefail
1212
# Tier assignment. Lower number = lower layer.
1313
declare -A TIER=(
1414
[core]=0
15-
[shell]=1
1615
[ssh]=1
17-
[http-helper]=1
18-
[dns-helper]=1
16+
[httphelper]=1
17+
[dnshelper]=1
1918
[docker]=2
2019
[packer]=2
2120
[database]=2
22-
[slack]=2
23-
[oci]=2
2421
[opa]=2
2522
[aws]=3
2623
[azure]=3
@@ -29,8 +26,7 @@ declare -A TIER=(
2926
[helm]=3
3027
[terraform]=4
3128
[terragrunt]=4
32-
[test-structure]=4
33-
[version-checker]=4
29+
[teststructure]=4
3430
)
3531

3632
fail=0

test-external/consumer_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package external_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/gruntwork-io/terratest/modules/core/v2/random"
7+
"github.com/gruntwork-io/terratest/modules/terraform/v2"
8+
"github.com/stretchr/testify/assert"
9+
)
10+
11+
// Proves a real external consumer can pull a tier-0 module (core) and a top-tier
12+
// module (terraform, which transitively requires httphelper/opa/ssh) purely through
13+
// published go.mods under GOWORK=off.
14+
func TestExternalConsumer(t *testing.T) {
15+
t.Parallel()
16+
17+
assert.Len(t, random.UniqueId(), 6)
18+
19+
opts := terraform.Options{TerraformDir: "."}
20+
assert.Equal(t, ".", opts.TerraformDir)
21+
}

test-external/go.mod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// In-repo consumer-simulation project. Imports a cross-section of terratest v2
2+
// submodules under GOWORK=off so CI can verify the external-consumer experience:
3+
// each submodule resolves through its own go.mod and the proxy, not the workspace.
4+
// NOT published; exists only to be tested by CI (red until the v2 tags are cut).
5+
module github.com/gruntwork-io/terratest/test-external
6+
7+
go 1.26
8+
9+
require (
10+
github.com/gruntwork-io/terratest/modules/core/v2 v2.0.0
11+
github.com/gruntwork-io/terratest/modules/terraform/v2 v2.0.0
12+
github.com/stretchr/testify v1.11.1
13+
)

0 commit comments

Comments
 (0)