fix(test): remove expected_rc bypass mechanism from common E2E resource #899

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

Metadata

  • Commit Message: fix(test): remove expected_rc bypass mechanism from common E2E resource
  • Branch: fix/e2e-remove-rc-bypass

Background

The common E2E resource file (robot/e2e/common_e2e.resource, ~100 lines on master) contains a latent bypass mechanism on lines 69–70:

IF '${expected_rc}' != 'None'
    Should Be Equal As Integers    ${result.rc}    ${expected_rc}
END

The Run CleverAgents Command keyword accepts an expected_rc argument that defaults to ${0}. When callers pass expected_rc=None, the return code assertion is completely skipped — the command can fail with any exit code and the test still passes.

During the E2E test cleanup (Epic #739), all callers that passed expected_rc=None were fixed. However, the bypass mechanism itself remains in the shared resource. This means any future test author could reintroduce the pattern by passing expected_rc=None, silently disabling return code verification.

Acceptance Criteria

  • The IF '${expected_rc}' != 'None' guard on lines 69–70 is removed
  • The Should Be Equal As Integers ${result.rc} ${expected_rc} assertion executes unconditionally
  • The expected_rc parameter still exists with default ${0} so callers can assert specific non-zero codes when needed (e.g., expected_rc=${1} for expected failures)
  • No existing callers pass expected_rc=None (this should already be true after Epic #739 work)
  • nox -s integration_tests passes

Subtasks

  • Remove the IF '${expected_rc}' != 'None' / END wrapper around the RC assertion
  • Keep expected_rc=${0} as default parameter, keep the Should Be Equal As Integers assertion
  • Verify no remaining callers pass expected_rc=None via grep
  • 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): remove expected_rc bypass mechanism from common E2E resource` - **Branch**: `fix/e2e-remove-rc-bypass` ## Background The common E2E resource file (`robot/e2e/common_e2e.resource`, ~100 lines on master) contains a latent bypass mechanism on lines 69–70: ```robotframework IF '${expected_rc}' != 'None' Should Be Equal As Integers ${result.rc} ${expected_rc} END ``` The `Run CleverAgents Command` keyword accepts an `expected_rc` argument that defaults to `${0}`. When callers pass `expected_rc=None`, the return code assertion is completely skipped — the command can fail with any exit code and the test still passes. During the E2E test cleanup (Epic #739), all callers that passed `expected_rc=None` were fixed. However, the bypass mechanism itself remains in the shared resource. This means any future test author could reintroduce the pattern by passing `expected_rc=None`, silently disabling return code verification. ## Acceptance Criteria - [ ] The `IF '${expected_rc}' != 'None'` guard on lines 69–70 is removed - [ ] The `Should Be Equal As Integers ${result.rc} ${expected_rc}` assertion executes unconditionally - [ ] The `expected_rc` parameter still exists with default `${0}` so callers can assert specific non-zero codes when needed (e.g., `expected_rc=${1}` for expected failures) - [ ] No existing callers pass `expected_rc=None` (this should already be true after Epic #739 work) - [ ] `nox -s integration_tests` passes ## Subtasks - [ ] Remove the `IF '${expected_rc}' != 'None'` / `END` wrapper around the RC assertion - [ ] Keep `expected_rc=${0}` as default parameter, keep the `Should Be Equal As Integers` assertion - [ ] Verify no remaining callers pass `expected_rc=None` via grep - [ ] 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:47:29 +00:00
freemo 2026-03-14 03:31:46 +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#899
No description provided.