TEST-INFRA: [coverage-gaps] Add test coverage for src/cleveragents/a2a/cli_bootstrap.py #1884

Open
opened 2026-04-03 00:05:55 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/a2a-cli-bootstrap-coverage
  • Commit Message: test(a2a): add Behave, Robot, and ASV tests for cli_bootstrap.py facade bootstrap
  • Milestone: v3.8.0
  • Parent Epic: #933

Background and Context

The file src/cleveragents/a2a/cli_bootstrap.py has 39% test coverage. This is a significant gap that needs to be addressed. The cli_bootstrap.py module implements the process-wide A2aLocalFacade bootstrap and DI wiring for CLI commands — a critical integration point between the CLI layer and the A2A facade (ADR-047, ADR-048). It provides lazy construction, per-process caching, and graceful service stubbing when optional container services are absent. Per the project's multi-level testing mandate, all code must be covered at the unit, integration, and performance levels using Behave (Gherkin), Robot Framework, and ASV respectively.

Please add unit tests to cover the functionality in this file.

Expected Behavior

  • src/cleveragents/a2a/cli_bootstrap.py has ≥ 97% test coverage.
  • All facade construction paths, DI wiring, caching behaviour, graceful service-absence handling, and the reset_facade utility are exercised at the unit, integration, and performance levels.
  • All new tests pass in the CI pipeline.

Acceptance Criteria

  • Behave unit test scenarios cover all code paths in src/cleveragents/a2a/cli_bootstrap.py (including _build_facade with all services present, _build_facade with each service absent/raising, get_facade lazy construction, get_facade cache hit, and reset_facade).
  • Robot Framework integration tests exercise the facade bootstrap end-to-end against a real container.
  • ASV performance benchmarks exist for the get_facade call path (both cold and warm cache).
  • nox -e coverage_report reports ≥ 97% coverage for src/cleveragents/a2a/cli_bootstrap.py.
  • All nox stages pass (nox).

Supporting Information

  • Related issue: #1807 (similar coverage gap for asgi.py in the same a2a module)
  • Related issue: #1782 (overall coverage at 37%, far below the 97% threshold)
  • Architecture references: ADR-047 (A2A Standard Adoption), ADR-048 (Server Application Architecture)
  • Parent Epic: #933 (A2A Protocol Compliance)

Subtasks

  • Audit src/cleveragents/a2a/cli_bootstrap.py to identify all untested code paths and branches.
  • Write Behave feature file(s) in features/ covering all scenarios in cli_bootstrap.py (_build_facade with all services wired, _build_facade with each optional service suppressed, get_facade lazy init, get_facade cache hit, reset_facade clearing the singleton).
  • Implement step definitions for each Behave scenario; place any required mocks/test doubles in features/mocks/.
  • Write Robot Framework integration tests for the facade bootstrap against a real container.
  • Write ASV performance benchmarks for the get_facade call path (cold and warm cache).
  • Run nox -e unit_tests and confirm all new Behave scenarios pass.
  • Run nox -e integration_tests and confirm all new Robot tests pass.
  • Run nox -e benchmarks and confirm ASV benchmarks run without error.
  • Run nox -e coverage_report and confirm coverage for src/cleveragents/a2a/cli_bootstrap.py is ≥ 97%.
  • Run nox -e typecheck and confirm no type errors are introduced.
  • Run nox -e lint and confirm no linting violations.
  • Run full nox and confirm all stages pass.

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 Behave, Robot, and ASV tests for cli_bootstrap.py facade bootstrap), 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 (test/a2a-cli-bootstrap-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: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `test/a2a-cli-bootstrap-coverage` - **Commit Message**: `test(a2a): add Behave, Robot, and ASV tests for cli_bootstrap.py facade bootstrap` - **Milestone**: v3.8.0 - **Parent Epic**: #933 ## Background and Context The file `src/cleveragents/a2a/cli_bootstrap.py` has 39% test coverage. This is a significant gap that needs to be addressed. The `cli_bootstrap.py` module implements the process-wide `A2aLocalFacade` bootstrap and DI wiring for CLI commands — a critical integration point between the CLI layer and the A2A facade (ADR-047, ADR-048). It provides lazy construction, per-process caching, and graceful service stubbing when optional container services are absent. Per the project's multi-level testing mandate, all code must be covered at the unit, integration, and performance levels using Behave (Gherkin), Robot Framework, and ASV respectively. Please add unit tests to cover the functionality in this file. ## Expected Behavior - `src/cleveragents/a2a/cli_bootstrap.py` has ≥ 97% test coverage. - All facade construction paths, DI wiring, caching behaviour, graceful service-absence handling, and the `reset_facade` utility are exercised at the unit, integration, and performance levels. - All new tests pass in the CI pipeline. ## Acceptance Criteria - [ ] Behave unit test scenarios cover all code paths in `src/cleveragents/a2a/cli_bootstrap.py` (including `_build_facade` with all services present, `_build_facade` with each service absent/raising, `get_facade` lazy construction, `get_facade` cache hit, and `reset_facade`). - [ ] Robot Framework integration tests exercise the facade bootstrap end-to-end against a real container. - [ ] ASV performance benchmarks exist for the `get_facade` call path (both cold and warm cache). - [ ] `nox -e coverage_report` reports ≥ 97% coverage for `src/cleveragents/a2a/cli_bootstrap.py`. - [ ] All nox stages pass (`nox`). ## Supporting Information - Related issue: #1807 (similar coverage gap for `asgi.py` in the same `a2a` module) - Related issue: #1782 (overall coverage at 37%, far below the 97% threshold) - Architecture references: ADR-047 (A2A Standard Adoption), ADR-048 (Server Application Architecture) - Parent Epic: #933 (A2A Protocol Compliance) ## Subtasks - [ ] Audit `src/cleveragents/a2a/cli_bootstrap.py` to identify all untested code paths and branches. - [ ] Write Behave feature file(s) in `features/` covering all scenarios in `cli_bootstrap.py` (`_build_facade` with all services wired, `_build_facade` with each optional service suppressed, `get_facade` lazy init, `get_facade` cache hit, `reset_facade` clearing the singleton). - [ ] Implement step definitions for each Behave scenario; place any required mocks/test doubles in `features/mocks/`. - [ ] Write Robot Framework integration tests for the facade bootstrap against a real container. - [ ] Write ASV performance benchmarks for the `get_facade` call path (cold and warm cache). - [ ] Run `nox -e unit_tests` and confirm all new Behave scenarios pass. - [ ] Run `nox -e integration_tests` and confirm all new Robot tests pass. - [ ] Run `nox -e benchmarks` and confirm ASV benchmarks run without error. - [ ] Run `nox -e coverage_report` and confirm coverage for `src/cleveragents/a2a/cli_bootstrap.py` is ≥ 97%. - [ ] Run `nox -e typecheck` and confirm no type errors are introduced. - [ ] Run `nox -e lint` and confirm no linting violations. - [ ] Run full `nox` and confirm all stages pass. ## 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 Behave, Robot, and ASV tests for cli_bootstrap.py facade bootstrap`), 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 (`test/a2a-cli-bootstrap-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: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 00:08:02 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement.

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. --- **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#1884
No description provided.