所有命令 · quality
pm item test
Manage tests linked to an item and optionally run them.
Links test commands/paths and optionally executes them for one item.
用法
pm item test [options] [command] <id>参数
| <id> | Item id | 必填 |
|---|
选项
| --add <value> | Add verified isolated test (CSV/markdown or stdin) | 可选 |
|---|---|---|
| --add-json <value> | Add verified isolated test (JSON object/array or stdin) | 可选 |
| --remove <value> | Remove exact command/path (command=<value>, path=<value>, or stdin -) | 可选 |
| --remove-index <n> | Remove 1-based --list position (repeatable) | 可选 |
| --list | List linked tests without mutating | 可选 |
| --update <value> | Edit exact command or path=<value> | 可选 |
| --update-index <n> | Edit current 1-based --list position | 可选 |
| --set-json <value> | Metadata patch; null clears optional fields | 可选 |
| --run | Run linked test commands | 可选 |
| --match <value> | Run matching command/path substring | 可选 |
| --only-index <n> | Run 1-based --list position | 可选 |
| --only-last | Run most recently added test | 可选 |
| --full-history | Return all linked tests after a write | 可选 |
| --acknowledge-linked-tests | Trust current commands in this clone without execution | 可选 |
| --background | Run linked tests in managed background mode | 可选 |
| --timeout <seconds> | Default run timeout in seconds (requires --run) | 可选 |
| --progress | Emit stderr run progress (requires --run; automatic in TTY) | 可选 |
| --env-set <value> | Set run environment (KEY=VALUE, repeatable) | 可选 |
| --env-clear <value> | Clear run environment (NAME, repeatable) | 可选 |
| --shared-host-safe | Apply additive shared-host-safe run defaults | 可选 |
| --pm-context <mode> | PM test context: schema|tracker|auto|none (default: schema) | 可选 |
| --override-linked-pm-context | Override stored context with --pm-context | 可选 |
| --workspace-context <mode> | Source-workspace mode: source|isolated|snapshot (default: source) | 可选 |
| --override-linked-workspace-context | Override stored context with --workspace-context | 可选 |
| --allow-untrusted-linked-tests | Execute untrusted linked commands when project policy also permits it | 可选 |
| --fail-on-context-mismatch | Fail linked PM commands when context item counts differ | 可选 |
| --fail-on-skipped | Treat skipped linked tests as dependency failures | 可选 |
| --fail-on-empty-test-run | Fail successful commands reporting zero executed tests | 可选 |
| --require-assertions-for-pm | Require assertion metadata for linked PM command tests | 可选 |
| --check-context | Check PM context before execution | 可选 |
| --auto-pm-context | Route mismatched PM tracker reads through tracker context | 可选 |
| --measure <value> | Record name=value[,unit=...][,threshold=...]; requires --run | 可选 |
| --metric-below <value> | Return evidence below name=value | 可选 |
| --metric-diff <name> | Diff the latest two values | 可选 |
| --author <value> | Mutation author | 可选 |
| --message <value> | History message | 可选 |
| --force | Force ownership override | 可选 |
示例
pm item test pm-a1b2 --add "command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400"