Repository navigation
test: isolate Gateway reload and Gemini auth fixtures - #131625
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Independent broken-main repair verification found this PR while checking for an in-flight fix; I am adopting this PR rather than creating a duplicate. Fresh main I am completing the bounded test-fixture cleanup and fresh proof on this PR: existing signal cleanup at the Gmail producer, and the existing config-write receipt for environment-publication completion. No production, SQLite, protocol, dependency, or live Gateway changes. The existing Google fixture fix will be preserved. Native review/prepare/merge and exact-head CI remain required before landing. |
6cabdb3 to
516fd53
Compare
Make the Gemini dotenv credential-path fixture independent of process credentials and restore its environment even when preparation fails. Exercise channel rollback through its production entrypoint after the internal start helper became private, preserving manual-stop race and explicit-resume coverage.
516fd53 to
60d7cf6
Compare
|
Ready for native merge at The canonical missing-export repair is already on main in #131627 (871b18df). This PR preserves that rollback test exactly and finishes the independently reproduced fixture cleanup. Production +0/-0; tests +94/-71. All retained assertions remain, with existing signal cleanup and config-write receipt ownership instead of leaked state or timer draining. Fresh proof: 349/349 Gateway tests at both shuffled seeds 828 and 829 after the final conflict resolution; 46/46 Google backend auth/isolated tests with a synthetic inherited path; the complete changed-file gate passed for the byte-identical retained files. Deslop and fresh whole-PR Codex autoreview found no accepted/actionable findings at the configured P0 threshold. The PR body records failing-first and reversible owner-fault evidence and the exact test commands. Exact-head CI 33154122327 completed successfully. Native I re-read the latest ClawSweeper comment immediately before landing. It is still the current-head review-started notice, with no findings or |
|
Merged via squash.
|
* test: repair auth isolation and channel rollback coverage Make the Gemini dotenv credential-path fixture independent of process credentials and restore its environment even when preparation fails. Exercise channel rollback through its production entrypoint after the internal start helper became private, preserving manual-stop race and explicit-resume coverage. * test(gateway): isolate reload completion and restart signals
What Problem This Solves
Resolves two Gateway reload test-fixture failures found while verifying the current-main missing-export repair, and preserves this PR's existing host-independent Gemini fixture repair. This is explicitly maintainer-requested broken-main repair and bounded sibling cleanup.
The missing-export repair itself landed concurrently in #131627 as
871b18dff5039484e86c76d282699a8defcb1654. This PR has been rebased onto that canonical fix and leaves its rollback test byte-for-byte unchanged; it does not duplicate the repair.Why This Change Was Made
The Gmail failure test emitted a restart signal without clearing its unconsumed token, causing later tests to coalesce instead of emit. It now uses the existing
withGatewayRestartSignalfixture, asserts actual emission, and always stops its reloader.The environment-publication test drained every fake timer even after all five expected service events completed. A captured callback proved the remaining timer was recurring maintenance. The test now awaits the existing config-write application receipt with real timers, supplies a valid snapshot fixture, and always stops its reloader. All event-order assertions remain; there is no timeout increase, retry, weaker assertion, new mock, or production/storage change.
The Gemini dotenv fixture captures/restores both environment variables and clears inherited
GOOGLE_APPLICATION_CREDENTIALSwhile testing file-only resolution. The adjacent test still covers process-precedence behavior.The canonical missing-export provenance is #131545 (code/PR author and merger @steipete) intentionally internalizing the helper, followed seven minutes later by #118157 (commit author Ayaan Gazali, PR author @ayaangazali, merger @steipete) adding a stale test import. #131627 correctly tests the exported rollback operation with the real channel manager and keeps the helper private.
User Impact
No runtime or public API change. Developers get meaningful, independent reload fixtures and deterministic dotenv-path coverage. No changelog entry is needed for these internal test repairs. No live Gateway, provider call, real credential, dependency, version, snapshot, protocol, schema, or SQLite implementation was changed.
Production LOC: +0/-0. Tests: +94/-71 (net +23) in two existing files; most churn moves existing assertions under guaranteed cleanup. No new test case or production seam.
Evidence
Fresh main
4bbb3660dfb00d54e493e917756c329573bb786breproduced all three missing-export failures. The original shuffled Gateway trio had 6 failures / 349 tests at seed 828: three import failures and three restart-token follow-on failures. This PR's first head fixed the import but still reproduced 3 failures / 349 tests. Seed 829 independently exposed the environment-publication timer loop; that case failed alone too.After fixture repair, the Gateway trio passes 349/349 at seeds 828 and 829, including repeat proof after rebasing onto the canonical #131627 fix:
A reversible
preserveManualStop: truetofalseowner fault failed all three rollback cases; production bytes were restored exactly. The environment-publication case passes alone using its application receipt, retaining all five service-order assertions.The Gemini dotenv case failed on unmodified main with a synthetic inherited path. Both backend auth and isolated-completion files pass 46 tests with the same synthetic input:
GOOGLE_APPLICATION_CREDENTIALS=/tmp/openclaw-fixture-only-adc.json pnpm test extensions/google/cli-backend-auth.test.ts extensions/google/cli-backend-isolated.test.ts --maxWorkers=1 --reporter=verboseThe complete changed-file gate passed for the original three-file superset: formatting, guards, all three Knip scans, core and plugin test types, and both lint lanes. Conflict resolution only removed the duplicate rollback edit; both retained file blobs exactly match the checked and reviewed version. Deslop found no additional cleanup. Fresh Codex autoreviews of the handler commit and whole-PR diff reported no actionable findings at the configured P0 threshold.
Candidate:
60d7cf6c6a35f7a024b0cf3c7cb5bcacf046ce65, based on871b18dff5039484e86c76d282699a8defcb1654. The earlier CI run 33153600809 belongs to the pre-conflict head, not this candidate. Canonical repair CI 33152936793 is independently verified successful at its exact head. Final CI 33154122327 completed successfully for exact candidate60d7cf6c6a35f7a024b0cf3c7cb5bcacf046ce65. Native review artifacts, mandatory hosted preparation, and native merge all completed without changing that head.Proof is deterministic local test execution, not a live Gateway or Google API run. Production is unchanged. AI-assisted with Codex.
Landing verification
Merged through
scripts/pr merge-runas 717cb7cb. Reconstructed the merge of actual parent3234bb295d173a9cdcbd22ae0ec9548b07ae68b6and reviewed head: expected and landed trees both equal259edfd415cb5267a9cfc1c608236fc53309511c. Exactly the two intended test files changed, and both blobs match the reviewed candidate. Native worktree, temporary refs, operation lock, processes, and remote task branch are gone; unrelated worktrees/processes were preserved.The latest ClawSweeper comment at landing was the fresh exact-head review-started notice, with no published findings or rank-up moves; it was explicitly recorded as pending, not clean, in the premerge proof. Independent autoreview and exact-head CI/native gates were complete. The visible checkout was returned to clean latest main, and the repaired three-case test passed again there.