Skip to content

Testing Components

Components have three tiers of testing: local validation, doctor diagnostics, and end-to-end verification.

Before installing, validate the manifest offline:

Terminal window
wh component validate ./my-component

This checks:

  1. Schema validation — component.json and manifest.json structure
  2. Cross-reference validation — subscription triggers reference declared shapes (or ComponentInstall/ComponentConfig), subscriptions reference declared credential sets (at most one each), seeds reference declared or built-in shapes, CLI methods reference declared credential sets, and shape, subscription, and credential-set names are each unique
  3. ID format validation — reverse-DNS format check
  4. Consistency check — component.json id/name must match manifest.json component section

Validation does not read or check any action references or action file paths — the manifest format has no actions section.

Components install by identity, so register the manifest, then install by <org>/<name> against a test repo:

Terminal window
wh component register my-component --org org --manifest ./my-component/warmhub/manifest.json
wh component install org/my-component --repo org/test-repo

After install, run doctor to verify all declared resources exist:

Terminal window
wh component doctor org/my-component --repo org/test-repo

Doctor checks:

  • Shapes — exist, are active, are owned by the component, and match the installed manifest. A declared platform built-in such as ComponentConfig is healthy even before it exists (it is created on first write) and is not checked for ownership
  • Subscriptions — exist, are active, and are owned by the component
  • Credential sets — exist with all required keys populated (a missing set or key is reported as a warning and does not mark the component degraded)
  • Seeds — the seeded things exist
  • health.requires — any listed shapes, things, and subscriptions exist
  • Version — whether a newer published version is available (advisory)

Doctor exits with status 1 when the component is degraded, error, or uninstalled.

Doctor operates on the installed manifest snapshot. It does not auto-remediate. If resources are missing, reinstall or create them manually.

The full verification path:

Terminal window
# Register the manifest, then install by identity
wh component register my-component --org org --manifest ./my-component/warmhub/manifest.json
wh component install org/my-component --repo org/test-repo
Terminal window
wh credential set my-creds api_key --value "sk-..." --repo org/test-repo
Terminal window
wh component doctor org/my-component --repo org/test-repo
# Should report "ready"

For event-driven subscriptions, create a thing on the trigger shape:

Terminal window
wh commit submit --repo org/test-repo \
--ops '[{"operation":"add","name":"test-1","shapes":["Echo"],"data":{"message":"hello","tags":["test"]}}]'

Check that the expected output things were created:

Terminal window
wh thing query --shape EchoResult --repo org/test-repo

Check subscription delivery logs:

Terminal window
wh sub log se/echo-handler --repo org/test-repo

After install passes, verify the update path picks up manifest changes:

Terminal window
# Bump component.version in the manifest (re-publish requires a higher semver),
# then re-publish to the registry
wh component registry update org/my-component --manifest ./my-component/warmhub/manifest.json
# Pull the latest published manifest into the install
wh component update org/my-component --repo org/test-repo
# Run doctor again
wh component doctor org/my-component --repo org/test-repo