所有命令 · 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 linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)可选
--remove-index <n>Remove the 1-based linked-test index from --list order (repeatable)可选
--listList linked tests without mutating可选
--runRun linked test commands可选
--match <value>Run only linked tests whose command/path contains this substring可选
--only-index <n>Run only the 1-based linked-test index from --list order可选
--only-lastRun only the most recently added linked test可选
--acknowledge-linked-testsTrust the item's current linked commands in this clone without executing them可选
--backgroundRun linked tests in managed background mode可选
--timeout <seconds>Default run timeout in seconds可选
--progressEmit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)可选
--env-set <value>Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)可选
--env-clear <value>Clear environment variable(s) for linked-test runs (NAME, repeatable)可选
--shared-host-safeApply additive shared-host-safe runtime defaults for linked-test runs可选
--pm-context <mode>PM test context: schema|tracker|auto|none (default: schema)可选
--override-linked-pm-contextForce run-level --pm-context to override per-linked-test pm_context_mode metadata可选
--workspace-context <mode>Source-workspace mode: source|isolated|snapshot (default: source)可选
--override-linked-workspace-contextForce run-level --workspace-context over per-linked-test metadata可选
--allow-untrusted-linked-testsExecute untrusted linked commands when project policy also permits it可选
--fail-on-context-mismatchFail linked PM commands when context item counts differ可选
--fail-on-skippedTreat skipped linked tests as dependency failures可选
--fail-on-empty-test-runTreat successful linked-test commands that report zero executed tests as failures可选
--require-assertions-for-pmRequire assertion metadata for linked PM command tests可选
--check-contextPreflight linked PM command context diagnostics before executing commands可选
--auto-pm-contextAuto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context可选
--measure <value>Record name=value[,unit=...][,threshold=...] evidence; repeatable可选
--metric-below <value>Return evidence below name=value可选
--metric-diff <name>Diff the latest two values可选
--author <value>Mutation author可选
--message <value>History message可选
--forceForce ownership override可选

示例

pm item test pm-a1b2 --add "command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400"

相关命令