Skip to content

test: Psl lqa ut 30042608#212

Open
Shreyas-Microsoft wants to merge 6 commits intodevfrom
psl-lqa-ut-30042608
Open

test: Psl lqa ut 30042608#212
Shreyas-Microsoft wants to merge 6 commits intodevfrom
psl-lqa-ut-30042608

Conversation

@Shreyas-Microsoft
Copy link
Copy Markdown
Collaborator

Purpose

  • ...

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Shreyas-Microsoft and others added 4 commits April 30, 2026 14:50
- 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%)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
__init__.py4175%5
application.py340100% 
main.py9188%20
routers
   __init__.py00100% 
TOTAL308633489% 

Tests Skipped Failures Errors Time
787 0 💤 10 ❌ 0 🔥 21.922s ⏱️

… 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

…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').
@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
__init__.py4175%5
application.py340100% 
main.py9188%20
routers
   __init__.py00100% 
TOTAL308626991% 

Tests Skipped Failures Errors Time
787 0 💤 0 ❌ 0 🔥 18.800s ⏱️

@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
__init__.py00100% 
agent_telemetry.py73421870%74–77, 79–83, 86–89, 91, 93–96, 98, 104–105, 110, 302–304, 306, 335, 338, 351, 353–356, 445, 449, 455–456, 462, 483, 486, 504–507, 509–511, 519–520, 551–552, 556, 571, 592, 601, 629–636, 654–655, 660, 674–675, 698–699, 747–748, 766–771, 775, 777–778, 781–784, 786, 794, 805–806, 825, 855, 861–862, 864, 889–890, 892, 899, 905, 907–909, 911, 913–915, 917, 919, 935, 944, 947–949, 951, 953, 955, 960, 963, 965, 967, 971–972, 975, 979, 981, 987, 989, 991, 997, 999, 1001–1002, 1004, 1006, 1008–1009, 1011, 1013–1017, 1021, 1026–1028, 1030, 1035, 1037, 1042, 1046–1047, 1050–1051, 1054, 1057, 1068–1069, 1071–1072, 1074, 1130–1132, 1158, 1161–1162, 1170–1171, 1185–1186, 1196, 1199–1200, 1212, 1214, 1228–1233, 1236–1237, 1261, 1281, 1294, 1297–1298, 1315, 1319–1320, 1341, 1372–1373, 1420, 1422, 1446–1447, 1462, 1465–1466, 1473, 1475, 1477, 1487–1488, 1502–1503, 1506, 1544, 1570–1571, 1587–1588, 1625–1627
console_util.py430100% 
credential_util.py980100% 
logging_utils.py880100% 
migration_processor.py2632291%320–321, 324–327, 331–332, 345–346, 405–406, 508–509, 559–560, 567–568, 606–607, 625–626
prompt_util.py140100% 
queue_service.py57814375%171–172, 174, 191, 220, 350–351, 393–394, 407–408, 412–413, 474–475, 480–481, 512–517, 519, 525–528, 531–532, 534, 559, 564–565, 569, 571, 590–591, 595, 665, 674–675, 689, 699, 736, 779, 785, 790–793, 798, 800, 805–809, 818–822, 824–826, 836–837, 840–841, 843–844, 846, 850–856, 858–860, 868, 875–876, 888, 892, 905–906, 914, 934–935, 939, 941–943, 945, 948, 950, 956–957, 960, 963, 970, 977–978, 983, 985, 1073, 1090, 1100–1102, 1109–1111, 1132, 1134–1135, 1140–1141, 1148–1149, 1168, 1179–1180, 1215–1221, 1223, 1284–1286, 1288–1290, 1319–1320
security_policy_evidence.py900100% 
TOTAL551454090% 

Tests Skipped Failures Errors Time
844 0 💤 0 ❌ 0 🔥 1m 10s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants