Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/devops_tasks/test_run_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", ".."))

IGNORED_SAMPLES = {
"azure-eventgrid": ["__init__.py"]
"azure-eventgrid": [
"__init__.py",
"consume_cloud_events_from_eventhub.py",
"consume_cloud_events_from_service_bus_queue.py",
"consume_cloud_events_from_storage_queue.py"]
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from azure.eventgrid import EventGridConsumer

consumer = EventGridConsumer()
path = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./cs3_consume_system_events.json"))
Copy link
Contributor Author

@rakshith91 rakshith91 Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./cs3_consume_system_events.json"))
path = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./cs3_system_event.json"))


with open('./cs3_event_grid_event_system_event.json', 'r') as f:
with open(path, 'r') as f:
eg_event_received_message = json.loads(f.read())
# returns List[DeserializedEvent]
event = consumer.decode_eventgrid_event(eg_event_received_message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from azure.eventgrid import EventGridConsumer

consumer = EventGridConsumer()
path = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./cs4_event_grid_event_custom_event.json"))

with open('./cs4_event_grid_event_custom_event.json', 'r') as f:
with open(path, 'r') as f:
eg_event_received_message = json.loads(f.read())

# returns List[DeserializedEvent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from azure.eventgrid import EventGridConsumer

consumer = EventGridConsumer()
path = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./cs6_cloud_event_system_event.json"))

with open('./cs6_cloud_event_system_event.json', 'r') as f:
with open(path, 'r') as f:
cloud_event_received_message = json.loads(f.read())

# returns List[DeserializedEvent]
Expand Down
12 changes: 11 additions & 1 deletion sdk/eventgrid/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ jobs:
parameters:
ServiceDirectory: eventgrid
BuildTargetingString: azure-eventgrid*
TestSamples: true
EnvVars:
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
EG_ACCESS_KEY: $(python-sdk-test-eg-access-key)
EG_TOPIC_HOSTNAME: $(python-sdk-test-eg-topic-hostname)
CLOUD_ACCESS_KEY: $(python-sdk-test-eg-cloud-access-key)
CLOUD_TOPIC_HOSTNAME: $(python-sdk-test-eg-cloud-topic-hostname)
DOMAIN_ACCESS_KEY: $(python-sdk-test-eg-domain-access-key)
DOMAIN_TOPIC_HOSTNAME: $(python-sdk-test-eg-domain-topic-hostname)
DOMAIN_NAME: $(python-sdk-test-eg-domain-name)
CUSTOM_SCHEMA_ACCESS_KEY: $(python-sdk-test-eg-custom-schema-access-key)
CUSTOM_SCHEMA_TOPIC_HOSTNAME: $(python-sdk-test-custom-schema-topic-hostname)