Container Registration Testing (test)
Use test when you want an explicit registration validation run against a mock config-hub.
Command
npx worker-cli test <worker-dir> <image-name>
Example:
npx worker-cli test ./workers/opc-reader registry.example.com/myteam/opc-reader:1.4.2
What happens
- Starts local mock hub HTTP service.
- Runs your container with test runtime env vars.
- Waits for worker registration payloads.
- Reads registration box versions.
- Fails if versions differ from worker project version.
- Validates each registration document against the SDK contract (see below).
Registration schema validation
Each registration payload is validated against the SDK contract (sdk/typescript/src/flowbox-registration-info.ts, FlowBoxRegistrationInfo). The mock hub still answers HTTP 200; failures are enforced CLI-side.
Hard errors (test fails with exit code 1; during build this fails the build):
id,displayName,currentVersion,icon,agent,workerId,workerDataConnectionStringmust be stringstypemust besource,sink, orpipeioInterfaces.inputsandioInterfaces.outputsmust be arrays; each entry needsname(string) andsupportedFormats(array ofjsonormsgpack)uiConfigmust containdefaultOptionsandimplementationkeysdocumentation, when present, must havesummary,brief, anddetailstrings
Warnings (do not fail):
iddoesn't follow the lowercaseprefix/nameconventiondocumentationis missing
Unknown extra fields are ignored (forward compatibility).
Key tuning variables
CONFIG_HUB_MOCK_PORT=3120
MOCK_HUB_HOST_IP=172.17.0.1
TIMEOUT=60
Troubleshooting example
If a worker never registers:
# try explicit host IP and longer timeout
MOCK_HUB_HOST_IP=172.17.0.1 TIMEOUT=90 npx worker-cli test ./workers/opc-reader registry.example.com/myteam/opc-reader:1.4.2
[NOTE!lightbulb/ROLE BOUNDARIES] This validates container-to-hub registration/version behavior and the registration document structure against the SDK contract. It does not validate your business payload correctness or protocol-specific output semantics.
References
sdk/worker/repo-management/src/commands/test-container.tssdk/worker/repo-management/src/lib/mock-hub.tssdk/worker/repo-management/src/lib/registration-schema.ts