From 33057eb97467b72ea4aa343b3afa856bba7e3328 Mon Sep 17 00:00:00 2001 From: Tony Redondo Date: Wed, 28 Oct 2026 16:12:17 +0100 Subject: [PATCH 1/3] go: exclude development Bazel config from runtime patches --- .../profiles/bzlmod_runtime.json | 7 ++- .../profiles/workspace_runtime.json | 7 ++- .../python/test_rules_go_profile_tools.py | 59 +++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/third_party/rules_go_orchestrion/profiles/bzlmod_runtime.json b/third_party/rules_go_orchestrion/profiles/bzlmod_runtime.json index 3b35adfb..d79f4337 100644 --- a/third_party/rules_go_orchestrion/profiles/bzlmod_runtime.json +++ b/third_party/rules_go_orchestrion/profiles/bzlmod_runtime.json @@ -1,7 +1,7 @@ { "schema_version": 1, "name": "bzlmod_runtime", - "description": "Runtime Orchestrion/Test Optimization patch for Bzlmod consumers, including rules_go's Orchestrion extension registration. Excludes lockfiles and repository tests.", + "description": "Runtime Orchestrion/Test Optimization patch for Bzlmod consumers, including rules_go's Orchestrion extension registration. Excludes lockfiles, development Bazel configuration, and repository tests.", "variant": "base", "include": [ "/BUILD.bazel", @@ -45,8 +45,13 @@ "go/tools/builders/tool_version.go" ], "exclude": [ + "/.bazelrc", + "/.bazelversion", "/MODULE.bazel.lock", "docs/**", + "examples/.bazelrc", + "examples/basic_gazelle/.bazelversion", + "examples/hello/.bazelversion", "tests/**", "**/*_test.go" ], diff --git a/third_party/rules_go_orchestrion/profiles/workspace_runtime.json b/third_party/rules_go_orchestrion/profiles/workspace_runtime.json index 14133099..49acbbd7 100644 --- a/third_party/rules_go_orchestrion/profiles/workspace_runtime.json +++ b/third_party/rules_go_orchestrion/profiles/workspace_runtime.json @@ -1,7 +1,7 @@ { "schema_version": 1, "name": "workspace_runtime", - "description": "Generic WORKSPACE-mode runtime Orchestrion/Test Optimization patch profile. This excludes Bzlmod extension wiring and public repository tests.", + "description": "Generic WORKSPACE-mode runtime Orchestrion/Test Optimization patch profile. This excludes Bzlmod extension wiring, development Bazel configuration, and public repository tests.", "variant": "base", "include": [ "/BUILD.bazel", @@ -43,9 +43,14 @@ "go/tools/builders/tool_version.go" ], "exclude": [ + "/.bazelrc", + "/.bazelversion", "/MODULE.bazel", "/MODULE.bazel.lock", "docs/**", + "examples/.bazelrc", + "examples/basic_gazelle/.bazelversion", + "examples/hello/.bazelversion", "go/extensions.bzl", "tests/**", "**/*_test.go" diff --git a/tools/tests/python/test_rules_go_profile_tools.py b/tools/tests/python/test_rules_go_profile_tools.py index 48e9e348..f4548426 100644 --- a/tools/tests/python/test_rules_go_profile_tools.py +++ b/tools/tests/python/test_rules_go_profile_tools.py @@ -24,6 +24,15 @@ from unittest import mock +DEVELOPMENT_BAZEL_CONFIGS = ( + ".bazelrc", + ".bazelversion", + "examples/.bazelrc", + "examples/basic_gazelle/.bazelversion", + "examples/hello/.bazelversion", +) + + def _runfile(rel_path: str) -> Path: """Resolve a Bazel runfile, with a direct-checkout fallback.""" test_srcdir = os.environ.get("TEST_SRCDIR", "") @@ -173,6 +182,56 @@ def test_profile_validation_rejects_bare_basename_patterns(self) -> None: with self.assertRaisesRegex(ValueError, "bare basename"): self.mod.load_profile(path) + def test_profiles_exclude_only_known_development_bazel_configuration(self) -> None: + """Consumer patches omit dev config without hiding new runtime changes.""" + runtime = ["go/private/BUILD.bazel", "go/tools/builders/module_proxy.go"] + unknown = ["examples/new/.bazelversion", "go/private/.bazelrc"] + for name in ("workspace_runtime", "bzlmod_runtime"): + with self.subTest(profile=name): + profile = self.mod.load_profile( + _runfile(f"third_party/rules_go_orchestrion/profiles/{name}.json") + ) + classified = self.mod.classify_paths( + [*DEVELOPMENT_BAZEL_CONFIGS, *runtime, *unknown], profile + ) + self.assertEqual(sorted(DEVELOPMENT_BAZEL_CONFIGS), classified.excluded) + self.assertEqual(runtime, classified.included) + self.assertEqual(unknown, classified.unclassified) + + def test_generated_profiles_leave_consumer_bazel_configuration_unchanged(self) -> None: + """Excluded security config is audited in manifests, not consumer patches.""" + for name in ("workspace_runtime", "bzlmod_runtime"): + with self.subTest(profile=name), tempfile.TemporaryDirectory() as raw_tmp: + root = Path(raw_tmp) + upstream, fork = root / "upstream", root / "fork" + runtime = "go/tools/builders/builder.go" + _write(upstream / runtime, "package main\n") + for path in DEVELOPMENT_BAZEL_CONFIGS: + _write(upstream / path, "consumer configuration\n") + _copy_tree(upstream, fork) + _write(fork / runtime, "package main\nvar Instrumented = true\n") + for path in DEVELOPMENT_BAZEL_CONFIGS: + _write(fork / path, "updated secure development configuration\n") + profile = self.mod.load_profile( + _runfile(f"third_party/rules_go_orchestrion/profiles/{name}.json") + ) + result = self.mod.generate_patch_from_trees( + upstream_root=upstream, fork_root=fork, profile=profile, + output=root / "runtime.patch", manifest=root / "manifest.json", + manifest_context={ + "upstream_id": "fixture", "rules_go_version": "0.0.0", + "upstream_repository": "https://github.com/bazel-contrib/rules_go.git", + "upstream_commit": "abc123", "variant": "base", + }, + ) + manifest = json.loads(result.manifest.read_text(encoding="utf-8")) + self.assertEqual(sorted(DEVELOPMENT_BAZEL_CONFIGS), manifest["excluded_paths"]) + self.assertEqual([runtime], manifest["included_paths"]) + subprocess.run(["git", "-C", str(upstream), "apply", "-p1", str(result.output)], check=True) + self.assertEqual((fork / runtime).read_bytes(), (upstream / runtime).read_bytes()) + for path in DEVELOPMENT_BAZEL_CONFIGS: + self.assertEqual("consumer configuration\n", (upstream / path).read_text(encoding="utf-8")) + def test_bzlmod_profile_extends_workspace_runtime_without_lockfiles(self) -> None: """Bzlmod adds module registration and its public extension alias only.""" workspace = self.workspace_profile() From fdb447c55dfd0ae0e4319d9f22d0e0ed4921956f Mon Sep 17 00:00:00 2001 From: Tony Redondo Date: Wed, 28 Oct 2026 17:51:34 +0100 Subject: [PATCH 2/3] ci: register shell toolchains in WORKSPACE Go fixtures --- tools/tests/BUILD.bazel | 1 + .../run_workspace_go_integration.sh | 8 +++ tools/tests/python/BUILD.bazel | 1 + tools/tests/python/test_python_tools.py | 66 +++++++++++++++++++ 4 files changed, 76 insertions(+) diff --git a/tools/tests/BUILD.bazel b/tools/tests/BUILD.bazel index 9244021f..a4c0260e 100644 --- a/tools/tests/BUILD.bazel +++ b/tools/tests/BUILD.bazel @@ -19,6 +19,7 @@ exports_files( [ "example_stub_repo.bzl", "integration/mock_dd_server.py", + "integration/run_workspace_go_integration.sh", ], visibility = ["//visibility:public"], ) diff --git a/tools/tests/integration/run_workspace_go_integration.sh b/tools/tests/integration/run_workspace_go_integration.sh index 484069a6..d3d972b2 100755 --- a/tools/tests/integration/run_workspace_go_integration.sh +++ b/tools/tests/integration/run_workspace_go_integration.sh @@ -1099,6 +1099,14 @@ dd_topt_go_orchestrion_tool_repo( ) go_rules_dependencies() + +# Bazel's collect_coverage helper needs a shell toolchain even for a plain +# go_test. Bzlmod registers it automatically; WORKSPACE consumers must do so. +load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") + +rules_shell_dependencies() +rules_shell_toolchains() + go_register_toolchains(version = "${GO_VERSION}") gazelle_dependencies() diff --git a/tools/tests/python/BUILD.bazel b/tools/tests/python/BUILD.bazel index 4550898e..8f85d2d1 100644 --- a/tools/tests/python/BUILD.bazel +++ b/tools/tests/python/BUILD.bazel @@ -79,6 +79,7 @@ sh_test( "//tools/test_optimization:create_support_bundle.py", "//tools/test_optimization:render_report_summary.py", "//tools/tests:integration/mock_dd_server.py", + "//tools/tests:integration/run_workspace_go_integration.sh", "//tools/tests/python/fixtures/generated_uploader", ], ) diff --git a/tools/tests/python/test_python_tools.py b/tools/tests/python/test_python_tools.py index a561b8a9..69b49916 100644 --- a/tools/tests/python/test_python_tools.py +++ b/tools/tests/python/test_python_tools.py @@ -9068,6 +9068,72 @@ def test_powershell_runtime_supports_multi_context_selection(self) -> None: self.assertIn("Log-Stderr \"warning: skipping context enrichment", powershell_text) +class GoWorkspaceIntegrationTests(unittest.TestCase): + def test_generated_consumers_register_shell_toolchains(self) -> None: + """Both fetch paths initialize the shell rules used by collect_coverage.""" + bash = _require_functional_bash(self) + source = _runfile("tools/tests/integration/run_workspace_go_integration.sh").read_text( + encoding="utf-8" + ) + quote = source[source.index("bzl_quote() {"):source.index("\nsha256_file() {")] + writer = source[ + source.index("write_positive_workspace() {"): + source.index("\nwrite_invalid_workspace() {") + ] + env = { + **os.environ, + "PYTHON": sys.executable, + "REPO_ROOT": "/fixture/rules with spaces", + "rules_go_fork_abs": "/fixture/rules with spaces/third_party/rgo/v0_60_0/base", + "ARCHIVE_URL": "file:///fixture/rules.tar.gz", + "ARCHIVE_SHA256": "a" * 64, + "ARCHIVE_NAME": "rules-fixture", + "RULES_GO_UPSTREAM": "v0_60_0", + "RULES_GO_VARIANT": "base", + "ORCHESTRION_VERSION": "v1.12.0", + "GO_VERSION": "1.25.0", + "SERVICE_NAME": "fixture-service", + "MODULE_IMPORTPATH": "example.com/fixture", + "OUT_DIR": "custom_topt", + } + for fetch_mode in ("local", "archive"): + with self.subTest(fetch_mode=fetch_mode), tempfile.TemporaryDirectory() as tmp: + subprocess.run( + [ + bash, "-eu", "-c", + quote + writer + '\nwrite_positive_workspace "$1" "$2"', + "fixture", tmp, fetch_mode, + ], + env=env, + check=True, + capture_output=True, + text=True, + ) + workspace = ast.parse(Path(tmp, "WORKSPACE").read_text(encoding="utf-8")) + calls = [ + node.value for node in workspace.body + if isinstance(node, ast.Expr) and isinstance(node.value, ast.Call) + ] + shell_load = next( + ( + index for index, call in enumerate(calls) + if call.func.id == "load" + and call.args[0].value == "@rules_shell//shell:repositories.bzl" + ), + None, + ) + self.assertIsNotNone(shell_load, "WORKSPACE must load rules_shell initialization") + self.assertEqual( + ["rules_shell_dependencies", "rules_shell_toolchains"], + [arg.value for arg in calls[shell_load].args[1:]], + ) + names = [call.func.id for call in calls] + self.assertLess(names.index("go_rules_dependencies"), shell_load) + self.assertLess(shell_load, names.index("rules_shell_dependencies")) + self.assertLess(names.index("rules_shell_dependencies"), names.index("rules_shell_toolchains")) + self.assertEqual(1, names.count("rules_shell_toolchains")) + + class MockDdServerTests(unittest.TestCase): """Test case group covering MockDdServerTests behaviors.""" @classmethod From 467145c0ae004999dbe39aa701aba518a95b167c Mon Sep 17 00:00:00 2001 From: Tony Redondo Date: Wed, 28 Oct 2026 21:03:10 +0100 Subject: [PATCH 3/3] test: keep broken-transitive-dependency fixture offline The fixture intentionally imports a nonexistent module. Isolate Go module and toolchain settings so metadata lookup does not depend on public proxies or host configuration. Keep the original assertions and timeout; synchronize all four maintained fork test files and canonical patch series. --- .../base/go/tools/builders/compilepkg_test.go | 10 ++++++++++ .../base/go/tools/builders/compilepkg_test.go | 10 ++++++++++ .../base/go/tools/builders/compilepkg_test.go | 10 ++++++++++ .../base/go/tools/builders/compilepkg_test.go | 10 ++++++++++ .../patches/v0_60_0/base/0001-full-delta.patch | 14 ++++++++++++-- .../patches/v0_61_1/base/0001-full-delta.patch | 14 ++++++++++++-- .../patches/v0_62_0/base/0001-full-delta.patch | 14 ++++++++++++-- .../patches/v0_63_0/base/0001-full-delta.patch | 14 ++++++++++++-- 8 files changed, 88 insertions(+), 8 deletions(-) diff --git a/third_party/rgo/v0_60_0/base/go/tools/builders/compilepkg_test.go b/third_party/rgo/v0_60_0/base/go/tools/builders/compilepkg_test.go index f967fcad..942fbeb8 100644 --- a/third_party/rgo/v0_60_0/base/go/tools/builders/compilepkg_test.go +++ b/third_party/rgo/v0_60_0/base/go/tools/builders/compilepkg_test.go @@ -748,6 +748,16 @@ func TestPrepareModuleExportRootUsesWrappedSyntheticCache(t *testing.T) { // direct package metadata must still load even when a transitive dependency is // intentionally unresolved. func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { + // The missing dependency is intentional. Keep its lookup offline and + // independent from host module settings or toolchain downloads. + t.Setenv("GOPROXY", "off") + t.Setenv("GOSUMDB", "off") + t.Setenv("GOPRIVATE", "") + t.Setenv("GONOPROXY", "") + t.Setenv("GONOSUMDB", "") + t.Setenv("GOFLAGS", "") + t.Setenv("GOTOOLCHAIN", "local") + goExe, err := exec.LookPath("go") if err != nil { t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rgo/v0_61_1/base/go/tools/builders/compilepkg_test.go b/third_party/rgo/v0_61_1/base/go/tools/builders/compilepkg_test.go index f967fcad..942fbeb8 100644 --- a/third_party/rgo/v0_61_1/base/go/tools/builders/compilepkg_test.go +++ b/third_party/rgo/v0_61_1/base/go/tools/builders/compilepkg_test.go @@ -748,6 +748,16 @@ func TestPrepareModuleExportRootUsesWrappedSyntheticCache(t *testing.T) { // direct package metadata must still load even when a transitive dependency is // intentionally unresolved. func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { + // The missing dependency is intentional. Keep its lookup offline and + // independent from host module settings or toolchain downloads. + t.Setenv("GOPROXY", "off") + t.Setenv("GOSUMDB", "off") + t.Setenv("GOPRIVATE", "") + t.Setenv("GONOPROXY", "") + t.Setenv("GONOSUMDB", "") + t.Setenv("GOFLAGS", "") + t.Setenv("GOTOOLCHAIN", "local") + goExe, err := exec.LookPath("go") if err != nil { t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rgo/v0_62_0/base/go/tools/builders/compilepkg_test.go b/third_party/rgo/v0_62_0/base/go/tools/builders/compilepkg_test.go index f967fcad..942fbeb8 100644 --- a/third_party/rgo/v0_62_0/base/go/tools/builders/compilepkg_test.go +++ b/third_party/rgo/v0_62_0/base/go/tools/builders/compilepkg_test.go @@ -748,6 +748,16 @@ func TestPrepareModuleExportRootUsesWrappedSyntheticCache(t *testing.T) { // direct package metadata must still load even when a transitive dependency is // intentionally unresolved. func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { + // The missing dependency is intentional. Keep its lookup offline and + // independent from host module settings or toolchain downloads. + t.Setenv("GOPROXY", "off") + t.Setenv("GOSUMDB", "off") + t.Setenv("GOPRIVATE", "") + t.Setenv("GONOPROXY", "") + t.Setenv("GONOSUMDB", "") + t.Setenv("GOFLAGS", "") + t.Setenv("GOTOOLCHAIN", "local") + goExe, err := exec.LookPath("go") if err != nil { t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rgo/v0_63_0/base/go/tools/builders/compilepkg_test.go b/third_party/rgo/v0_63_0/base/go/tools/builders/compilepkg_test.go index f967fcad..942fbeb8 100644 --- a/third_party/rgo/v0_63_0/base/go/tools/builders/compilepkg_test.go +++ b/third_party/rgo/v0_63_0/base/go/tools/builders/compilepkg_test.go @@ -748,6 +748,16 @@ func TestPrepareModuleExportRootUsesWrappedSyntheticCache(t *testing.T) { // direct package metadata must still load even when a transitive dependency is // intentionally unresolved. func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { + // The missing dependency is intentional. Keep its lookup offline and + // independent from host module settings or toolchain downloads. + t.Setenv("GOPROXY", "off") + t.Setenv("GOSUMDB", "off") + t.Setenv("GOPRIVATE", "") + t.Setenv("GONOPROXY", "") + t.Setenv("GONOSUMDB", "") + t.Setenv("GOFLAGS", "") + t.Setenv("GOTOOLCHAIN", "local") + goExe, err := exec.LookPath("go") if err != nil { t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rules_go_orchestrion/patches/v0_60_0/base/0001-full-delta.patch b/third_party/rules_go_orchestrion/patches/v0_60_0/base/0001-full-delta.patch index 8d581179..6c6dfb37 100644 --- a/third_party/rules_go_orchestrion/patches/v0_60_0/base/0001-full-delta.patch +++ b/third_party/rules_go_orchestrion/patches/v0_60_0/base/0001-full-delta.patch @@ -7705,10 +7705,10 @@ index e2b0be5..a034d09 100644 +} diff --git a/go/tools/builders/compilepkg_test.go b/go/tools/builders/compilepkg_test.go new file mode 100644 -index 0000000..f967fca +index 0000000..942fbeb --- /dev/null +++ b/go/tools/builders/compilepkg_test.go -@@ -0,0 +1,983 @@ +@@ -0,0 +1,993 @@ +package main + +import ( @@ -8459,6 +8459,16 @@ index 0000000..f967fca +// direct package metadata must still load even when a transitive dependency is +// intentionally unresolved. +func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { ++ // The missing dependency is intentional. Keep its lookup offline and ++ // independent from host module settings or toolchain downloads. ++ t.Setenv("GOPROXY", "off") ++ t.Setenv("GOSUMDB", "off") ++ t.Setenv("GOPRIVATE", "") ++ t.Setenv("GONOPROXY", "") ++ t.Setenv("GONOSUMDB", "") ++ t.Setenv("GOFLAGS", "") ++ t.Setenv("GOTOOLCHAIN", "local") ++ + goExe, err := exec.LookPath("go") + if err != nil { + t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rules_go_orchestrion/patches/v0_61_1/base/0001-full-delta.patch b/third_party/rules_go_orchestrion/patches/v0_61_1/base/0001-full-delta.patch index 9c4c7240..f8e1b9d4 100644 --- a/third_party/rules_go_orchestrion/patches/v0_61_1/base/0001-full-delta.patch +++ b/third_party/rules_go_orchestrion/patches/v0_61_1/base/0001-full-delta.patch @@ -7703,10 +7703,10 @@ index e2b0be5..a034d09 100644 +} diff --git a/go/tools/builders/compilepkg_test.go b/go/tools/builders/compilepkg_test.go new file mode 100644 -index 0000000..f967fca +index 0000000..942fbeb --- /dev/null +++ b/go/tools/builders/compilepkg_test.go -@@ -0,0 +1,983 @@ +@@ -0,0 +1,993 @@ +package main + +import ( @@ -8457,6 +8457,16 @@ index 0000000..f967fca +// direct package metadata must still load even when a transitive dependency is +// intentionally unresolved. +func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { ++ // The missing dependency is intentional. Keep its lookup offline and ++ // independent from host module settings or toolchain downloads. ++ t.Setenv("GOPROXY", "off") ++ t.Setenv("GOSUMDB", "off") ++ t.Setenv("GOPRIVATE", "") ++ t.Setenv("GONOPROXY", "") ++ t.Setenv("GONOSUMDB", "") ++ t.Setenv("GOFLAGS", "") ++ t.Setenv("GOTOOLCHAIN", "local") ++ + goExe, err := exec.LookPath("go") + if err != nil { + t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rules_go_orchestrion/patches/v0_62_0/base/0001-full-delta.patch b/third_party/rules_go_orchestrion/patches/v0_62_0/base/0001-full-delta.patch index 79bedd03..b6818f17 100644 --- a/third_party/rules_go_orchestrion/patches/v0_62_0/base/0001-full-delta.patch +++ b/third_party/rules_go_orchestrion/patches/v0_62_0/base/0001-full-delta.patch @@ -7707,10 +7707,10 @@ index a1782d4..2f160ae 100644 +} diff --git a/go/tools/builders/compilepkg_test.go b/go/tools/builders/compilepkg_test.go new file mode 100644 -index 0000000..f967fca +index 0000000..942fbeb --- /dev/null +++ b/go/tools/builders/compilepkg_test.go -@@ -0,0 +1,983 @@ +@@ -0,0 +1,993 @@ +package main + +import ( @@ -8461,6 +8461,16 @@ index 0000000..f967fca +// direct package metadata must still load even when a transitive dependency is +// intentionally unresolved. +func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { ++ // The missing dependency is intentional. Keep its lookup offline and ++ // independent from host module settings or toolchain downloads. ++ t.Setenv("GOPROXY", "off") ++ t.Setenv("GOSUMDB", "off") ++ t.Setenv("GOPRIVATE", "") ++ t.Setenv("GONOPROXY", "") ++ t.Setenv("GONOSUMDB", "") ++ t.Setenv("GOFLAGS", "") ++ t.Setenv("GOTOOLCHAIN", "local") ++ + goExe, err := exec.LookPath("go") + if err != nil { + t.Skipf("go binary not on PATH: %v", err) diff --git a/third_party/rules_go_orchestrion/patches/v0_63_0/base/0001-full-delta.patch b/third_party/rules_go_orchestrion/patches/v0_63_0/base/0001-full-delta.patch index 2207fbde..62e991b5 100644 --- a/third_party/rules_go_orchestrion/patches/v0_63_0/base/0001-full-delta.patch +++ b/third_party/rules_go_orchestrion/patches/v0_63_0/base/0001-full-delta.patch @@ -6686,10 +6686,10 @@ index 98963c6..658b744 100644 +} diff --git a/go/tools/builders/compilepkg_test.go b/go/tools/builders/compilepkg_test.go new file mode 100644 -index 0000000..f967fca +index 0000000..942fbeb --- /dev/null +++ b/go/tools/builders/compilepkg_test.go -@@ -0,0 +1,983 @@ +@@ -0,0 +1,993 @@ +package main + +import ( @@ -7440,6 +7440,16 @@ index 0000000..f967fca +// direct package metadata must still load even when a transitive dependency is +// intentionally unresolved. +func TestLoadModulePackageMetadataBatchSkipsBrokenTransitiveDeps(t *testing.T) { ++ // The missing dependency is intentional. Keep its lookup offline and ++ // independent from host module settings or toolchain downloads. ++ t.Setenv("GOPROXY", "off") ++ t.Setenv("GOSUMDB", "off") ++ t.Setenv("GOPRIVATE", "") ++ t.Setenv("GONOPROXY", "") ++ t.Setenv("GONOSUMDB", "") ++ t.Setenv("GOFLAGS", "") ++ t.Setenv("GOTOOLCHAIN", "local") ++ + goExe, err := exec.LookPath("go") + if err != nil { + t.Skipf("go binary not on PATH: %v", err)