-
Notifications
You must be signed in to change notification settings - Fork 107
test: add ServiceBus SDK tests #1678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
test: add ServiceBus SDK tests #1678
Conversation
…-worker into extensions/azurefunctions-extensions-bindings-servicebus/1.0.0b1
@@ -84,6 +84,7 @@ jobs: | |||
env: | |||
AzureWebJobsStorage: "UseDevelopmentStorage=true" | |||
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;" | |||
AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A different connection string value (instead of UseDevelopmentStorage=true
is needed when interacting with the SDK and using emulators. Same goes for ServiceBus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't git flag this while pushing? The repo might get flagged coz of the key in the connection string
@@ -150,7 +150,7 @@ jobs: | |||
Write-Host "skipTest: $(skipTest)" | |||
displayName: 'Display skipTest variable' | |||
- bash: | | |||
python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend tests/extension_tests/deferred_bindings_tests tests/extension_tests/http_v2_tests | |||
python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the extension_tests
folder anymore -- blob SDK bindings tests are moved to emulators folder, and HttpV2 moved to E2E
@@ -79,7 +79,8 @@ dev = [ | |||
"numpy", | |||
"pre-commit", | |||
"invoke", | |||
"cryptography" | |||
"cryptography", | |||
"jsonpickle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added jsonpickle
to help with the SB tests. Majority of the properties of the ServiceBusReceivedMessage were not JSON-serializable, and I wanted to keep the same general test structure as the current SB tests
return testutils.EXTENSION_TESTS_FOLDER / 'deferred_bindings_tests' / \ | ||
'deferred_bindings_blob_functions' | ||
return testutils.EMULATOR_TESTS_FOLDER / 'blob_functions' / \ | ||
'blob_functions_sdk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For naming conventions, I went with <binding>_functions_sdk
to match <binding>_functions_stein
, but open to other ways like blob_sdk_functions
if that's preferable
@@ -84,6 +84,7 @@ jobs: | |||
env: | |||
AzureWebJobsStorage: "UseDevelopmentStorage=true" | |||
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;" | |||
AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't git flag this while pushing? The repo might get flagged coz of the key in the connection string
@@ -84,6 +84,7 @@ jobs: | |||
env: | |||
AzureWebJobsStorage: "UseDevelopmentStorage=true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still being used or can it be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's used by the non-SDK bindings blob tests
@app.service_bus_queue_trigger( | ||
arg_name="msg", | ||
connection="AzureWebJobsServiceBusSDKConnectionString", | ||
queue_name="testqueue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test for SB topics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the extension support topics?
Description
Adds ServiceBus SDK-type bindings tests (using emulator)
Migrates Blob SDK-type binding tests to use emulators
Moves HttpV2 tests into E2E directory
Fixes #
PR information
Quality of Code and Contribution Guidelines