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

Closed
opened 2026-03-13 23:46:52 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: fix(test): fix tolerant exit code and missing RC check in resource CLI test
  • Branch: fix/integration-resource-cli-tolerant-rc

Background

The resource CLI test (robot/resource_cli.robot, 40 lines) contains two failure-masking patterns.

Problems Identified

  1. Tolerant exit code (line 31): Should Be True ${result.rc} == 0 or ${result.rc} == 1 accepts both success (rc=0) AND error (rc=1) exit codes. This means the test passes even when the command fails with an error.

  2. Unchecked Suite Setup (line 18): The Suite Setup runs Run Process to create the database schema, but the return code is never checked. If schema creation fails silently, all subsequent tests in the suite may pass for wrong reasons (e.g., testing against an empty or stale database).

Acceptance Criteria

  • Line 31: Exit code check requires exactly rc == 0 (hard failure on non-zero)
  • Line 18: Suite Setup Run Process has an explicit return code check (Should Be Equal As Integers ${result.rc} 0)
  • nox -s integration_tests passes

Subtasks

  • Change line 31 from rc == 0 or rc == 1 to Should Be Equal As Integers ${result.rc} 0
  • Add return code assertion after Suite Setup's Run Process call on line 18
  • Run nox -s integration_tests and verify the test suite passes
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `fix(test): fix tolerant exit code and missing RC check in resource CLI test` - **Branch**: `fix/integration-resource-cli-tolerant-rc` ## Background The resource CLI test (`robot/resource_cli.robot`, 40 lines) contains two failure-masking patterns. ### Problems Identified 1. **Tolerant exit code** (line 31): `Should Be True ${result.rc} == 0 or ${result.rc} == 1` accepts both success (rc=0) AND error (rc=1) exit codes. This means the test passes even when the command fails with an error. 2. **Unchecked Suite Setup** (line 18): The Suite Setup runs `Run Process` to create the database schema, but the return code is never checked. If schema creation fails silently, all subsequent tests in the suite may pass for wrong reasons (e.g., testing against an empty or stale database). ## Acceptance Criteria - [ ] Line 31: Exit code check requires exactly `rc == 0` (hard failure on non-zero) - [ ] Line 18: Suite Setup `Run Process` has an explicit return code check (`Should Be Equal As Integers ${result.rc} 0`) - [ ] `nox -s integration_tests` passes ## Subtasks - [ ] Change line 31 from `rc == 0 or rc == 1` to `Should Be Equal As Integers ${result.rc} 0` - [ ] Add return code assertion after Suite Setup's `Run Process` call on line 18 - [ ] Run `nox -s integration_tests` and verify the test suite passes - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v3.2.0 milestone 2026-03-13 23:46:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#896
No description provided.