Skip to content

Commit

Permalink
Merge branch 'dev' into hallvictoria/generic-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvictoria authored May 29, 2024
2 parents a913efb + b0bacf0 commit 419d951
Show file tree
Hide file tree
Showing 24 changed files with 398 additions and 166 deletions.
100 changes: 0 additions & 100 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

78 changes: 78 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Python Worker Bug Report
description: File a bug report
title: "[Bug] Bug Title Here"
labels: ["python", "bug"]
body:
- type: markdown
attributes:
value: |
This form will help you to fill in a bug report for the Azure Functions Python Worker.
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
placeholder: What should have occurred?

- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: A clear and concise description of what actually happened.
placeholder: What went wrong?

- type: textarea
id: reproduction-steps
attributes:
label: Steps to Reproduce
description: Please provide detailed step-by-step instructions on how to reproduce the bug.
placeholder: |
1. Go to the [specific page or section] in the application.
2. Click on [specific button or link].
3. Scroll down to [specific location].
4. Observe [describe what you see, e.g., an error message or unexpected behavior].
5. Include any additional steps or details that may be relevant.
- type: textarea
id: code-snippet
attributes:
label: Relevant code being tried
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

- type: textarea
id: requirements
attributes:
label: requirements.txt file
description: Please copy and paste your requirements.txt file. This will be automatically formatted into code, so no need for backticks.
render: shell

- type: dropdown
id: environment
attributes:
label: Where are you facing this problem?
default: 0
options:
- Local - Core Tools
- Production Environment (explain below)

- type: textarea
id: function-app-name
attributes:
label: Function app name
placeholder: https://github.com/Azure/azure-functions-host/wiki/Sharing-Your-Function-App-name-privately
description: Optionally share your function app name.

- type: textarea
id: additional-info
attributes:
label: Additional Information
description: Add any other information about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/deferred_bindings_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Worker Deferred Bindings Feature Request
name: Python Worker Deferred Bindings Bug Report
description: File a Deferred Bindings bug report
title: "[Bug] Bug Title Here"
labels: ["python", "bug", "deferred-bindings"]
Expand Down
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Python Worker Feature Request
description: File a feature report
title: "Request a feature"
labels: ["python", "feature"]
body:
- type: markdown
attributes:
value: |
This form will help you to fill in a feature request for the Azure Functions Python Worker.
- type: textarea
id: binding-type
attributes:
label: Binding Type
description: Add information about the binding type.
placeholder: Is this on an existing binding or new binding?

- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
placeholder: What should have occurred?

- type: textarea
id: code-snippet
attributes:
label: Relevant sample code snipped
description: Please copy and paste any relevant code snippet of how you want the feature to be used. (This will be automatically formatted into code, so no need for backticks)
render: shell

- type: textarea
id: additional-info
attributes:
label: Additional Information
description: Add any other information about the problem here.
2 changes: 2 additions & 0 deletions .github/Scripts/deferred-bindings-e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/extension_tests/deferred_bindings_tests
4 changes: 1 addition & 3 deletions .github/Scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env bash
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend/test_worker_process_count_functions.py tests/endtoend/test_threadpool_thread_count_functions.py
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append --ignore=tests/endtoend/test_worker_process_count_functions.py --ignore=tests/endtoend/test_threadpool_thread_count_functions.py tests/endtoend
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/extension_tests/deferred_bindings_tests
python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append --ignore=tests/endtoend/test_worker_process_count_functions.py --ignore=tests/endtoend/test_threadpool_thread_count_functions.py tests/endtoend
2 changes: 2 additions & 0 deletions .github/Scripts/fwpc-e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
python -m pytest -q -n 1 --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend/test_worker_process_count_functions.py tests/endtoend/test_threadpool_thread_count_functions.py
31 changes: 20 additions & 11 deletions .github/workflows/ci_e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
# Currently runs FWPC E2E tests, classic E2E tests, and DefBindings E2E tests.
# To run tests from another script, add the script name to this matrix
test-type: [fwpc-e2e-tests, e2e-tests, deferred-bindings-e2e-tests]
permissions: read-all
steps:
- name: Checkout code.
Expand Down Expand Up @@ -75,8 +78,9 @@ jobs:
retry 5 python setup.py extension
mkdir logs
- name: Grant execute permission
run: chmod +x .github/Scripts/e2e-tests.sh
- name: Running 3.7 Tests
run: |
chmod +x .github/Scripts/${{ matrix.test-type }}.sh
- name: Running 3.7 ${{ matrix.test-type }}
if: matrix.python-version == 3.7
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
Expand All @@ -87,8 +91,9 @@ jobs:
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }}
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }}
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
run: .github/Scripts/e2e-tests.sh
- name: Running 3.8 Tests
run: |
.github/Scripts/${{ matrix.test-type }}.sh
- name: Running 3.8 ${{ matrix.test-type }}
if: matrix.python-version == 3.8
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
Expand All @@ -99,8 +104,9 @@ jobs:
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }}
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }}
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
run: .github/Scripts/e2e-tests.sh
- name: Running 3.9 Tests
run: |
.github/Scripts/${{ matrix.test-type }}.sh
- name: Running 3.9 ${{ matrix.test-type }}
if: matrix.python-version == 3.9
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
Expand All @@ -111,8 +117,9 @@ jobs:
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }}
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }}
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
run: .github/Scripts/e2e-tests.sh
- name: Running 3.10 Tests
run: |
.github/Scripts/${{ matrix.test-type }}.sh
- name: Running 3.10 ${{ matrix.test-type }}
if: matrix.python-version == 3.10
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
Expand All @@ -123,8 +130,9 @@ jobs:
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }}
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }}
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
run: .github/Scripts/e2e-tests.sh
- name: Running 3.11 Tests
run: |
.github/Scripts/${{ matrix.test-type }}.sh
- name: Running 3.11 ${{ matrix.test-type }}
if: matrix.python-version == 3.11
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
Expand All @@ -135,7 +143,8 @@ jobs:
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString311 }}
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString311 }}
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
run: .github/Scripts/e2e-tests.sh
run: |
.github/Scripts/${{ matrix.test-type }}.sh
- name: Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
9 changes: 5 additions & 4 deletions azure_functions_worker/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ async def _handle__invocation_request(self, request):
invoc_request = request.invocation_request
invocation_id = invoc_request.invocation_id
function_id = invoc_request.function_id
http_v2_enabled = False

# Set the current `invocation_id` to the current task so
# that our logging handler can find it.
Expand Down Expand Up @@ -555,6 +556,10 @@ async def _handle__invocation_request(self, request):

args = {}

http_v2_enabled = self._functions.get_function(function_id) \
.is_http_func and \
HttpV2Registry.http_v2_enabled()

for pb in invoc_request.input_data:
pb_type_info = fi.input_types[pb.name]
if bindings.is_trigger_binding(pb_type_info.binding_name):
Expand All @@ -570,10 +575,6 @@ async def _handle__invocation_request(self, request):
shmem_mgr=self._shmem_mgr,
is_deferred_binding=pb_type_info.deferred_bindings_enabled)

http_v2_enabled = self._functions.get_function(function_id) \
.is_http_func and \
HttpV2Registry.http_v2_enabled()

if http_v2_enabled:
http_request = await http_coordinator.get_http_request_async(
invocation_id)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"azure_functions_worker._thirdparty",
]

INSTALL_REQUIRES = ["azure-functions==1.20.0b1", "python-dateutil~=2.8.2"]
INSTALL_REQUIRES = ["azure-functions==1.20.0b2", "python-dateutil~=2.8.2"]

if sys.version_info[:2] == (3, 7):
INSTALL_REQUIRES.extend(
Expand Down
Loading

0 comments on commit 419d951

Please sign in to comment.