test: Psl lqa ut 30042608#212
Open
Shreyas-Microsoft wants to merge 6 commits intodevfrom
Open
Conversation
- align RateLimitRetryConfig.from_env clamp test with default (120s) - use a real context-keyword message for the 413 path test - assert that _trim_messages preserves the last message untouched - drop monkeypatch of non-existent text2art symbol in analysis_executor tests
… application context wave 1: 426 new tests covering sas storage helpers (queue 85-92%, blob config 100%), routers (http_probes/router_debug/auth 100%), application_context (46->90%), application_base (80->93%), typed_fastapi/fastapi_protocol/app_configuration (->100%)
… 75% coverage - Added 104 unit tests for QueueMigrationService covering: * Service lifecycle (initialization, start, stop) * Worker loop and message processing * Queue message handling and validation * Blob cleanup operations (sync and async) * Error handling and edge cases * Telemetry integration * Control watcher loop * Config variations - Implemented MockModule class in conftest.py to intercept third-party dependencies (agent_framework, qdrant_client, azure_ai_projects) before pytest collection - Created comprehensive test fixtures (_FakeQueueClient, _FakeQueueMessage, _FakeAppContext) to simulate Azure SDK behavior without requiring live connections - Coverage improved from 27.3% baseline to 75% for queue_service.py - 435 of 578 statements covered - 143 statements remain uncovered (mostly defensive error paths and edge cases) - Remaining gaps are primarily in: * Complex blob cleanup with HNS (hierarchical namespace) scenarios * Worker loop defensive exception handling paths * Conditional telemetry/logging branches * Edge cases requiring specific Azure SDK failures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ces/steps wave 2: backend-api 54->91% (blob helpers 99/98%, router_process 97%, process_services 100%, process_status_repository 97%); processor 42->83% (agent_framework 92%, reporting 100%, mcp_mermaid 98%, orchestrators 100%, utils 100%, queue_service 75%)
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||
… coverage from 14% to 70% - Created 110 test cases exercising all major TelemetryManager methods - Tests cover utility functions, Pydantic models, and repository-mocked scenarios - Implemented tests for error paths, edge cases, and complex workflows - All tests execute production code paths with mocked Azure dependencies (cosmos repos, blob storage) - Test patterns follow existing repository conventions (asyncio.run, unittest.mock, etc.) Coverage improvements: - agent_telemetry.py: 14% → 70% (501 missing lines → 218 missing lines) - 844 total processor tests passing with no regressions Test file: src/tests/unit/utils/test_agent_telemetry.py (2400+ lines) - Utility function tests: _sha256_text, _byte_len_text, container/connection helpers - Model tests: AgentActivityHistory, AgentActivity, ProcessStatus field validation - Development mode tests: TelemetryManager without repository - Repository-mocked tests: All async methods with realistic workflows - Error path tests: Exception handling, missing processes, update failures - Complex method tests: record_step_result, record_failure_outcome, record_final_outcome - UI data and rendering tests: get_ui_telemetry_data, render_agent_status Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ailures - .github/workflows/test.yml: add independent processor_tests job alongside backend_tests; both run on every push/PR touching either service or this workflow (no needs: between them, so one failure doesn't block the other). Upload coverage.xml as artifact per service. Distinct unique-id-for-comment so PR coverage comments don't clobber each other. Document the backend-api pytest.ini-is-actually-TOML quirk (-c /dev/null workaround retained). - test_application_context_extra.py: rewrite the 9 async tests to use the asyncio.run() wrapper convention used elsewhere in this repo, since pytest-asyncio is not in backend-api's deps and the existing pytest.ini is bypassed in CI. - test_blob_helper.py: TestBlobDownloadOperations.test_download_blob_to_file_success now also patches os.makedirs so the test no longer hits the real filesystem (was failing with PermissionError on Linux runners against '/path').
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||
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
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information