Docs: Clarify contract output handling
This commit is contained in:
@@ -60,6 +60,7 @@ Every executable contract under `tests/` is classified in `tests/contracts.manif
|
|||||||
`panama test --allow live-compositor --allow live-desktop keybinds`.
|
`panama test --allow live-compositor --allow live-desktop keybinds`.
|
||||||
- Each contract has a 180-second outer timeout by default. Override it with a positive
|
- Each contract has a 180-second outer timeout by default. Override it with a positive
|
||||||
`PANAMA_TEST_TIMEOUT_SECONDS` value. Failures print the contract's captured stdout and stderr.
|
`PANAMA_TEST_TIMEOUT_SECONDS` value. Failures print the contract's captured stdout and stderr.
|
||||||
|
Successful stdout stays quiet. Successful stderr is surfaced as a warning.
|
||||||
- Contracts run directly too: `tests/setup/interview-contract`.
|
- Contracts run directly too: `tests/setup/interview-contract`.
|
||||||
- After changing `PreferenceSchema.qml` or `services/SettingsRoutes.qml`, regenerate:
|
- After changing `PreferenceSchema.qml` or `services/SettingsRoutes.qml`, regenerate:
|
||||||
`config/dot/quickshell/scripts/panama-settings-docs` (writes `docs/settings.md`) and
|
`config/dot/quickshell/scripts/panama-settings-docs` (writes `docs/settings.md`) and
|
||||||
|
|||||||
@@ -215,7 +215,8 @@ before it starts any non-hermetic contract. Automation cannot answer that
|
|||||||
prompt, so it must grant every required capability with a repeatable `--allow`.
|
prompt, so it must grant every required capability with a repeatable `--allow`.
|
||||||
Each contract has a 180-second outer timeout by default. Set
|
Each contract has a 180-second outer timeout by default. Set
|
||||||
`PANAMA_TEST_TIMEOUT_SECONDS` to a positive integer to override it. When a
|
`PANAMA_TEST_TIMEOUT_SECONDS` to a positive integer to override it. When a
|
||||||
contract fails, the runner prints its captured stdout and stderr.
|
contract fails, the runner prints its captured stdout and stderr. Successful
|
||||||
|
stdout stays quiet. Successful stderr is surfaced as a warning.
|
||||||
|
|
||||||
They are called contracts rather than unit tests because that is what they are:
|
They are called contracts rather than unit tests because that is what they are:
|
||||||
each one pins a decision that was expensive to get right and is cheap to undo by
|
each one pins a decision that was expensive to get right and is cheap to undo by
|
||||||
|
|||||||
+7
-3
@@ -89,8 +89,10 @@ ${BOLD}Commands:${RESET}
|
|||||||
pattern to run a subset. --safe selects hermetic contracts only.
|
pattern to run a subset. --safe selects hermetic contracts only.
|
||||||
Plain terminal runs prompt before non-hermetic work. Automation
|
Plain terminal runs prompt before non-hermetic work. Automation
|
||||||
must grant each required capability with a repeatable --allow.
|
must grant each required capability with a repeatable --allow.
|
||||||
Failures print captured stdout/stderr; the default outer timeout
|
Failures print captured stdout/stderr. Successful stdout stays
|
||||||
is 180 seconds.
|
quiet; successful stderr is a warning. The default outer timeout
|
||||||
|
is 180 seconds. Set PANAMA_TEST_TIMEOUT_SECONDS to a positive
|
||||||
|
integer to override it.
|
||||||
${GREEN}contracts${RESET} Name the contracts that mention a given file, each labeled
|
${GREEN}contracts${RESET} Name the contracts that mention a given file, each labeled
|
||||||
with manifest capabilities. A heuristic over the text of tests/, so it
|
with manifest capabilities. A heuristic over the text of tests/, so it
|
||||||
answers "what should I run" rather than "what covers this".
|
answers "what should I run" rather than "what covers this".
|
||||||
@@ -491,7 +493,9 @@ is_contract_capability() {
|
|||||||
# each external capability it skipped. A plain terminal run asks before any
|
# each external capability it skipped. A plain terminal run asks before any
|
||||||
# selected non-hermetic work. Automation must grant every required capability
|
# selected non-hermetic work. Automation must grant every required capability
|
||||||
# with repeatable --allow flags. Each contract gets an outer timeout, 180
|
# with repeatable --allow flags. Each contract gets an outer timeout, 180
|
||||||
# seconds by default, and failures include the captured stdout and stderr.
|
# seconds by default. PANAMA_TEST_TIMEOUT_SECONDS accepts a positive integer
|
||||||
|
# override. Failures include captured stdout and stderr. Successful stdout stays
|
||||||
|
# quiet, while successful stderr is surfaced as a warning.
|
||||||
cmd_test() {
|
cmd_test() {
|
||||||
local timeout_seconds="${PANAMA_TEST_TIMEOUT_SECONDS:-180}"
|
local timeout_seconds="${PANAMA_TEST_TIMEOUT_SECONDS:-180}"
|
||||||
[[ "$timeout_seconds" =~ ^[1-9][0-9]*$ ]] || {
|
[[ "$timeout_seconds" =~ ^[1-9][0-9]*$ ]] || {
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ Other tools that beat raw commands:
|
|||||||
A plain `panama test` prompts in a terminal before it starts non-hermetic contracts. Automation
|
A plain `panama test` prompts in a terminal before it starts non-hermetic contracts. Automation
|
||||||
must grant each required capability with a repeatable `--allow`, such as
|
must grant each required capability with a repeatable `--allow`, such as
|
||||||
`panama test --allow live-host updates`. Each contract has a 180-second outer timeout by default,
|
`panama test --allow live-host updates`. Each contract has a 180-second outer timeout by default,
|
||||||
and failures print captured stdout and stderr.
|
which a positive `PANAMA_TEST_TIMEOUT_SECONDS` value overrides. Failures print captured stdout
|
||||||
|
and stderr. Successful stdout stays quiet. Successful stderr is surfaced as a warning.
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user