Skip to content

test(daemon): deduplicate service fixtures - #129296

Merged
steipete merged 2 commits into
mainfrom
codex/cleanup-aug25-daemon-fixtures
Aug 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/cleanup-aug25-daemon-fixtures

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes duplicated launchd and systemd fixtures that repeated service definitions, environment setup, and assertions across the daemon test suites.

Why This Change Was Made

Both platform suites now use typed, owner-local builders for their mechanical service setup while keeping platform-specific commands, paths, permissions, environment values, and failure cases explicit at each test.

Production LOC: +0/-0 (net 0) | Tests: +768/-1150 (net -382)

User Impact

There is no user-visible behavior change. Daemon installation and lifecycle coverage remains intact while the platform suites are easier to review and extend.

Evidence

  • Daemon owner coverage: 329 tests passed.
  • Independent sibling coverage: 147 tests passed.
  • Complete expectation and security-sensitive path, permission, command, and environment inventories were preserved.
  • Focused typed lint, formatting, and diff validation passed.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 11:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 8:04 AM ET / 12:04 UTC.

ClawSweeper review

What this changes

The PR consolidates repeated launchd and systemd test setup into typed, platform-local fixture helpers while preserving explicit platform-specific cases.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer review: this is an active, maintainer-labeled test-only refactor, and no blocking regression was found in the fixture changes.

Priority: P3
Reviewed head: 8058431ed87c5c870c56b1479a70ec6e3aaabf3a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-only refactor with typed fixtures and no concrete correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only refactor does not require contributor real-behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only refactor does not require contributor real-behavior proof.
Evidence reviewed 5 items Platform owner boundary: The current service registry selects launchd for macOS and systemd user services for Linux, routing install operations to the platform installers covered by this PR.
Typed local test fixtures: The new launchd helpers derive their input type from the real installer and keep lifecycle control arguments separate.
Systemd command assertions retained: The refactor retains exact direct-user and machine-user systemctl argument assertions; canonical gateway/node setup is localized while exceptional cases can use the generic fixture.
Findings None None.
Security None None.

Live Verification

Command: pnpm test src/daemon/launchd.test.ts src/daemon/systemd.test.ts

Result: PASS (completed)

pnpm test src/daemon/launchd.test.ts src/daemon/systemd.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129296-uotlcC/target$ pnpm test src/daemon/launchd.test.ts src/daemon/systemd.test.ts
$ node --import tsx scripts/test-projects.mts src/daemon/launchd.test.ts src/daemon/systemd.test.ts
pnpm test src/daemon/launchd.test.ts src/daemon/systemd.test.ts
[test] starting test/vitest/vitest.daemon.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129296-uotlcC/target

 ✓  daemon  src/daemon/launchd.test.ts (164 tests | 25 skipped) 248ms
 ✓  daemon  src/daemon/systemd.test.ts (165 tests) 408ms

 Test Files  2 passed (2)
      Tests  304 passed | 25 skipped (329)
   Start at  12:05:19
   Duration  4.68s (transform 4.91s, setup 2.23s, import 3.53s, tests 656ms, environment 0ms)

[test] passed 1 Vitest shard in 10.37s


































Assertions:

  • PASS expect_output: Test Files

How this fits together

Daemon installation selects launchd on macOS and systemd on Linux, then installs and controls the gateway service. These two suites exercise the platform service commands, generated definitions, environment handling, and lifecycle failures.

flowchart LR
  A[Gateway install command] --> B[Daemon service registry]
  B --> C[Launchd installer]
  B --> D[Systemd installer]
  C --> E[Launchd test fixtures]
  D --> F[Systemd test fixtures]
  E --> G[Lifecycle assertions]
  F --> G
Loading

Before merge

  • Complete next step (P2) - This protected maintainer PR needs ordinary review and exact-head CI completion, not an automated repair job.
Agent review details

Security

None.

PR surface

Tests -382. Total -382 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 768 1150 -382
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 768 1150 -382

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +768/-1150 (net -382) The branch changes test support only and reduces duplicated test setup without adding runtime behavior.

Technical review

Best possible solution:

Keep fixture helpers local to each platform suite and preserve the explicit command, environment, rollback, and lifecycle assertions they support.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors test fixtures rather than reporting a user-facing defect.

Is this the best way to solve the issue?

Yes: typed, platform-local fixtures remove repeated mechanics without creating a production seam or hiding the platform-specific assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 05a3b2ac82b0.

Labels

Label changes:

  • add P3: This is low-risk daemon test-suite cleanup with no production or user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only refactor does not require contributor real-behavior proof.

Label justifications:

  • P3: This is low-risk daemon test-suite cleanup with no production or user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only refactor does not require contributor real-behavior proof.

Evidence

What I checked:

  • Platform owner boundary: The current service registry selects launchd for macOS and systemd user services for Linux, routing install operations to the platform installers covered by this PR. (src/daemon/service.ts:353, 05a3b2ac82b0)
  • Typed local test fixtures: The new launchd helpers derive their input type from the real installer and keep lifecycle control arguments separate. (src/daemon/launchd.test.ts:246, 8058431ed87c)
  • Systemd command assertions retained: The refactor retains exact direct-user and machine-user systemctl argument assertions; canonical gateway/node setup is localized while exceptional cases can use the generic fixture. (src/daemon/systemd.test.ts:137, 8058431ed87c)
  • No production daemon change: Comparing the PR head with current main shows no changed non-test file under src/daemon; the branch changes only the two daemon test suites. (src/daemon/launchd.test.ts:1, 05a3b2ac82b0)
  • Feature-history provenance: Available history shows the current daemon suites and installer sources entering together in this authored commit; the local clone is shallow beyond that point. (src/daemon/launchd.test.ts:1, e33606ef1032)

Likely related people:

  • steipete: Commit e33606e introduced the current launchd/systemd suites and their installer sources; this PR continues work on those suites. (role: introduced current daemon test surface and recent area contributor; confidence: medium; commits: e33606ef1032, 8058431ed87c; files: src/daemon/launchd.test.ts, src/daemon/systemd.test.ts, src/daemon/launchd-install.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 147e9da into main Aug 25, 2026
109 checks passed
@steipete
steipete deleted the codex/cleanup-aug25-daemon-fixtures branch August 25, 2026 12:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
* test(daemon): deduplicate service fixtures

* test(daemon): type launchd uninstall fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant