test: Add unit tests and update workflow configuration#543
Merged
Prajwal-Microsoft merged 17 commits intodevfrom Apr 20, 2026
Merged
test: Add unit tests and update workflow configuration#543Prajwal-Microsoft merged 17 commits intodevfrom
Prajwal-Microsoft merged 17 commits intodevfrom
Conversation
- Merged latest dev branch into psl-unit-test-cps-v2 - Fixed ContentProcessorAPI test for credential_scopes parameter - Fixed ContentProcessorWorkflow logging and app configuration tests - Added comprehensive tests for content_process_models.py (100% coverage) - Added comprehensive tests for content_process_service.py (98.81% coverage) - All modules now exceed 80% coverage threshold: * ContentProcessor: 86.68% * ContentProcessorAPI: 84.86% * ContentProcessorWorkflow: 92.13%
…flow - Added services/ directory to pytest command in test.yml - This ensures the new test_content_process_models.py and test_content_process_service.py are run in CI - Fixes coverage from 70.68% to 92.13%
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the automated test suite and CI execution for the ContentProcessor solution by adding new unit tests (Backend/ContentProcessor, API, Workflow) along with per-component coverage configuration, and updating the GitHub Actions test workflow to run separate jobs.
Changes:
- Added substantial new unit test coverage across
ContentProcessor,ContentProcessorAPI, andContentProcessorWorkflow. - Introduced per-component
pytest.ini,conftest.py, and.coveragercfiles plus test README docs. - Updated
.github/workflows/test.ymlto Python 3.12 and split CI into backend/api/workflow test jobs with coverage gates.
Reviewed changes
Copilot reviewed 94 out of 94 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tests/ContentProcessorWorkflow/utils/test_prompt_util.py | Adds unit tests for Jinja2 template rendering utility. |
| src/tests/ContentProcessorWorkflow/utils/test_logging_utils_extended.py | Adds additional logging utility tests to raise coverage. |
| src/tests/ContentProcessorWorkflow/utils/test_logging_utils.py | Adds baseline logging utility unit tests. |
| src/tests/ContentProcessorWorkflow/utils/test_http_simple.py | Adds basic HTTP helper tests (coverage-driven). |
| src/tests/ContentProcessorWorkflow/utils/test_http_request_utils.py | Adds parameterized tests for URL join + Retry-After parsing helpers. |
| src/tests/ContentProcessorWorkflow/utils/test_credential_util.py | Adds tests for Azure credential selection utilities. |
| src/tests/ContentProcessorWorkflow/steps/test_summarize_executor.py | Tests summarize executor prompt file loading paths/errors. |
| src/tests/ContentProcessorWorkflow/steps/test_step_models.py | Adds tests for Pydantic workflow step models. |
| src/tests/ContentProcessorWorkflow/steps/test_gap_executor.py | Tests GAP executor prompt/rules loading and YAML validation behavior. |
| src/tests/ContentProcessorWorkflow/steps/test_claim_processor.py | Tests workflow exception types and serialization behavior. |
| src/tests/ContentProcessorWorkflow/services/test_queue_service_stop_service.py | Tests queue service stop-service task cancellation/cleanup. |
| src/tests/ContentProcessorWorkflow/services/test_queue_service_stop_process.py | Tests stop-process message deletion, cleanup, and cancellation. |
| src/tests/ContentProcessorWorkflow/services/test_queue_service_failure_cleanup.py | Tests failure handling, DLQ routing, and cleanup logic. |
| src/tests/ContentProcessorWorkflow/services/test_queue_message_parsing.py | Tests queue message parsing (JSON/base64/validation). |
| src/tests/ContentProcessorWorkflow/services/test_content_process_models.py | Adds tests for workflow content process models. |
| src/tests/ContentProcessorWorkflow/repositories/test_claim_processes_repository.py | Adds tests for repository CRUD/upsert helpers using AsyncMock. |
| src/tests/ContentProcessorWorkflow/repositories/test_claim_process_model.py | Adds tests for repository domain models and defaults. |
| src/tests/ContentProcessorWorkflow/pytest.ini | Introduces workflow pytest discovery/markers configuration. |
| src/tests/ContentProcessorWorkflow/libs/test_ultra_focused_80.py | Adds targeted “coverage push” tests (notably coverage-driven). |
| src/tests/ContentProcessorWorkflow/libs/test_final_coverage_boost.py | Adds additional coverage-driven tests across libs/utils. |
| src/tests/ContentProcessorWorkflow/libs/test_final_80_percent_push.py | Adds more coverage-driven tests for edge branches. |
| src/tests/ContentProcessorWorkflow/libs/test_advanced_coverage.py | Adds additional coverage tests for HTTP/logging/DI branches. |
| src/tests/ContentProcessorWorkflow/libs/base/test_ApplicationBase.py | Adds very basic assertions for ApplicationBase presence. |
| src/tests/ContentProcessorWorkflow/libs/azure/test_app_configuration_helper.py | Adds unit tests for Azure App Configuration helper. |
| src/tests/ContentProcessorWorkflow/libs/application/test_service_config.py | Adds tests for ServiceConfig validation and serialization. |
| src/tests/ContentProcessorWorkflow/libs/application/test_env_configuration.py | Adds tests for env-based configuration loading. |
| src/tests/ContentProcessorWorkflow/libs/application/test_application_context_di.py | Adds DI lifetime behavior tests (singleton/transient/scoped/async). |
| src/tests/ContentProcessorWorkflow/libs/application/test_application_configuration.py | Adds tests for Configuration env alias and boolean parsing. |
| src/tests/ContentProcessorWorkflow/libs/application/test_AppConfiguration.py | Adds tests for Configuration defaults. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_mem0_async_memory.py | Adds tests for async memory manager caching behavior. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_input_observer_middleware.py | Adds tests for InputObserverMiddleware message replacement. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_groupchat_orchestrator_termination.py | Adds tests for orchestrator termination + loop detection. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_cosmos_checkpoint_storage.py | Adds tests for Cosmos checkpoint storage adapter/repo delegation. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_agent_speaking_capture.py | Adds tests for capturing agent responses and callback wiring. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_agent_info.py | Adds tests for AgentInfo template rendering behavior. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_agent_framework_settings.py | Adds tests for service discovery + env file loading behavior. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_agent_framework_helper.py | Adds tests for agent framework helper initialization + client creation. |
| src/tests/ContentProcessorWorkflow/libs/agent_framework/test_agent_builder.py | Adds tests for fluent AgentBuilder API and build delegation. |
| src/tests/ContentProcessorWorkflow/conftest.py | Adds sys.path wiring so workflow tests import workflow src tree. |
| src/tests/ContentProcessorWorkflow/README.md | Adds documentation for workflow tests (currently formatted as a Python docstring). |
| src/tests/ContentProcessorWorkflow/COVERAGE_README.md | Adds guidance for running “core logic” coverage. |
| src/tests/ContentProcessorWorkflow/.coveragerc | Adds coverage include/omit rules for workflow component. |
| src/tests/ContentProcessorAPI/pytest.ini | Adds pytest discovery/markers config for API tests. |
| src/tests/ContentProcessorAPI/libs/test_storage_queue_helper.py | Adds unit tests for storage queue helper with mocks. |
| src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py | Adds unit tests for Cosmos Mongo helper with mocks. |
| src/tests/ContentProcessorAPI/libs/test_app_configuration_helper.py | Adds unit tests for API AppConfigurationHelper behavior. |
| src/tests/ContentProcessorAPI/helpers/test_azure_credential_utils.py | Adds tests for API azure credential utility selection logic. |
| src/tests/ContentProcessorAPI/conftest.py | Adds sys.path wiring + default env var setup for API tests. |
| src/tests/ContentProcessorAPI/README.md | Adds documentation for API tests (currently formatted as a Python docstring). |
| src/tests/ContentProcessorAPI/.coveragerc | Adds coverage configuration for API component. |
| src/tests/ContentProcessor/utils/test_utils.py | Adds unit tests for backend utility helpers (encoder/flatten/match/contains). |
| src/tests/ContentProcessor/utils/test_stopwatch.py | Adds unit tests for Stopwatch behavior. |
| src/tests/ContentProcessor/utils/test_base64_util.py | Adds unit tests for base64 utility validation. |
| src/tests/ContentProcessor/utils/test_azure_credential_utils.py | Adds unit tests for backend azure credential utilities with patching. |
| src/tests/ContentProcessor/pytest.ini | Adds pytest discovery/markers config for backend tests. |
| src/tests/ContentProcessor/process_host/test_handler_type_loader.py | Adds tests for dynamic handler import/load behavior. |
| src/tests/ContentProcessor/pipeline/test_schema.py | Adds tests for Schema model construction + Cosmos lookup behavior. |
| src/tests/ContentProcessor/pipeline/test_queue_handler_base.py | Adds tests for HandlerBase subclass behavior and queue info. |
| src/tests/ContentProcessor/pipeline/test_pipeline_step_result.py | Adds tests for StepResult defaults and persistence guards. |
| src/tests/ContentProcessor/pipeline/test_pipeline_step_helper.py | Adds tests for pipeline step navigation helper. |
| src/tests/ContentProcessor/pipeline/test_pipeline_status.py | Adds tests for PipelineStatus step/result tracking. |
| src/tests/ContentProcessor/pipeline/test_pipeline_queue_helper.py | Adds tests for pipeline queue helper operations and naming. |
| src/tests/ContentProcessor/pipeline/test_pipeline_message_base.py | Adds tests for exception serialization on pipeline messages. |
| src/tests/ContentProcessor/pipeline/test_pipeline_file.py | Adds tests for artifact/file detail/log entry models. |
| src/tests/ContentProcessor/pipeline/test_pipeline_data.py | Adds tests for DataPipeline helpers and JSON parsing. |
| src/tests/ContentProcessor/pipeline/test_mime_types.py | Adds tests for MIME constants and detection behavior. |
| src/tests/ContentProcessor/pipeline/test_evaluate_model.py | Adds tests for evaluation result container serialization. |
| src/tests/ContentProcessor/pipeline/test_confidence.py | Adds tests for confidence extraction/merge logic. |
| src/tests/ContentProcessor/pipeline/test_comparison.py | Adds tests for extraction comparison models and builder function. |
| src/tests/ContentProcessor/libs/test_utils_coverage_boost.py | Adds additional “coverage push” tests for utilities. |
| src/tests/ContentProcessor/libs/test_models_and_entities.py | Adds broad “coverage push” tests for multiple models/entities. |
| src/tests/ContentProcessor/libs/test_final_push_80.py | Adds additional “coverage push” tests targeting remaining gaps. |
| src/tests/ContentProcessor/libs/test_complete_utils_coverage.py | Adds extensive tests to raise utility coverage (some assertions are weak). |
| src/tests/ContentProcessor/conftest.py | Adds sys.path wiring for backend tests. |
| src/tests/ContentProcessor/base/test_application_models.py | Adds tests for shared Pydantic base models/settings. |
| src/tests/ContentProcessor/azure_helper/test_storage_blob.py | Adds tests for StorageBlobHelper methods using mocks. |
| src/tests/ContentProcessor/azure_helper/test_cosmos_mongo.py | Adds mongomock-backed tests for Cosmos Mongo helper. |
| src/tests/ContentProcessor/azure_helper/test_content_understanding_model.py | Adds tests for content understanding response models. |
| src/tests/ContentProcessor/application/test_service_config.py | Adds tests for backend ServiceConfig. |
| src/tests/ContentProcessor/application/test_application_configuration.py | Adds tests for AppConfiguration.split_processes validator. |
| src/tests/ContentProcessor/README.md | Adds documentation for backend tests (currently formatted as a Python docstring). |
| src/tests/ContentProcessor/.coveragerc | Adds coverage configuration for backend component. |
| .github/workflows/test.yml | Splits CI into backend/api/workflow jobs; updates Python version; adjusts test discovery and coverage commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…variables, fix indentation
…rts, fix indentation
…s, fix indentation, remove extra blank line
…fix continuation line indentation
…ntinuation line indentation
Prajwal-Microsoft
approved these changes
Apr 20, 2026
|
🎉 This PR is included in version 1.14.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Purpose
This pull request significantly enhances the testing infrastructure and automation for the
ContentProcessorproject. It introduces comprehensive unit tests for core modules, configures coverage reporting, and expands the GitHub Actions workflow to run separate test jobs for backend, API, and workflow components. It also updates the Python version used in CI and improves test file structure and coverage configuration.Does this introduce a breaking change?
CI/CD Workflow Improvements:
psl-unit-test-cps-v2.Testing and Coverage Enhancements:
.coveragercfile insrc/tests/ContentProcessorto focus coverage on core business logic and exclude integration, test, and external dependency files.README.mdinsrc/tests/ContentProcessordocumenting the test structure, coverage expectations, and usage instructions.New Unit Tests for Core Modules:
application/test_application_configuration.py.application/test_service_config.py.azure_helper/test_content_understanding_model.py.mongomockfor isolated CRUD operation testing, inazure_helper/test_cosmos_mongo.py.What to Check
Verify that the following are valid
Other Information