Commit 222b22c
test: resolve PR #242 review comments
Address CodeQL (github-code-quality) and Copilot review comments on PR #242:
CodeQL: unused imports / variables
- test_queue_service_internals.py: drop redundant `tp = _task_param()`
in test_output_cleanup_refuses_broad_prefix; drop unused
`_no_op_worker` in test_start_service_runs_and_completes.
- test_application_base_init.py: drop unused `import inspect` and
unused `app` local in test_init_loads_app_config_when_url_set.
- test_agent_speaking_capture.py: drop unused `datetime`/`MagicMock`
imports.
- test_agent_telemetry.py: drop unused `from datetime import UTC, datetime`
(only the literal string ` UTC` is used, not the imports).
- test_agent_telemetry_records.py: drop unused `import pytest`.
- test_config.py (backend SAS blob): drop unused `pytest` import and
unused `default_config` symbol from the import list (still
referenced via `blob_config_module.default_config`).
Copilot review: order-dependent MagicMock leak
- test_async_helper_extra.py and test_helper_extra.py: replace
`type(MagicMock()).__name__ = ...` mutation in `_wire_credential`
with a dedicated dynamically-created stub class per credential type.
Mutating `__name__` on the shared MagicMock class globally renamed
that class for any later test that introspected `type(...)`,
making the suite order-dependent/flaky. The new stubs scope each
credential class name to its own type while preserving
`hasattr(cred, 'account_key')` semantics for both account-key and
AAD code paths.
Verification
- Backend unit tests: 585 passing (1 unrelated environmental failure
against example.azconfig.io), 93.28% coverage.
- Processor unit tests: 812 passing, 87.44% coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5b6f6fa commit 222b22c
8 files changed
Lines changed: 19 additions & 23 deletions
File tree
- src
- backend-api/src/tests/sas/storage/blob
- processor/src/tests/unit
- libs
- agent_framework
- base
- services
- utils
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | | - | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | | - | |
88 | 91 | | |
89 | | - | |
90 | | - | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | | - | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | | - | |
76 | 81 | | |
77 | | - | |
78 | | - | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | | - | |
| 73 | + | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
718 | 717 | | |
719 | 718 | | |
720 | 719 | | |
| |||
784 | 783 | | |
785 | 784 | | |
786 | 785 | | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | 786 | | |
791 | 787 | | |
792 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
0 commit comments