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

Open
opened 2026-04-02 23:53:28 +00:00 by freemo · 1 comment
Owner

Metadata

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

Background and Context

The file src/cleveragents/a2a/asgi.py has 25% test coverage. This is a significant gap that needs to be addressed. The asgi.py module implements the ASGI application lifecycle and middleware for the A2A server layer — a critical component of the CleverAgents server architecture (ADR-047, ADR-048). 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/asgi.py has ≥ 97% test coverage.
  • All ASGI application lifecycle paths, middleware behaviour, and edge cases 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/asgi.py (including application startup, shutdown, request handling, middleware, and error paths).
  • Robot Framework integration tests exercise the ASGI application end-to-end.
  • ASV performance benchmarks exist for the ASGI application request-handling path.
  • nox -e coverage_report reports ≥ 97% coverage for src/cleveragents/a2a/asgi.py.
  • All nox stages pass (nox).

Supporting Information

  • Related issue: #1594 (broader a2a module test coverage — this issue focuses specifically on asgi.py coverage gaps)
  • 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/asgi.py to identify all untested code paths and branches.
  • Write Behave feature file(s) in features/ covering all scenarios in asgi.py (ASGI lifecycle, middleware, request routing, error handling).
  • Implement step definitions for each Behave scenario; place any required mocks/test doubles in features/mocks/.
  • Write Robot Framework integration tests for the ASGI application.
  • Write ASV performance benchmarks for the ASGI application request-handling path.
  • 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/asgi.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 asgi.py ASGI application), 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-asgi-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-asgi-coverage` - **Commit Message**: `test(a2a): add Behave, Robot, and ASV tests for asgi.py ASGI application` - **Milestone**: v3.8.0 - **Parent Epic**: #933 ## Background and Context The file `src/cleveragents/a2a/asgi.py` has 25% test coverage. This is a significant gap that needs to be addressed. The `asgi.py` module implements the ASGI application lifecycle and middleware for the A2A server layer — a critical component of the CleverAgents server architecture (ADR-047, ADR-048). 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/asgi.py` has ≥ 97% test coverage. - All ASGI application lifecycle paths, middleware behaviour, and edge cases 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/asgi.py` (including application startup, shutdown, request handling, middleware, and error paths). - [ ] Robot Framework integration tests exercise the ASGI application end-to-end. - [ ] ASV performance benchmarks exist for the ASGI application request-handling path. - [ ] `nox -e coverage_report` reports ≥ 97% coverage for `src/cleveragents/a2a/asgi.py`. - [ ] All nox stages pass (`nox`). ## Supporting Information - Related issue: #1594 (broader a2a module test coverage — this issue focuses specifically on `asgi.py` coverage gaps) - 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/asgi.py` to identify all untested code paths and branches. - [ ] Write Behave feature file(s) in `features/` covering all scenarios in `asgi.py` (ASGI lifecycle, middleware, request routing, error handling). - [ ] Implement step definitions for each Behave scenario; place any required mocks/test doubles in `features/mocks/`. - [ ] Write Robot Framework integration tests for the ASGI application. - [ ] Write ASV performance benchmarks for the ASGI application request-handling path. - [ ] 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/asgi.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 asgi.py ASGI application`), 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-asgi-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-02 23:53:33 +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#1807
No description provided.