|
31 | 31 | """ |
32 | 32 | TIMEOUT_SAMPLES = { |
33 | 33 | "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) |
35 | 71 | } |
36 | 72 | } |
37 | 73 |
|
|
46 | 82 | "sample_publish_events_to_a_topic_using_sas_credential.py", |
47 | 83 | "sample_publish_events_to_a_topic_using_sas_credential_async.py"], |
48 | 84 | "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", |
61 | 85 | "connection_to_custom_endpoint_address.py", |
62 | 86 | "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", |
71 | 87 | "connection_to_custom_endpoint_address_async.py", |
72 | 88 | "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" |
90 | 90 | ], |
91 | 91 | "azure-servicebus": [ |
92 | | - "failure_and_recovery.py", |
93 | 92 | "mgmt_queue.py", |
94 | 93 | "mgmt_rule.py", |
95 | 94 | "mgmt_subscription.py", |
96 | 95 | "mgmt_topic.py", |
97 | 96 | "proxy.py", |
98 | 97 | "receive_deferred_message_queue.py", |
99 | | - "receive_iterator_queue.py", |
100 | | - "session_pool_receive.py", |
101 | 98 | "mgmt_queue_async.py", |
102 | 99 | "mgmt_rule_async.py", |
103 | 100 | "mgmt_subscription_async.py", |
104 | 101 | "mgmt_topic_async.py", |
105 | 102 | "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" |
109 | 104 | ], |
110 | 105 | "azure-ai-formrecognizer": [ |
111 | 106 | "sample_recognize_receipts_from_url.py", |
@@ -193,6 +188,14 @@ def run_samples(targeted_package): |
193 | 188 | package_name = os.path.basename(targeted_package) |
194 | 189 | samples_need_timeout = TIMEOUT_SAMPLES.get(package_name, {}) |
195 | 190 |
|
| 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 | + |
196 | 199 | for path, subdirs, files in os.walk(samples_dir_path): |
197 | 200 | for name in files: |
198 | 201 | if fnmatch(name, "*.py") and name in samples_need_timeout: |
|
0 commit comments