Added comprehensive tests for core components#12
Open
pankaj-bind wants to merge 1 commit intopydantic:mainfrom
Open
Added comprehensive tests for core components#12pankaj-bind wants to merge 1 commit intopydantic:mainfrom
pankaj-bind wants to merge 1 commit intopydantic:mainfrom
Conversation
izzymsft
approved these changes
Jul 11, 2025
Contributor
izzymsft
left a comment
There was a problem hiding this comment.
This looks good to me. Thanks @pankaj-bind for sending this in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses the "Limited Test Coverage for Core Components" issue by introducing a comprehensive suite of unit and integration tests for the
fasta2alibrary's core components.[cite_start]Previously, the test suite only validated the agent card endpoint (
/.well-known/agent.json) tests/test_applications.py, leaving critical components likeTaskManagerBrokerStorageWorkerwithout any test coverage. This gap could allow bugs in the main task processing logic to go unnoticed.
Solution
To resolve this, I have added the following new test files:
tests/test_storage.py: Adds unit tests for theInMemoryStorageclass[cite: 1265]. These tests verify the functionality of submitting, loading, and updating tasks, as well as managing the conversation context.tests/test_broker.py: Tests theInMemoryBroker[cite: 1045] to ensure that task operations are correctly sent and received through its in-memory message stream.tests/test_task_manager.py: Introduces an integration test for theTaskManagerthat simulates the full, end-to-end lifecycle of a task. It uses aMockWorkerto confirm that tasks are correctly submitted via theTaskManager, processed by a worker, and that their final state is accurately reflected in storage.These tests are designed to be robust and handle the asynchronous nature of the library, preventing the race conditions and deadlocks encountered during development.
Value