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

1 Commits

Author SHA1 Message Date
freemo ec450e9085 fix(test): fix tolerant exit code and missing RC check in resource CLI test
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 34s
CI / quality (pull_request) Successful in 34s
CI / build (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 40s
CI / e2e_tests (pull_request) Successful in 29s
CI / security (pull_request) Successful in 1m10s
CI / unit_tests (pull_request) Successful in 5m27s
CI / integration_tests (pull_request) Successful in 5m41s
CI / coverage (pull_request) Successful in 5m56s
CI / docker (pull_request) Successful in 1m9s
CI / lint (push) Successful in 22s
CI / quality (push) Successful in 31s
CI / e2e_tests (push) Successful in 50s
CI / typecheck (push) Successful in 56s
CI / security (push) Successful in 57s
CI / benchmark-regression (push) Has been skipped
CI / build (push) Successful in 41s
CI / unit_tests (push) Successful in 3m36s
CI / integration_tests (push) Successful in 3m46s
CI / docker (push) Successful in 1m7s
CI / coverage (push) Successful in 6m57s
CI / benchmark-publish (push) Successful in 19m47s
CI / benchmark-regression (pull_request) Successful in 44m27s
- Replace `rc == 0 or rc == 1` with strict `rc == 0` in resource type
  list test so failures are no longer silently accepted
- Capture and assert the return code of the Suite Setup database schema
  creation to fail fast if the setup itself is broken

apply strict RC checks to resource_cli.robot

- Capture return value of Run Process in Suite Setup and assert rc==0
- Replace tolerant RC check (rc==0 or rc==1) with strict Should Be Equal
  As Integers check for resource type list test case

broaden exception handling in resource CLI commands

Add catch-all `except Exception` handler after each `except
CleverAgentsError` block in all 14 resource CLI command handlers.
This ensures unexpected exceptions (e.g. sqlalchemy.exc.OperationalError)
are caught and displayed gracefully instead of producing raw tracebacks.

re-raise typer.Abort/Exit in broad exception handlers

The `except Exception` handlers added in the previous commit
inadvertently caught typer.Abort and typer.Exit, which are
subclasses of Exception (via click.exceptions).  This turned
successful CLI exits into aborts and double-handled already-caught
errors, breaking integration tests that rely on normal typer exit
behaviour.

Add an isinstance guard to re-raise typer.Abort and typer.Exit
before the catch-all handler runs.

Fixes #896
2026-03-14 15:47:03 -04:00