Skip to content

[CLI] Add archive/unarchive commands for test run execution - #122

Merged
rquidute merged 3 commits into
project-chip:v2.16-cli-developfrom
rquidute:feature/1120-archive-unarchive-test-run-execution
Sep 21, 2026
Merged

rquidute merged 3 commits into
project-chip:v2.16-cli-developfrom
rquidute:feature/1120-archive-unarchive-test-run-execution

Conversation

@rquidute

@rquidute rquidute commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds test-run-execution archive and test-run-execution unarchive commands to the CLI, plus a --archived filter on test-run-execution list output.

The backend has exposed POST /api/v1/test_run_executions/{id}/archive, POST /api/v1/test_run_executions/{id}/unarchive, and an archived query parameter on GET /api/v1/test_run_executions/ for a while, but the CLI had no way to call any of them.

Closes #1120

Changes

  • th_cli/commands/test_run_execution.py:
    • New archive and unarchive subcommands under the test-run-execution group, following the same --id/confirmation-free pattern as the existing delete/rename commands.
    • New --archived flag on the list command, threaded through to the backend's existing archived query parameter. Rejected in combination with --id (mirrors the existing --all/--log validation). Shows "Archived: yes" in the filter info line when active.
  • tests/test_test_run_execution_archive_unarchive.py: unit tests covering success, API error, missing --id, and --help for both commands.
  • tests/test_test_run_execution.py: new tests for the --archived flag (success, combined with --project-id, rejected with --id, shown in --help), plus fixes to existing mock assertions that didn't expect the new archived=False default kwarg on the list API call.

Test plan

  • pytest tests/test_test_run_execution_archive_unarchive.py -v — 8/8 passing.
  • pytest tests/test_test_run_execution.py -v --no-cov — 64/64 passing.
  • pytest tests/ -k test_run_execution --no-cov — no new failures (1 pre-existing unrelated fixture error in test_test_run_execution_repeat_export_import.py).
  • black, isort, mypy — no new issues introduced by this change.

Add `test-run-execution archive` and `test-run-execution unarchive`
commands, calling the backend's existing
POST /test_run_executions/{id}/archive and .../unarchive endpoints,
which previously had no CLI equivalent.

Closes project-chip/certification-tool#1120
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9d6ad511-92f0-4a4c-8d63-42c5926fe2e6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Sep 18, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

The archive/unarchive commands added a way to change the archived
state of a test run execution, but there was no way to list which
executions are currently archived. The backend's GET
/test_run_executions/ endpoint already supports an 'archived' query
parameter, so this just threads it through the CLI.

- Add --archived flag to 'test-run-execution' list options
- Reject --archived combined with --id (mirrors --all/--log rules)
- Show 'Archived: yes' in the filter info line when active
- Add/update unit tests covering the new flag and fix existing
  assertions broken by the new archived=False default kwarg
UnexpectedResponse.__init__() only accepts status_code and content,
but the fixture passed an unsupported headers= kwarg, causing every
test that depends on it to error out with a TypeError instead of
running (e.g. test_repeat_stops_two_way_talk_handler_on_start_failure).

Drop the unsupported kwarg and the now-unused httpx.Headers import.
@rquidute rquidute self-assigned this Sep 18, 2026
@rquidute
rquidute requested review from antonio-amjr and oxesoft and removed request for oxesoft September 18, 2026 17:50
@rquidute
rquidute merged commit 7b7483b into project-chip:v2.16-cli-develop Sep 21, 2026
5 checks passed
@rquidute
rquidute deleted the feature/1120-archive-unarchive-test-run-execution branch September 21, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants