fix(#203): stub sandbox.EnsureAvailable in harness-loading tests#505
fix(#203): stub sandbox.EnsureAvailable in harness-loading tests#505fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Introduce a package-level sandboxEnsureAvailable function variable in run.go (defaulting to sandbox.EnsureAvailable) and use it in runAgent. Five TestRunAgent_* tests that depend on the openshell check failing now call stubSandboxEnsureAvailable(t) to inject a stub that always returns an error, making them hermetic regardless of whether openshell is installed on the host. Tests that fail before reaching the sandbox check (HarnessNotFound, MalformedOrgConfigWithURLRefs, URLRefsNoOrgConfig, URLBaseNoOrgConfig, URLBaseMalformedOrgConfig) are unaffected. Closes #203
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
|
🤖 Finished Review · ✅ Success · Started 3:25 PM UTC · Completed 3:31 PM UTC |
Review — ApproveClean, focused fix for #203. The package-level function variable pattern ( Verification summary
Style observation
🤖 Reviewed with fullsend |
| @@ -1335,6 +1335,11 @@ func openTeeReader(r io.Reader, outputPath string, printer *ui.Printer) (io.Read | |||
| return io.TeeReader(r, f), func() { f.Close() } | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
[low] documentation_consistency
The new sandboxEnsureAvailable var has a 3-line doc comment explaining its test-override purpose, but existing analogous vars (heartbeatInterval, oidcRefreshInterval) in the same file have no comments. Minor style inconsistency.
Suggested fix: Either remove the comment to match existing style, or add similar comments to the other test-override vars for consistency.
Introduce a package-level sandboxEnsureAvailable function variable in run.go (defaulting to sandbox.EnsureAvailable) and use it in runAgent. Five TestRunAgent_* tests that depend on the openshell check failing now call stubSandboxEnsureAvailable(t) to inject a stub that always returns an error, making them hermetic regardless of whether openshell is installed on the host.
Tests that fail before reaching the sandbox check (HarnessNotFound, MalformedOrgConfigWithURLRefs, URLRefsNoOrgConfig, URLBaseNoOrgConfig, URLBaseMalformedOrgConfig) are unaffected.
Closes #203
Post-script verification
agent/203-stub-sandbox-ensure-available)b776cf6006a12016eaa21412dc65a3001100e801..HEAD)