fix(test): fix tolerant exit code and missing RC check in resource CLI test #907

Merged
freemo merged 1 commits from fix/integration-resource-cli-tolerant-rc into master 2026-03-14 19:55:33 +00:00
Owner

Summary

Fixes #896

  • Changed resource type list exit code check from rc == 0 or rc == 1 to strict rc == 0 — the test should fail if the command returns an error
  • Added return code assertion to Suite Setup database schema creation — if schema creation fails, all subsequent tests would pass for wrong reasons
  • Broadened exception handling in all 14 resource CLI command handlers (resource.py) with except Exception catch-all blocks so unhandled exceptions produce a clean "Unexpected error" message and Aborted! exit instead of raw tracebacks
  • Added isinstance guard to re-raise typer.Abort and typer.Exit in the catch-all handlers — these are subclasses of Exception (via click.exceptions) and must propagate normally for typer's exit machinery to work
  • Replaced Unicode arrow characters () with ASCII (->) in resource_stop and resource_rebuild docstrings to avoid encoding issues

Part of Epic #892.

## Summary Fixes #896 - Changed `resource type list` exit code check from `rc == 0 or rc == 1` to strict `rc == 0` — the test should fail if the command returns an error - Added return code assertion to Suite Setup database schema creation — if schema creation fails, all subsequent tests would pass for wrong reasons - Broadened exception handling in all 14 resource CLI command handlers (`resource.py`) with `except Exception` catch-all blocks so unhandled exceptions produce a clean "Unexpected error" message and `Aborted!` exit instead of raw tracebacks - Added `isinstance` guard to re-raise `typer.Abort` and `typer.Exit` in the catch-all handlers — these are subclasses of `Exception` (via `click.exceptions`) and must propagate normally for typer's exit machinery to work - Replaced Unicode arrow characters (`→`) with ASCII (`->`) in `resource_stop` and `resource_rebuild` docstrings to avoid encoding issues Part of Epic #892.
freemo force-pushed fix/integration-resource-cli-tolerant-rc from 9f86ea4e66 to f2b8580e15 2026-03-13 23:56:20 +00:00 Compare
freemo force-pushed fix/integration-resource-cli-tolerant-rc from c3a153f2df to e580f57b60 2026-03-14 03:04:35 +00:00 Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-03-14 03:04:47 +00:00
freemo added the
MoSCoW
Must have
Priority
Critical
State
In Review
Type
Testing
labels 2026-03-14 04:34:35 +00:00
freemo added this to the v3.2.0 milestone 2026-03-14 04:34:40 +00:00
Author
Owner

PM Review — Day 34

Status: Mergeable, 0 reviews, Priority/Critical, M3 (v3.2.0)
Fixes: #896 (assigned to @brent.edwards) | Part of: Epic #892

Review Summary

The Robot Framework test changes are correct and well-scoped:

  • Suite Setup RC assertion: Previously the DB schema creation result was discarded — schema failures would silently let all downstream tests pass against a broken database. Now fails fast. ✓
  • Strict RC check: rc == 0 or rc == 1rc == 0. Eliminates masking of real CLI errors. ✓

Scope Concern

The third commit (e580f57) adds 14 catch-all except Exception handlers to src/cleveragents/cli/commands/resource.pyproduction code not mentioned in the PR title or description. This is scope creep:

  • The PR title says "fix(test)" but commit 3 is "fix(cli)"
  • The exception handlers are reasonable (clean error UX for CLI users), but should be documented in the PR body
  • Consider adding logger.exception() alongside the console print to preserve debuggability

Action Items

Who Action Deadline
@freemo Update PR description to document the resource.py exception handling changes Day 35
@brent.edwards Review this PR — you're the assignee on parent issue #896 and the QA lead Day 35

Labels Applied This Session

  • Type/Testing, Priority/Critical, State/In Review, MoSCoW/Must have
  • Milestone set to v3.2.0 (matching parent issue #896)
## PM Review — Day 34 **Status**: Mergeable, 0 reviews, Priority/Critical, M3 (v3.2.0) **Fixes**: #896 (assigned to @brent.edwards) | **Part of**: Epic #892 ### Review Summary The Robot Framework test changes are correct and well-scoped: - **Suite Setup RC assertion**: Previously the DB schema creation result was discarded — schema failures would silently let all downstream tests pass against a broken database. Now fails fast. ✓ - **Strict RC check**: `rc == 0 or rc == 1` → `rc == 0`. Eliminates masking of real CLI errors. ✓ ### Scope Concern The third commit (`e580f57`) adds 14 catch-all `except Exception` handlers to `src/cleveragents/cli/commands/resource.py` — **production code not mentioned in the PR title or description**. This is scope creep: - The PR title says "fix(test)" but commit 3 is "fix(cli)" - The exception handlers are reasonable (clean error UX for CLI users), but should be documented in the PR body - Consider adding `logger.exception()` alongside the console print to preserve debuggability ### Action Items | Who | Action | Deadline | |-----|--------|----------| | @freemo | Update PR description to document the `resource.py` exception handling changes | Day 35 | | @brent.edwards | **Review this PR** — you're the assignee on parent issue #896 and the QA lead | Day 35 | ### Labels Applied This Session - Type/Testing, Priority/Critical, State/In Review, MoSCoW/Must have - Milestone set to v3.2.0 (matching parent issue #896)
freemo force-pushed fix/integration-resource-cli-tolerant-rc from 4121521893 to a76166909f 2026-03-14 16:09:13 +00:00 Compare
freemo force-pushed fix/integration-resource-cli-tolerant-rc from a76166909f to 2e3c48071b 2026-03-14 19:46:05 +00:00 Compare
freemo force-pushed fix/integration-resource-cli-tolerant-rc from 2e3c48071b to ec450e9085 2026-03-14 19:48:46 +00:00 Compare
freemo merged commit ec450e9085 into master 2026-03-14 19:55:33 +00:00
freemo deleted branch fix/integration-resource-cli-tolerant-rc 2026-03-14 19:55:33 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Reference: cleveragents/cleveragents-core#907