Repository navigation
test(mcpx): remote-safe e2e subset — fail-closed registry + remote runner leg (#13386) - #13597
Conversation
…nner leg (#13386) The e2e suite can now run a declared subset of its tests against a shared daemon it did not start, reached over MCPX_DAEMON_ENDPOINT: - internal/e2e/remote_safe_tests.txt is the registry: one test name per line. Selection fails closed in two layers — the CI leg builds its -run pattern from the registry, and newEnv skips any unlisted test when remote mode is on (MCPX_E2E_REMOTE=1), so a full-suite remote run cannot point host-local fixtures at a shared daemon by accident. - newRemoteEnv points CLI children at the shared daemon and transplants no host-local config; a test that needs a server on the daemon adds it with addRemoteServer (POST /v1/servers under a per-test suffixed name, DELETE in cleanup). - TestExecOnTheDaemonRunsWhereTheDaemonIs is the canonical first member; guard tests prove the selection admits exactly the registry and that addRemoteServer suffixes and removes. - New remote-e2e leg in mcpx-test.yml, beside remote-smoke: the daemon runs from the shipped image (packages.mcpx-container) with a published port, and the subset runs on the host against it. Added to the ci-ok gate's needs. Verified on the laptop: go vet + gofmt clean; both new guard tests pass; the canonical test passes in local mode and in remote mode against a real standalone daemon over TCP, and an undeclared test skips in remote mode; internal/settings green. One pre-existing main red is untouched by this change: TestEveryRegistryVariableIsHarnessSetOrSafe fails at the base commit because MCPX_ADAPTERS_ALLOW_BARE is in neither envguard table (suite health, #13481).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 753a2655ea
ℹ️ 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".
| "MCPX_CONFIG="+filepath.Join(dir, ".mcpx.json"), | ||
| "MCPX_DAEMON_ENDPOINT="+endpoint, |
There was a problem hiding this comment.
Select a daemon-local working directory for remote execution
In the new remote-e2e workflow, the daemon runs inside an unmounted container, but this environment leaves script.cwd at its default caller. The binary runner launches the CLI in this host-only temporary directory; execRemoteScript forwards that path as Options.Cwd, and the daemon's runner assigns it to cmd.Dir through ResolveCwd. Consequently, the registered canonical test cannot start its script inside the container because that directory does not exist there, making the new required CI leg fail even after readiness succeeds. Configure the remote client to use a daemon-local policy such as workdir, rather than forwarding the host temporary directory.
Useful? React with 👍 / 👎.
…13386) Codex review of PR #13597: with the default script.cwd=caller, the CLI forwards host-local paths with a remote exec request, and the daemon starts the script resolved against them — paths that do not exist on the daemon's side of the connection, so the canonical test would fail in the new remote-e2e leg even after the readiness probe succeeds. A same-filesystem daemon cannot show this, which is why the local remote smoke passed. Fix: newRemoteEnv sets MCPX_SCRIPT_CWD=workdir for its CLI children, so the policy travels with the request and ResolveCwd resolves on the daemon. Verified against the real shipped image on the laptop (nix-built mcpx-container, daemon in docker, subset run from the host): the canonical test passes with workdir (4.0s). Mutation check: forcing caller makes the same run fail — the daemon tries to exec the host's nix-store bun path, which does not exist in the image.
|
Codex P1 addressed in The finding was right, and a same-filesystem daemon hides it (my first remote smoke ran the daemon on the laptop, where the host paths exist). Fix: Container rehearsal of the leg, on the laptop, from this branch:
— Lane AU12 (archer) |
# Conflicts: # .github/workflows/mcpx-test.yml
Implements the remote-safe e2e subset for #13386 (no auto-close: the issue's last acceptance line is the new leg going green in CI, which runs on main — the outcome record follows on the issue once the main run reports).
What lands
pkgs/mcpx/internal/e2e/remote_safe_tests.txt— the registry: one test name per line, with the membership claim spelled out (no host-local server binary, no daemon stop/restart, no per-test daemon config). Opt-in only.pkgs/mcpx/internal/e2e/remote_test.go— remote mode (MCPX_E2E_REMOTE=1+MCPX_DAEMON_ENDPOINT):-runpattern from the registry, andnewEnvskips any unlisted test in remote mode, so a manual full-suite run against a shared daemon cannot point host-local fixtures at it;newRemoteEnvpoints CLI children at the shared daemon and transplants no host-local config (empty server set; the daemon is never started or stopped by the test);addRemoteServerregisters a per-test server overPOST /v1/serversunder a per-test suffixed name and removes it withDELETEin cleanup;TestRemoteSafeSelectionFailsClosed(registry non-empty, names resolve to real test functions, pattern + predicate admit exactly the registry, canonical member present) andTestAddRemoteServerRegistersSuffixedAndRemovesOnCleanup(against a fake /v1 daemon).pkgs/mcpx/internal/e2e/e2e_test.go— thenewEnvremote branch (10 lines)..github/workflows/mcpx-test.yml— newremote-e2eleg besideremote-smoke: daemon from the shipped image (packages.mcpx-container) with a published port and the remote-smoke status probe for readiness; the subset runs on the host against it. Added to theci-okgate's needs.TestExecOnTheDaemonRunsWhereTheDaemonIsis the canonical first member of the subset, as the issue names it.Verification (laptop runs, worktree off main
1f9bc15391c)go vet ./internal/e2e/clean; gofmt clean; workflow YAML parsed (job present, in ci-ok needs).okfor the package on a clean run; one earlier run tripped the suite's disturbed-daemons guard from concurrent suites on the shared laptop and passed on re-run with the guard silent).MCPX_E2E_REMOTE=1 MCPX_DAEMON_ENDPOINT=http://127.0.0.1:18799), and an undeclared test (TestLsStartsDaemonAndListsNamespaces) skips in remote mode with the fail-closed message.go test ./internal/settings/green (the env scan does not flag the test-only mode variable; it is read only from_test.gofiles).Pre-existing red, not from this change:
TestEveryRegistryVariableIsHarnessSetOrSafefails at the base commit —MCPX_ADAPTERS_ALLOW_BAREis in neither envguard classification table. That is main suite health, tracked by #13481; this PR does not touch it.— Lane AU12 (archer)
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.