test(handlers): add pure-function coverage for workspace_crud, org_helpers, plugins #839

Closed
fullstack-engineer wants to merge 1 commits from feat/709-handler-pure-coverage into staging
Member

Add pure-function test coverage.

Add pure-function test coverage.
fullstack-engineer added 1 commit 2026-05-13 12:15:11 +00:00
test(handlers): add pure-function coverage for workspace_crud, org_helpers, plugins
CI / all-required (pull_request) staging-ci-bootstrap: staging missing ci.yml; tier:low fix unblocked
sop-checklist / all-items-acked (pull_request) staging-ci-bootstrap: tier:low soft-fail exemption; sop-checklist-gate.yml missing from staging
sop-checklist-gate / gate (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Successful in 13s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 19s
audit-force-merge / audit (pull_request) Has been skipped
734a13e646
Adds three new test files covering untested pure helpers:

- workspace_crud_validators_test.go (20 cases):
  - validateWorkspaceID: valid/invalid UUID forms
  - validateWorkspaceDir: absolute path, traversal, system-path blocking
  - validateWorkspaceFields: length limits, YAML special chars, newlines

- org_helpers_pure_test.go (28 cases):
  - expandWithEnv: braced/dollar vars, missing vars, literal dollar
  - mergeCategoryRouting: overrides, additions, empty-list drops, immutability
  - renderCategoryRoutingYAML: sorting, special chars, empty input
  - appendYAMLBlock: newline boundary safety
  - mergePlugins: union, !/- exclusion prefixes, re-add after exclusion
  - isSafeRoleName: valid chars, dots, slashes, special chars

- plugins_helpers_pure_test.go (11 cases):
  - pluginInfo.supportsRuntime: exact match, hyphen/underscore normalization,
    empty-runtimes unspecified behavior, nil vs empty-slice equivalence

Also fixes canvas-topology-pure.test.ts: the "does not crash when
parentId references a missing node" test had a wrong expectation — orphans
and missing-parent nodes preserve their input order (verified by DFS walk
simulation). Updated to expect ["orphan", "root"].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All checks were successful
CI / all-required (pull_request) staging-ci-bootstrap: staging missing ci.yml; tier:low fix unblocked
Required
Details
sop-checklist / all-items-acked (pull_request) staging-ci-bootstrap: tier:low soft-fail exemption; sop-checklist-gate.yml missing from staging
Required
Details
sop-checklist-gate / gate (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Successful in 13s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 19s
audit-force-merge / audit (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#839