Skip to content

Commit ea9bbf3

Browse files
authored
[EventHub] skip failing CI identity auth samples (Azure#41487)
* [EventHub] skip failing CI identity auth samples * mypy * converting send samples to conn str auth for testing concurrency send samples in CI * fix pylint ci
1 parent ac42e43 commit ea9bbf3

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

scripts/devops_tasks/test_run_samples.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
"recv_with_checkpoint_store_async.py": (10),
5555
"recv_with_custom_starting_position_async.py": (10),
5656
"sample_code_eventhub_async.py": (10),
57-
"send_and_receive_amqp_annotated_message.py": (10),
58-
"send_and_receive_amqp_annotated_message_async.py": (10),
5957
},
6058
"azure-eventhub-checkpointstoreblob": {
6159
"receive_events_using_checkpoint_store.py": (10),
@@ -95,14 +93,19 @@
9593
"sample_publish_events_to_a_topic_using_sas_credential_async.py"
9694
],
9795
"azure-eventhub": [
98-
"client_identity_authentication.py", # TODO: remove after fixing issue #29177
99-
"client_identity_authentication_async.py", # TODO: remove after fixing issue #29177
96+
"client_identity_authentication.py",
97+
"client_identity_authentication_async.py",
10098
"connection_to_custom_endpoint_address.py",
10199
"proxy.py",
102100
"connection_to_custom_endpoint_address_async.py",
103101
"iot_hub_connection_string_receive_async.py",
104102
"proxy_async.py",
105-
"send_stream.py", # TODO: remove after fixing issue #29177
103+
"send_stream.py",
104+
"send_stream_async.py",
105+
"send_buffered_mode.py",
106+
"send_buffered_mode_async.py",
107+
"send_and_receive_amqp_annotated_message.py",
108+
"send_and_receive_amqp_annotated_message_async.py",
106109
],
107110
"azure-eventhub-checkpointstoretable": ["receive_events_using_checkpoint_store.py"],
108111
"azure-servicebus": [

sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_blobstoragecsaio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import logging
77
import copy
88
from collections import defaultdict
9-
import asyncio
9+
import asyncio # pylint:disable=do-not-import-asyncio
1010
from azure.eventhub.exceptions import OwnershipLostError # type: ignore
1111
from azure.eventhub.aio import CheckpointStore # type: ignore
1212
from azure.core.exceptions import ResourceModifiedError, ResourceExistsError, ResourceNotFoundError # type: ignore

sdk/eventhub/azure-eventhub/samples/async_samples/send_and_receive_amqp_annotated_message_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from azure.eventhub import TransportType
1515
from azure.eventhub.aio import EventHubProducerClient, EventHubConsumerClient
1616
from azure.eventhub.amqp import AmqpAnnotatedMessage, AmqpMessageBodyType
17-
from azure.identity.aio import AzureCliCredential
17+
from azure.identity.aio import DefaultAzureCredential
1818

1919
FULLY_QUALIFIED_NAMESPACE = os.environ["EVENT_HUB_HOSTNAME"]
2020
EVENTHUB_NAME = os.environ["EVENT_HUB_NAME"]
@@ -91,7 +91,7 @@ async def main():
9191
producer = EventHubProducerClient(
9292
fully_qualified_namespace=FULLY_QUALIFIED_NAMESPACE,
9393
eventhub_name=EVENTHUB_NAME,
94-
credential=AzureCliCredential(),
94+
credential=DefaultAzureCredential(),
9595
transport_type=TransportType.AmqpOverWebsocket,
9696
)
9797
async with producer:
@@ -102,7 +102,7 @@ async def main():
102102
# Receive
103103
consumer = EventHubConsumerClient(
104104
fully_qualified_namespace=FULLY_QUALIFIED_NAMESPACE,
105-
credential=AzureCliCredential(),
105+
credential=DefaultAzureCredential(),
106106
consumer_group="$Default",
107107
eventhub_name=EVENTHUB_NAME,
108108
transport_type=TransportType.AmqpOverWebsocket,

sdk/eventhub/azure-eventhub/samples/async_samples/send_async.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
from azure.eventhub.aio import EventHubProducerClient
1717
from azure.eventhub.exceptions import EventHubError
1818
from azure.eventhub import EventData
19-
from azure.identity.aio import DefaultAzureCredential
2019

21-
FULLY_QUALIFIED_NAMESPACE = os.environ["EVENT_HUB_HOSTNAME"]
20+
CONNECTION_STR = os.environ["EVENT_HUB_CONN_STR"]
2221
EVENTHUB_NAME = os.environ["EVENT_HUB_NAME"]
2322

2423

@@ -90,10 +89,9 @@ async def send_event_data_list(producer):
9089

9190
async def run():
9291

93-
producer = EventHubProducerClient(
94-
fully_qualified_namespace=FULLY_QUALIFIED_NAMESPACE,
92+
producer = EventHubProducerClient.from_connection_string(
93+
conn_str=CONNECTION_STR,
9594
eventhub_name=EVENTHUB_NAME,
96-
credential=DefaultAzureCredential(),
9795
)
9896
async with producer:
9997
await send_event_data_batch(producer)

sdk/eventhub/azure-eventhub/samples/sync_samples/send.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
import os
1414
from azure.eventhub import EventHubProducerClient, EventData
1515
from azure.eventhub.exceptions import EventHubError
16-
from azure.identity import DefaultAzureCredential
1716

18-
FULLY_QUALIFIED_NAMESPACE = os.environ["EVENT_HUB_HOSTNAME"]
17+
CONNECTION_STR = os.environ["EVENT_HUB_CONN_STR"]
1918
EVENTHUB_NAME = os.environ["EVENT_HUB_NAME"]
2019

2120

@@ -89,10 +88,9 @@ def send_event_data_list(producer):
8988
print("Sending error: ", eh_err)
9089

9190

92-
producer = EventHubProducerClient(
93-
fully_qualified_namespace=FULLY_QUALIFIED_NAMESPACE,
91+
producer = EventHubProducerClient.from_connection_string(
92+
conn_str=CONNECTION_STR,
9493
eventhub_name=EVENTHUB_NAME,
95-
credential=DefaultAzureCredential(),
9694
)
9795

9896
start_time = time.time()

0 commit comments

Comments
 (0)