Skip to content

Tiered test suite + ClawHub publication readiness#3

Merged
milstan merged 1 commit intomainfrom
milstan/tests-publish
Apr 20, 2026
Merged

Tiered test suite + ClawHub publication readiness#3
milstan merged 1 commit intomainfrom
milstan/tests-publish

Conversation

@milstan
Copy link
Copy Markdown
Contributor

@milstan milstan commented Apr 20, 2026

Summary

  • Tests (57 passing, ~2s, no network). Three tiers: contract (manifest ↔ registered-tool parity — catches drift with a named diff), unit (error mapping table, caching, tool branches), and opt-in live smoke (gated by LEADBAY_TEST_TOKEN). Harness in test/harness.ts isolates vi.mock('node:https') behind a single predicate-match helper with opinionated unmatched-request errors.
  • Bug fix in src/client.ts. requestVoid only mapped 401, breaking the paid→org 404 fallback in enrich-contacts.ts. Extracted a shared mapErrorResponse helper; both request<T> and requestVoid now produce the same error codes.
  • Manifest sync. openclaw.plugin.json now declares all 11 tools (adds leadbay_get_lead_activities and leadbay_get_taste_profile), version, and a sensitive token uiHint.
  • Publication readiness per https://docs.openclaw.ai/plugins/sdk-setup: renames npm package to @leadbay/openclaw-leadclaw, adds openclaw.compat + openclaw.build blocks, files whitelist, prepublishOnly, CHANGELOG.md, and README Development + Publishing sections.

Test plan

  • npm test — 57/57 green (contract + unit + sanity), no network
  • npm run test:coverageclient.ts at 95%
  • npm run test:smoke without token — cleanly skips with SMOKE_SKIPPED message
  • npm run build — emits dist/ unchanged
  • npm publish --dry-run — 33 files, 1.3 MB, test/ excluded
  • Negative verification — flip 402 mapping → named row fails; remove tool from manifest → contract test prints exact diff
  • LEADBAY_TEST_TOKEN smoke run against dedicated test tenant (CI / maintainer)
  • Confirm 2026.3.24-beta.2 compat strings match current OpenClaw stable before publishing

🤖 Generated with Claude Code

Adds vitest with contract, unit, and live-smoke tiers (57 assertions, no
network for default runs). Contract test enforces openclaw.plugin.json ↔
registered-tool parity — catches manifest drift at CI. Fixes a latent bug in
client.ts where requestVoid only mapped 401, breaking the paid→org 404
fallback in enrich-contacts; extracted shared mapErrorResponse helper.
Syncs manifest to declare all 11 tools (adds leadbay_get_lead_activities
and leadbay_get_taste_profile), renames npm package to
@leadbay/openclaw-leadclaw, adds openclaw.compat/build blocks, files
whitelist, prepublishOnly script, CHANGELOG, and README Development +
Publishing sections per https://docs.openclaw.ai/plugins/sdk-setup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@milstan milstan merged commit bfc3592 into main Apr 20, 2026
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