TEST-INFRA: [coverage-gaps] Zero coverage for src/cleveragents/a2a/clients.py #2280

Open
opened 2026-04-03 12:47:25 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/a2a-clients-coverage
  • Commit Message: test(a2a): add BDD scenarios for A2A server client protocol stubs
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The file src/cleveragents/a2a/clients.py currently has 0% test coverage. This file defines three Protocol interfaces (ServerClient, RemoteExecutionClient, AuthClient) and their corresponding stub implementations (StubServerClient, StubRemoteExecutionClient, StubAuthClient) that raise NotImplementedError. These stubs are the foundational boundary for all future server-mode client communication via the A2A protocol (see spec §Standards Alignment — A2A).

Although the stubs intentionally raise NotImplementedError, the argument validation logic in each stub method (e.g., rejecting empty or non-string plan_id and token values) is real, testable behaviour that must be covered. Additionally, the @runtime_checkable Protocol definitions themselves have structural contract semantics that should be verified. A file at 0% coverage violates the project's ≥ 97% coverage threshold and must be addressed.

Current Behavior

Running the coverage report shows src/cleveragents/a2a/clients.py at 0% coverage. No BDD scenarios exist that exercise the stub implementations, their argument validation guards, or the NotImplementedError raise paths.

Expected Behavior

BDD scenarios exist that cover all stub implementations and their argument validation, verifying:

  • That each stub method raises NotImplementedError when called with valid arguments
  • That each stub method raises ValueError when called with an empty string or non-string argument (where validation is present)
  • That the @runtime_checkable Protocol interfaces are satisfied by their respective stub classes (i.e., isinstance checks pass)

Acceptance Criteria

  • At least one Gherkin feature file covers the behaviour of all three stub classes (StubServerClient, StubRemoteExecutionClient, StubAuthClient)
  • All new scenarios are implemented with full step definitions (no placeholder steps)
  • Coverage for src/cleveragents/a2a/clients.py reaches 100%
  • Overall project coverage remains ≥ 97%
  • All nox default sessions pass without errors

Supporting Information

  • The file defines three Protocol interfaces and three stub implementations. Key behaviours to test:
    • StubServerClient.health_check() → raises NotImplementedError
    • StubServerClient.get_version() → raises NotImplementedError
    • StubRemoteExecutionClient.execute_plan(plan_id) → raises ValueError on empty/non-string, raises NotImplementedError on valid input
    • StubRemoteExecutionClient.get_plan_status(plan_id) → same validation pattern
    • StubRemoteExecutionClient.cancel_plan(plan_id) → same validation pattern
    • StubAuthClient.authenticate(token) → raises ValueError on empty/non-string, raises NotImplementedError on valid input
    • StubAuthClient.validate_token(token) → same validation pattern
    • isinstance(StubServerClient(), ServerClient)True (runtime_checkable Protocol)
    • isinstance(StubRemoteExecutionClient(), RemoteExecutionClient)True
    • isinstance(StubAuthClient(), AuthClient)True
  • Related Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing)
  • A2A architectural context: spec §Standards Alignment — A2A; ADR-047, ADR-048
  • Per CONTRIBUTING.md: BDD (Behave/Gherkin) is the required testing approach for unit-level scenarios

Subtasks

  • Identify or create the appropriate Behave feature file for a2a/clients stub behaviour
  • Write Gherkin scenarios covering: NotImplementedError raise paths for all stub methods, ValueError argument validation for StubRemoteExecutionClient and StubAuthClient, and isinstance Protocol conformance checks
  • Implement all step definitions for the new scenarios (no placeholder steps)
  • Verify src/cleveragents/a2a/clients.py reaches 100% coverage via nox -s coverage_report
  • Verify overall project coverage remains ≥ 97%
  • Run nox (all default sessions) and fix any errors

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 (test(a2a): add BDD scenarios for A2A server client protocol stubs), followed by a blank line, then additional lines providing relevant implementation details.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (test/a2a-clients-coverage).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: Unknown | Agent: ca-new-issue-creator

## Metadata - **Branch**: `test/a2a-clients-coverage` - **Commit Message**: `test(a2a): add BDD scenarios for A2A server client protocol stubs` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The file `src/cleveragents/a2a/clients.py` currently has **0% test coverage**. This file defines three `Protocol` interfaces (`ServerClient`, `RemoteExecutionClient`, `AuthClient`) and their corresponding stub implementations (`StubServerClient`, `StubRemoteExecutionClient`, `StubAuthClient`) that raise `NotImplementedError`. These stubs are the foundational boundary for all future server-mode client communication via the A2A protocol (see spec §Standards Alignment — A2A). Although the stubs intentionally raise `NotImplementedError`, the argument validation logic in each stub method (e.g., rejecting empty or non-string `plan_id` and `token` values) is real, testable behaviour that must be covered. Additionally, the `@runtime_checkable` Protocol definitions themselves have structural contract semantics that should be verified. A file at 0% coverage violates the project's ≥ 97% coverage threshold and must be addressed. ## Current Behavior Running the coverage report shows `src/cleveragents/a2a/clients.py` at 0% coverage. No BDD scenarios exist that exercise the stub implementations, their argument validation guards, or the `NotImplementedError` raise paths. ## Expected Behavior BDD scenarios exist that cover all stub implementations and their argument validation, verifying: - That each stub method raises `NotImplementedError` when called with valid arguments - That each stub method raises `ValueError` when called with an empty string or non-string argument (where validation is present) - That the `@runtime_checkable` Protocol interfaces are satisfied by their respective stub classes (i.e., `isinstance` checks pass) ## Acceptance Criteria - [ ] At least one Gherkin feature file covers the behaviour of all three stub classes (`StubServerClient`, `StubRemoteExecutionClient`, `StubAuthClient`) - [ ] All new scenarios are implemented with full step definitions (no placeholder steps) - [ ] Coverage for `src/cleveragents/a2a/clients.py` reaches 100% - [ ] Overall project coverage remains ≥ 97% - [ ] All `nox` default sessions pass without errors ## Supporting Information - The file defines three Protocol interfaces and three stub implementations. Key behaviours to test: - `StubServerClient.health_check()` → raises `NotImplementedError` - `StubServerClient.get_version()` → raises `NotImplementedError` - `StubRemoteExecutionClient.execute_plan(plan_id)` → raises `ValueError` on empty/non-string, raises `NotImplementedError` on valid input - `StubRemoteExecutionClient.get_plan_status(plan_id)` → same validation pattern - `StubRemoteExecutionClient.cancel_plan(plan_id)` → same validation pattern - `StubAuthClient.authenticate(token)` → raises `ValueError` on empty/non-string, raises `NotImplementedError` on valid input - `StubAuthClient.validate_token(token)` → same validation pattern - `isinstance(StubServerClient(), ServerClient)` → `True` (runtime_checkable Protocol) - `isinstance(StubRemoteExecutionClient(), RemoteExecutionClient)` → `True` - `isinstance(StubAuthClient(), AuthClient)` → `True` - Related Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing) - A2A architectural context: spec §Standards Alignment — A2A; ADR-047, ADR-048 - Per CONTRIBUTING.md: BDD (Behave/Gherkin) is the required testing approach for unit-level scenarios ## Subtasks - [ ] Identify or create the appropriate Behave feature file for `a2a/clients` stub behaviour - [ ] Write Gherkin scenarios covering: `NotImplementedError` raise paths for all stub methods, `ValueError` argument validation for `StubRemoteExecutionClient` and `StubAuthClient`, and `isinstance` Protocol conformance checks - [ ] Implement all step definitions for the new scenarios (no placeholder steps) - [ ] Verify `src/cleveragents/a2a/clients.py` reaches 100% coverage via `nox -s coverage_report` - [ ] Verify overall project coverage remains ≥ 97% - [ ] Run `nox` (all default sessions) and fix any errors ## 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 (`test(a2a): add BDD scenarios for A2A server client protocol stubs`), followed by a blank line, then additional lines providing relevant implementation details. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`test/a2a-clients-coverage`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 12:47:42 +00:00
Author
Owner

Potential overlap with #1975.

This issue reports 0% coverage for a2a/clients.py, while #1975 ("Add test coverage for src/cleveragents/a2a/clients.py", v3.8.0) reports 59% coverage for the same file. The discrepancy may be due to different measurement points or the file being refactored since #1975 was created. Both issues target the same file and goal (reaching ≥97% coverage).

Triaging as verified but flagging the overlap. The backlog groomer should consolidate these issues.

Issue triaged by project owner:

  • State: Verified
  • Priority: High (confirmed) — Zero coverage on a protocol boundary file.
  • Milestone: v3.8.0 (confirmed)
  • MoSCoW: Could Have — Coverage gap for A2A client stubs. Important for quality but not blocking current milestones.
  • Parent Epic: #1678 (confirmed correct)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

**Potential overlap with #1975.** This issue reports 0% coverage for `a2a/clients.py`, while #1975 ("Add test coverage for src/cleveragents/a2a/clients.py", v3.8.0) reports 59% coverage for the same file. The discrepancy may be due to different measurement points or the file being refactored since #1975 was created. Both issues target the same file and goal (reaching ≥97% coverage). Triaging as verified but flagging the overlap. The backlog groomer should consolidate these issues. Issue triaged by project owner: - **State**: Verified - **Priority**: High (confirmed) — Zero coverage on a protocol boundary file. - **Milestone**: v3.8.0 (confirmed) - **MoSCoW**: Could Have — Coverage gap for A2A client stubs. Important for quality but not blocking current milestones. - **Parent Epic**: #1678 (confirmed correct) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#2280
No description provided.