Skip to content

fix(test): keep Go's module and build caches when a test redirects HOME - #500

Merged
bomly-guy merged 2 commits into
mainfrom
fix/tests-keep-module-cache
Oct 4, 2026
Merged

bomly-guy merged 2 commits into
mainfrom
fix/tests-keep-module-cache

Conversation

@bomly-guy

@bomly-guy bomly-guy commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The macOS leg of the release prerequisites stage failed with TLS handshake timeout from proxy.golang.org inside TestPluginTestNotReadyFails, which blocked a release (run). It is the third failure of this kind on a macOS runner.

The cause is in the tests, not the network. Many CLI tests set HOME to a temporary directory to isolate Bomly's own state. Go's module cache and build cache default to directories under HOME, so a test that then builds a plugin gets empty caches and downloads the SDK and its dependencies from the module proxy mid-test.

What changes

  • TestMain in internal/cli pins GOMODCACHE and GOCACHE to their real locations before any test runs.
  • The retried "Download modules" step from ci(release): shorten the release pipeline without dropping a check #499 stays ahead of the suite. On its own it fixed nothing, because these tests were not reading the cache it fills; with the pin it covers the cache-miss case.

Verification

  • With GOPROXY=off, TestPluginTestNotReadyFails fails on main ("module lookup disabled by GOPROXY=off") and passes with this change.
  • With GOPROXY=off, ./internal/cli/..., ./internal/plugin/..., ./test/smoke/... and ./test/assurance/... all pass.
  • make test and make lint pass.
  • Side effect: internal/cli took 260 to 300 seconds on the macOS runner; it takes 52 seconds locally with the caches kept.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Test runs now use the module and build cache locations reported by Go. If those locations cannot be retrieved or configured, the test setup reports an error and exits.
    • Portable workflow notes clarify that download retries handle cache misses for tests using the pinned module cache, but do not cover temporary-module plugin tests.
  • User-facing Changes

    • No changes to app functionality are included.

Many CLI tests point HOME at a temporary directory to isolate Bomly's own
state. Go's module and build caches default to directories under HOME, so a
test that then built a plugin got empty caches and downloaded the SDK and
its dependencies from the module proxy inside the test. macOS runners timed
out on that download three times; the third blocked a release at the
prerequisites stage.

TestMain now pins GOMODCACHE and GOCACHE to their real locations before any
test runs. With GOPROXY=off the plugin tests failed before this change and
pass after it.

The "Download modules" step added to the portable suite is removed. It
warmed the real cache, which these tests were not reading, so it fixed
nothing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: bomly-dev/bomly-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd105b48-9ae5-477f-8f14-f84d53488c80
📥 Commits

Reviewing files that changed from the base of the PR and between 1700be1 and 560dfa0.

📒 Files selected for processing (2)
  • .github/workflows/portable-assurance.yml
  • internal/cli/root_cmd_test.go
 _______________________________________________________________
< Your null checks are like seatbelts: installed, but not worn. >
 ---------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Bomly Diff Summary

Compared 1700be1afcae81916e040e686277979cafb5c3d0 to 560dfa0d0a0b9c466b88d669a14677b5f6b8632a.

Overview

Status Manifests Dependencies Findings Duration
✅ Pass +0 / ~0 / -0 0 added / 0 version changed / 0 detail changes / 0 removed 0 introduced / 0 persisted / 0 resolved 1m 48s

Dependency Changes

✅ No dependency changes.

Vulnerabilities

✅ No vulnerability changes.

License Changes

✅ No license changes.

Project Posture

✅ No project posture changes (--matchers +scorecard was not selected).

Policy Findings

✅ No policy differences were identified.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a709d1bce1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/portable-assurance.yml
… suite

Removing it was wrong for the cache-miss case: with no restored cache the
suite would fetch every module inside its single go test attempt. Now that
the tests read the real module cache, filling it first is what keeps a slow
proxy out of them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@bomly-guy
bomly-guy merged commit f24c1e7 into main Oct 4, 2026
23 of 24 checks passed
@bomly-guy
bomly-guy deleted the fix/tests-keep-module-cache branch October 4, 2026 20:56
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