Skip to content

tests: isolate temporary module commands from GO111MODULE#610

Open
HNO3Miracle wants to merge 1 commit into
pb33f:mainfrom
HNO3Miracle:hno3/isolate-temp-module-mode
Open

tests: isolate temporary module commands from GO111MODULE#610
HNO3Miracle wants to merge 1 commit into
pb33f:mainfrom
HNO3Miracle:hno3/isolate-temp-module-mode

Conversation

@HNO3Miracle

Copy link
Copy Markdown

The generator round-trip tests intentionally create temporary Go modules, but their go run subprocesses inherit GO111MODULE=off from the caller. Explicitly enable module mode for those subprocesses, alongside the existing GOWORK=off and GOFLAGS=-mod=mod, so the test behavior matches its temporary-module setup.

Testing:

  • go test ./generator/golang
  • Built the package test binary in module mode, then ran both round-trip tests with the binary environment set to GO111MODULE=off; both pass.

Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.78%. Comparing base (0837c9b) to head (9c07973).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #610   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files         283      283           
  Lines       34456    34456           
=======================================
  Hits        34382    34382           
  Misses         46       46           
  Partials       28       28           
Flag Coverage Δ
unittests 99.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant