Skip to content

Commit 3c645ab

Browse files
2 parents 7e4056e + a587917 commit 3c645ab

16 files changed

Lines changed: 28 additions & 41 deletions

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ on:
88
paths:
99
- 'src/backend-api/**/*.py'
1010
- 'src/backend-api/pyproject.toml'
11+
- 'src/backend-api/uv.lock'
1112
- 'src/backend-api/pytest.ini'
1213
- 'src/processor/**/*.py'
1314
- 'src/processor/pyproject.toml'
15+
- 'src/processor/uv.lock'
1416
- '.github/workflows/test.yml'
1517
pull_request:
1618
types:
@@ -24,9 +26,11 @@ on:
2426
paths:
2527
- 'src/backend-api/**/*.py'
2628
- 'src/backend-api/pyproject.toml'
29+
- 'src/backend-api/uv.lock'
2730
- 'src/backend-api/pytest.ini'
2831
- 'src/processor/**/*.py'
2932
- 'src/processor/pyproject.toml'
33+
- 'src/processor/uv.lock'
3034
- '.github/workflows/test.yml'
3135

3236
permissions:

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.13.2'
859859
principalType: 'ServicePrincipal'
860860
}
861861
{
862-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
862+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
863863
principalId: appIdentity.outputs.principalId
864864
principalType: 'ServicePrincipal'
865865
}

infra/main_custom.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ module existingAiFoundryAiServicesDeployments 'modules/ai-services-deployments.b
747747
{
748748
principalId: appIdentity.outputs.principalId
749749
principalType: 'ServicePrincipal'
750-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
750+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
751751
}
752752
]
753753
}
@@ -801,7 +801,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.13.2'
801801
principalType: 'ServicePrincipal'
802802
}
803803
{
804-
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Azure AI User
804+
roleDefinitionIdOrName: '53ca6127-db72-4b80-b1b0-d745d6d5456d' // Foundry User
805805
principalId: appIdentity.outputs.principalId
806806
principalType: 'ServicePrincipal'
807807
}

src/backend-api/src/tests/sas/storage/blob/test_async_helper_extra.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ def _wire_credential(svc_cls, *, account_key=None, account_name="myacct",
8181
credential_cls_name="DefaultAzureCredential"):
8282
svc = _wire(svc_cls)
8383
svc.account_name = account_name
84+
# Use a dedicated stub class per credential type so that ``type(cred).__name__``
85+
# reflects the desired credential class without mutating the shared ``MagicMock``
86+
# class metadata (which would leak across tests and make order-dependent failures).
8487
if credential_cls_name == "AccountKey":
85-
cred = MagicMock()
88+
cred_cls = type("StorageSharedKeyCredential", (), {})
89+
cred = cred_cls()
8690
cred.account_key = account_key
87-
type(cred).__name__ = "StorageSharedKeyCredential"
8891
else:
89-
cred = MagicMock(spec=[])
90-
type(cred).__name__ = credential_cls_name
92+
cred_cls = type(credential_cls_name, (), {})
93+
cred = cred_cls()
9194
svc.credential = cred
9295
return svc
9396

src/backend-api/src/tests/sas/storage/blob/test_config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
"""Tests for libs/sas/storage/blob/config.py."""
22

3-
import pytest
4-
53
from libs.sas.storage.blob import config as blob_config_module
64
from libs.sas.storage.blob.config import (
75
BlobHelperConfig,
86
create_config,
9-
default_config,
107
get_config,
118
set_config,
129
)

src/backend-api/src/tests/sas/storage/blob/test_helper_extra.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,21 @@ def test_delete_container_blobs_present_message_no_force(self, blob_service_mock
6666

6767
def _wire_credential(blob_service_mock, *, account_key=None, account_name="myacct",
6868
credential_cls_name="DefaultAzureCredential"):
69-
"""Make the helper's blob_service_client respond like an Azure SDK client."""
69+
"""Make the helper's blob_service_client respond like an Azure SDK client.
70+
71+
Uses a dedicated stub class per credential type so that ``type(cred).__name__``
72+
reflects the desired credential class without mutating the shared ``MagicMock``
73+
class metadata (which would leak across tests).
74+
"""
7075
h = _make_helper(blob_service_mock)
7176
h.blob_service_client.account_name = account_name
7277
if credential_cls_name == "AccountKey":
73-
cred = MagicMock()
78+
cred_cls = type("StorageSharedKeyCredential", (), {})
79+
cred = cred_cls()
7480
cred.account_key = account_key
75-
type(cred).__name__ = "StorageSharedKeyCredential"
7681
else:
77-
cred = MagicMock(spec=[])
78-
type(cred).__name__ = credential_cls_name
82+
cred_cls = type(credential_cls_name, (), {})
83+
cred = cred_cls()
7984
h.blob_service_client.credential = cred
8085
return h
8186

src/backend-api/src/tests/sas/storage/test_shared_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Tests for libs/sas/storage/shared_config.py."""
22

3-
import pytest
4-
53
from libs.sas.storage import shared_config as shared_config_module
64
from libs.sas.storage.shared_config import (
75
StorageConfig,

src/processor/src/tests/unit/libs/agent_framework/test_agent_speaking_capture.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
# Licensed under the MIT License.
33

44
import asyncio
5-
from datetime import datetime
65
from types import SimpleNamespace
7-
from unittest.mock import AsyncMock, MagicMock
6+
from unittest.mock import AsyncMock
87

98
from libs.agent_framework.agent_speaking_capture import AgentSpeakingCaptureMiddleware
109

src/processor/src/tests/unit/libs/agent_framework/test_cosmos_checkpoint_storage.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
# Licensed under the MIT License.
33

44
import asyncio
5-
from unittest.mock import AsyncMock, MagicMock, patch
5+
from unittest.mock import AsyncMock, MagicMock
66

7-
import pytest
8-
9-
from libs.agent_framework import cosmos_checkpoint_storage as ccs
107
from libs.agent_framework.cosmos_checkpoint_storage import (
118
CosmosCheckpointStorage,
129
CosmosWorkflowCheckpoint,

src/processor/src/tests/unit/libs/agent_framework/test_groupchat_orchestrator_internals.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
from libs.agent_framework.groupchat_orchestrator import (
2121
AgentResponse,
22-
AgentResponseStream,
2322
GroupChatOrchestrator,
2423
OrchestrationResult,
2524
)

0 commit comments

Comments
 (0)