Skip to content

Commit b531e02

Browse files
committed
modify timed samples section to install sample dependencies
1 parent 074ce88 commit b531e02

File tree

2 files changed

+49
-44
lines changed

2 files changed

+49
-44
lines changed

scripts/devops_tasks/test_run_samples.py

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,43 @@
3131
"""
3232
TIMEOUT_SAMPLES = {
3333
"azure-eventhub": {
34-
"receive_batch_with_checkpoint.py": (3, True)
34+
"authenticate_with_sas_token.py": (5, True),
35+
"receive_batch_with_checkpoint.py": (5, True),
36+
"recv.py": (5, True),
37+
"recv_track_last_enqueued_event_prop.py": (5, True),
38+
"recv_with_checkpoint_by_event_count.py": (5, True),
39+
"recv_with_checkpoint_by_time_interval.py": (5, True),
40+
"recv_with_checkpoint_store.py": (5, True),
41+
"recv_with_custom_starting_position.py": (5, True),
42+
"sample_code_eventhub.py": (10, True),
43+
"authenticate_with_sas_token_async.py": (5, True),
44+
"receive_batch_with_checkpoint_async.py": (5, True),
45+
"recv_async.py": (5, True),
46+
"recv_track_last_enqueued_event_prop_async.py": (5, True),
47+
"recv_with_checkpoint_by_event_count_async.py": (5, True),
48+
"recv_with_checkpoint_by_time_interval_async.py": (5, True),
49+
"recv_with_checkpoint_store_async.py": (5, True),
50+
"recv_with_custom_starting_position_async.py": (5, True),
51+
"sample_code_eventhub_async.py": (10, True)
52+
},
53+
"azure-eventhub-checkpointstoreblob": {
54+
"receive_events_using_checkpoint_store.py": (5, True),
55+
"receive_events_using_checkpoint_store_storage_api_version.py": (5, True)
56+
},
57+
"azure-eventhub-checkpointstoreblob-aio": {
58+
"receive_events_using_checkpoint_store_async.py": (5, True),
59+
"receive_events_using_checkpoint_store_storage_api_version_async.py": (5, True)
60+
},
61+
"azure-servicebus": {
62+
"auto_lock_renew.py": (120, True),
63+
"failure_and_recovery.py": (5, True),
64+
"receive_iterator_queue.py": (5, True),
65+
"sample_code_servicebus.py": (30, True),
66+
"session_pool_receive.py": (20, True),
67+
"auto_lock_renew_async.py": (120, True),
68+
"receive_iterator_queue_async.py": (5, True),
69+
"sample_code_servicebus_async.py": (30, True),
70+
"session_pool_receive_async.py": (20, True)
3571
}
3672
}
3773

@@ -46,66 +82,25 @@
4682
"sample_publish_events_to_a_topic_using_sas_credential.py",
4783
"sample_publish_events_to_a_topic_using_sas_credential_async.py"],
4884
"azure-eventhub": [
49-
"send.py",
50-
"send_async.py",
51-
"send_stream.py",
52-
"send_stream_async.py",
53-
"recv_for_period_async.py",
54-
"client_creation_async.py",
55-
"connection_string_authentication.py",
56-
"connection_string_authentication_async.py",
57-
"client_identity_authentication_async.py",
58-
"client_creation.py",
59-
"client_identity_authentication.py",
60-
"authenticate_with_sas_token.py",
6185
"connection_to_custom_endpoint_address.py",
6286
"proxy.py",
63-
"recv.py",
64-
"recv_track_last_enqueued_event_prop.py",
65-
"recv_with_checkpoint_by_event_count.py",
66-
"recv_with_checkpoint_by_time_interval.py",
67-
"recv_with_checkpoint_store.py",
68-
"recv_with_custom_starting_position.py",
69-
"sample_code_eventhub.py",
70-
"authenticate_with_sas_token_async.py",
7187
"connection_to_custom_endpoint_address_async.py",
7288
"iot_hub_connection_string_receive_async.py",
73-
"proxy_async.py",
74-
"receive_batch_with_checkpoint_async.py",
75-
"recv_async.py",
76-
"recv_track_last_enqueued_event_prop_async.py",
77-
"recv_with_checkpoint_by_event_count_async.py",
78-
"recv_with_checkpoint_by_time_interval_async.py",
79-
"recv_with_checkpoint_store_async.py",
80-
"recv_with_custom_starting_position_async.py",
81-
"sample_code_eventhub_async.py"
82-
],
83-
"azure-eventhub-checkpointstoreblob": [
84-
"receive_events_using_checkpoint_store.py",
85-
"receive_events_using_checkpoint_store_storage_api_version.py"
86-
],
87-
"azure-eventhub-checkpointstoreblob-aio": [
88-
"receive_events_using_checkpoint_store_async.py",
89-
"receive_events_using_checkpoint_store_storage_api_version_async.py"
89+
"proxy_async.py"
9090
],
9191
"azure-servicebus": [
92-
"failure_and_recovery.py",
9392
"mgmt_queue.py",
9493
"mgmt_rule.py",
9594
"mgmt_subscription.py",
9695
"mgmt_topic.py",
9796
"proxy.py",
9897
"receive_deferred_message_queue.py",
99-
"receive_iterator_queue.py",
100-
"session_pool_receive.py",
10198
"mgmt_queue_async.py",
10299
"mgmt_rule_async.py",
103100
"mgmt_subscription_async.py",
104101
"mgmt_topic_async.py",
105102
"proxy_async.py",
106-
"receive_deferred_message_queue_async.py",
107-
"receive_iterator_queue_async.py",
108-
"session_pool_receive_async.py"
103+
"receive_deferred_message_queue_async.py"
109104
],
110105
"azure-ai-formrecognizer": [
111106
"sample_recognize_receipts_from_url.py",
@@ -193,6 +188,14 @@ def run_samples(targeted_package):
193188
package_name = os.path.basename(targeted_package)
194189
samples_need_timeout = TIMEOUT_SAMPLES.get(package_name, {})
195190

191+
# install extra dependencies for samples if needed
192+
try:
193+
with open(samples_dir_path + "/sample_dev_requirements.txt") as sample_dev_reqs:
194+
for dep in sample_dev_reqs.readlines():
195+
check_call([sys.executable, '-m', 'pip', 'install', dep])
196+
except:
197+
pass
198+
196199
for path, subdirs, files in os.walk(samples_dir_path):
197200
for name in files:
198201
if fnmatch(name, "*.py") and name in samples_need_timeout:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
azure-eventhub-checkpointstoreblob
2+
azure-eventhub-checkpointstoreblob-aio

0 commit comments

Comments
 (0)