From bfb206adf9dea9c84a6bc9e6eb33c8415a79b849 Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Sat, 21 Nov 2026 03:42:24 -0500 Subject: [PATCH 1/2] docs(result): account for cancelled results in latest-result examples --- CHANGELOG.md | 36 ++++++++++++++++++------------------ DOCUMENTATION.md | 11 +++++++++-- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5afd3f11..b3b88897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,24 +50,24 @@ Writing tests now goes through the project's agent: `plan` asks it for tests and - **Tests are written by the project's agent; the CLI no longer writes them.** A coding agent runs tests, reads their results and fixes product code; new, changed and removed tests go through the agent (`testsprite plan ""`, then `testsprite apply`; `testsprite reply` / `testsprite reject` to iterate). These commands are deleted, with no deprecation period; stay on 0.16.x if you still need one: - | Removed | Use instead | - | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | - | `test create`, `test create-batch`, `test scaffold`, `test lint`, `test plan generate`, `test plan accept` | `testsprite plan ""`, then `testsprite apply` | - | `test update`, `test delete`, `test delete-batch`, `test code put`, `test plan put` | `testsprite plan " should …"` (or `reply` in an open conversation), then `testsprite apply` | - | `project docs upload` | attach the document to the request: `testsprite plan --file ` | - | `test rerun` | `run `, or `run --project ` for `--all`; `run` takes no `--status` or `--skip-terminal` | - | `test flaky` | no replacement; run `run ` again | - | `test open` | the `Dashboard:` link that `run` prints | - | `project sign-in get`, `project sign-in set` | an existing environment's sign-in is set in the Portal; `project env create` still takes the sign-in flags | - | `project credential` | `project env create` / `update` with `--auth` and `--credential-file` | - | `project auto-auth` | `project env update --auto-auth-file `; `--auth` switches it off | - | `project create --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env create --name default --url …` (or `--local `), which takes the sign-in flags | - | `project create --description` | nothing: a project has no description | - | `project update --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env update …` | - | `test list --status`, `--env`, `--created-from` | nothing on `test list`: a case carries no result; `result list --test --limit 1` reads the latest one | - | `test run --all --status` | `run ` with the `caseKey` of each result `result list --run --status failed,blocked` lists | - | `ci doctor`, `ci connect` | none; read deployment history with `gh api repos///deployments` and link the platform with its CLI | - | `init`, `auth configure`, `auth whoami`, `auth logout` (hidden aliases) | `setup`, `setup`, `auth status`, `auth remove` | + | Removed | Use instead | + | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | + | `test create`, `test create-batch`, `test scaffold`, `test lint`, `test plan generate`, `test plan accept` | `testsprite plan ""`, then `testsprite apply` | + | `test update`, `test delete`, `test delete-batch`, `test code put`, `test plan put` | `testsprite plan " should …"` (or `reply` in an open conversation), then `testsprite apply` | + | `project docs upload` | attach the document to the request: `testsprite plan --file ` | + | `test rerun` | `run `, or `run --project ` for `--all`; `run` takes no `--status` or `--skip-terminal` | + | `test flaky` | no replacement; run `run ` again | + | `test open` | the `Dashboard:` link that `run` prints | + | `project sign-in get`, `project sign-in set` | an existing environment's sign-in is set in the Portal; `project env create` still takes the sign-in flags | + | `project credential` | `project env create` / `update` with `--auth` and `--credential-file` | + | `project auto-auth` | `project env update --auto-auth-file `; `--auth` switches it off | + | `project create --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env create --name default --url …` (or `--local `), which takes the sign-in flags | + | `project create --description` | nothing: a project has no description | + | `project update --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env update …` | + | `test list --status`, `--env`, `--created-from` | nothing on `test list`: a case carries no result; `result list --test --limit 1` reads the latest non-cancelled result | + | `test run --all --status` | `run ` with the `caseKey` of each result `result list --run --status failed,blocked` lists | + | `ci doctor`, `ci connect` | none; read deployment history with `gh api repos///deployments` and link the platform with its CLI | + | `init`, `auth configure`, `auth whoami`, `auth logout` (hidden aliases) | `setup`, `setup`, `auth status`, `auth remove` | The first-project hints after `setup`, `project create`, an empty `test list` and an empty `run --project ` now point at `testsprite plan`, then `testsprite apply`. The `schemas/plan.schema.json` plan-file schema is no longer shipped. `auth status` and `doctor` no longer print the routing advisory (its one open gap was `test rerun`). diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 7a09553d..a11cf3a3 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -223,7 +223,7 @@ Common flags: #### `testsprite test get ` -Get one test case by id, with its steps. Test ids come from `test list` (and from `apply`). Text output lists the case's fields, then each step; backend cases echo their dependency declarations — `produces` / `consumes` — when present. When a per-test timeout is set, text output includes `stepTimeout: ms (applies to every step)`. Nothing here is a result: `testsprite result list --test --limit 1` lists the latest one, and `testsprite result get ` reads it. +Get one test case by id, with its steps. Test ids come from `test list` (and from `apply`). Text output lists the case's fields, then each step; backend cases echo their dependency declarations — `produces` / `consumes` — when present. When a per-test timeout is set, text output includes `stepTimeout: ms (applies to every step)`. Nothing here is a result: `testsprite result list --test --limit 1` lists the latest non-cancelled result, and `testsprite result get ` reads it. ```bash testsprite test get "$TEST_ID" --output json @@ -248,7 +248,14 @@ testsprite result list --test "$TEST_ID" --env staging --dry-run | `--env ` | `--test` | only results from this project environment; an unknown name is exit 5 and lists the valid names | | `--limit ` | `--test` | how many results, 1–100 (default 20) | -Exactly one of `--run` / `--test` is required, and `--env` or `--limit` with `--run` is exit 5. Text prints one line per result (`CREATED STATUS RESULT ID RUN ID ENV TITLE`), or `No results.`; with `--test`, a stderr note says how many older results your plan's history window hides. The `--run` response includes a `run` object with the execution status. Both queries return `results[]` with `resultId`, `runId`, `caseKey`, `title`, `testStatus` and timestamps. A test history can also include `hiddenRunCount` and `retentionDays`; `testStatus` is upper case. `title` is the title the test had when that result ran. Exit `0` whatever the verdicts; `4` when the run or test is not found. A test's newest result: `result list --test --limit 1`, then `result get `. +Exactly one of `--run` / `--test` is required, and `--env` or `--limit` with `--run` is exit 5. Text prints one line per result (`CREATED STATUS RESULT ID RUN ID ENV TITLE`), or `No results.`; with `--test`, a stderr note says how many older results your plan's history window hides. The `--run` response includes a `run` object with the execution status. Both queries return `results[]` with `resultId`, `runId`, `caseKey`, `title`, `testStatus` and timestamps. A test history can also include `hiddenRunCount` and `retentionDays`; `testStatus` is upper case. `title` is the title the test had when that result ran. Exit `0` whatever the verdicts; `4` when the run or test is not found. + +`--limit 1` returns the latest result among the selected statuses. The default omits cancelled results, so it can return an older result after a cancellation. To include every supported status, then read the returned result ID: + +```bash +testsprite result list --test "$TEST_ID" --limit 1 --status passed,failed,running,blocked,cancelled +testsprite result get "$RESULT_ID" +``` The text output of `result list` and `result get` shows `QUEUED` while a result is waiting for dispatch. On the wire this is `testStatus: "RUNNING"` with `processStatus: "Idle"`, so `--status running` includes queued results. From 30f83d731d8896796532c3ad928a092095dd4c09 Mon Sep 17 00:00:00 2001 From: Zeshi Du Date: Mon, 23 Nov 2026 18:53:16 -0800 Subject: [PATCH 2/2] docs(result): make the latest-result example self-contained --- CHANGELOG.md | 36 ++++++++++++++++++------------------ DOCUMENTATION.md | 7 ++++--- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b88897..5afd3f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,24 +50,24 @@ Writing tests now goes through the project's agent: `plan` asks it for tests and - **Tests are written by the project's agent; the CLI no longer writes them.** A coding agent runs tests, reads their results and fixes product code; new, changed and removed tests go through the agent (`testsprite plan ""`, then `testsprite apply`; `testsprite reply` / `testsprite reject` to iterate). These commands are deleted, with no deprecation period; stay on 0.16.x if you still need one: - | Removed | Use instead | - | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | - | `test create`, `test create-batch`, `test scaffold`, `test lint`, `test plan generate`, `test plan accept` | `testsprite plan ""`, then `testsprite apply` | - | `test update`, `test delete`, `test delete-batch`, `test code put`, `test plan put` | `testsprite plan " should …"` (or `reply` in an open conversation), then `testsprite apply` | - | `project docs upload` | attach the document to the request: `testsprite plan --file ` | - | `test rerun` | `run `, or `run --project ` for `--all`; `run` takes no `--status` or `--skip-terminal` | - | `test flaky` | no replacement; run `run ` again | - | `test open` | the `Dashboard:` link that `run` prints | - | `project sign-in get`, `project sign-in set` | an existing environment's sign-in is set in the Portal; `project env create` still takes the sign-in flags | - | `project credential` | `project env create` / `update` with `--auth` and `--credential-file` | - | `project auto-auth` | `project env update --auto-auth-file `; `--auth` switches it off | - | `project create --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env create --name default --url …` (or `--local `), which takes the sign-in flags | - | `project create --description` | nothing: a project has no description | - | `project update --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env update …` | - | `test list --status`, `--env`, `--created-from` | nothing on `test list`: a case carries no result; `result list --test --limit 1` reads the latest non-cancelled result | - | `test run --all --status` | `run ` with the `caseKey` of each result `result list --run --status failed,blocked` lists | - | `ci doctor`, `ci connect` | none; read deployment history with `gh api repos///deployments` and link the platform with its CLI | - | `init`, `auth configure`, `auth whoami`, `auth logout` (hidden aliases) | `setup`, `setup`, `auth status`, `auth remove` | + | Removed | Use instead | + | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | + | `test create`, `test create-batch`, `test scaffold`, `test lint`, `test plan generate`, `test plan accept` | `testsprite plan ""`, then `testsprite apply` | + | `test update`, `test delete`, `test delete-batch`, `test code put`, `test plan put` | `testsprite plan " should …"` (or `reply` in an open conversation), then `testsprite apply` | + | `project docs upload` | attach the document to the request: `testsprite plan --file ` | + | `test rerun` | `run `, or `run --project ` for `--all`; `run` takes no `--status` or `--skip-terminal` | + | `test flaky` | no replacement; run `run ` again | + | `test open` | the `Dashboard:` link that `run` prints | + | `project sign-in get`, `project sign-in set` | an existing environment's sign-in is set in the Portal; `project env create` still takes the sign-in flags | + | `project credential` | `project env create` / `update` with `--auth` and `--credential-file` | + | `project auto-auth` | `project env update --auto-auth-file `; `--auth` switches it off | + | `project create --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env create --name default --url …` (or `--local `), which takes the sign-in flags | + | `project create --description` | nothing: a project has no description | + | `project update --url`, `--local`, `--username`, `--password`, `--password-file`, `--skip-preflight` | `project env update …` | + | `test list --status`, `--env`, `--created-from` | nothing on `test list`: a case carries no result; `result list --test --limit 1` reads the latest one | + | `test run --all --status` | `run ` with the `caseKey` of each result `result list --run --status failed,blocked` lists | + | `ci doctor`, `ci connect` | none; read deployment history with `gh api repos///deployments` and link the platform with its CLI | + | `init`, `auth configure`, `auth whoami`, `auth logout` (hidden aliases) | `setup`, `setup`, `auth status`, `auth remove` | The first-project hints after `setup`, `project create`, an empty `test list` and an empty `run --project ` now point at `testsprite plan`, then `testsprite apply`. The `schemas/plan.schema.json` plan-file schema is no longer shipped. `auth status` and `doctor` no longer print the routing advisory (its one open gap was `test rerun`). diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 097d7410..5d1bbfac 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -207,7 +207,7 @@ When the server supplies an environment summary, text detail shows `defaultEnv: #### `testsprite test list --project ` -List the project's test cases as they are written. `--project` is required. Cursor-paginated. Each row is the case alone: `id`, `slug`, `title`, `type`, `category`, `priority`, `version` and `stepCount`; a result is never part of it (`testsprite result list --test --limit 1` reads the latest one). Text output has the ID / SLUG / TITLE / TYPE / CATEGORY / PRIORITY / VERSION / STEPS / UPDATED columns. +List the project's test cases as they are written. `--project` is required. Cursor-paginated. Each row is the case alone: `id`, `slug`, `title`, `type`, `category`, `priority`, `version` and `stepCount`; a result is never part of it (`testsprite result list --test --limit 1` reads the latest non-cancelled one). Text output has the ID / SLUG / TITLE / TYPE / CATEGORY / PRIORITY / VERSION / STEPS / UPDATED columns. ```bash testsprite test list --project "$PROJECT_ID" --output json @@ -250,10 +250,11 @@ testsprite result list --test "$TEST_ID" --env staging --dry-run Exactly one of `--run` / `--test` is required, and `--env` or `--limit` with `--run` is exit 5. Text prints one line per result (`CREATED STATUS RESULT ID RUN ID ENV TITLE`), or `No results.`; with `--test`, a stderr note says how many older results your plan's history window hides. The `--run` response includes a `run` object with the execution status. Both queries return `results[]` with `resultId`, `runId`, `caseKey`, `title`, `testStatus` and timestamps. A test history can also include `hiddenRunCount` and `retentionDays`; `testStatus` is upper case. `title` is the title the test had when that result ran. Exit `0` whatever the verdicts; `4` when the run or test is not found. -`--limit 1` returns the latest result among the selected statuses. The default omits cancelled results, so it can return an older result after a cancellation. To include every supported status, then read the returned result ID: +`--limit 1` returns the latest result among the selected statuses. The default omits cancelled results, so it can return an older result after a cancellation. To include every supported status and read the result it returns: ```bash -testsprite result list --test "$TEST_ID" --limit 1 --status passed,failed,running,blocked,cancelled +RESULT_ID=$(testsprite result list --test "$TEST_ID" --limit 1 \ + --status passed,failed,running,blocked,cancelled --output json | jq -r '.results[0].resultId') testsprite result get "$RESULT_ID" ```