diff --git a/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go index a29837621..e69064ac5 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go @@ -5,6 +5,7 @@ package main import ( "context" "encoding/json" + "fmt" "io/fs" "os" "os/exec" @@ -190,6 +191,14 @@ func TestAComposeAskIsBuiltOnceAndAnsweredOnTheBus(t *testing.T) { return nil, err } workFile = filepath.Join(m.Work, ws, "go.work") + // What the real fetch does before any build (fetchInto, downloadAndVerify): every module the graph + // names is downloaded into the cache, so the build with GOPROXY=off needs none, however much of the + // graph this machine's cache (filled by this module's own build) lacks. Go here is the same go + // command in the same environment, with the workspace in place of the tree's own go.mod. + r := m.Run(ctx, m.goEnv(), "go", "-C", tree, "mod", "download") + if r.Status != 0 || r.Err != "" { + return nil, fmt.Errorf("NOT CHECKED: the composer's modules cannot be downloaded as the fetch step downloads them: %s", causeLine(r.Err+"\n"+r.Stdout+"\n"+r.Stderr)) + } } return map[string]any{"workspace": ws}, nil }