Skip to content
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

fix: remove masking E2E test failures #1483

Merged
merged 32 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1305ed8
removed script, fail fwpc tests
hallvictoria Apr 18, 2024
656a404
Merge branch 'dev' into hallvictoria/e2e-test-fix
hallvictoria Apr 18, 2024
723217d
removed failure
hallvictoria Apr 18, 2024
935d482
just fwpc and tptc tests
hallvictoria Apr 18, 2024
9abfa84
fwpc tests from script
hallvictoria Apr 18, 2024
47b42ef
two scripts
hallvictoria Apr 18, 2024
bc35881
worker config
Apr 22, 2024
18b9dc2
debug logging test
Apr 22, 2024
55fc46d
pop env vars for fwpc and tptc
Apr 22, 2024
a616373
blueprint tests
Apr 22, 2024
e3417b7
newrelic piwd test
Apr 22, 2024
793397b
increased retries
Apr 22, 2024
38d145a
increased retries
Apr 22, 2024
a7b06be
registry flaky test
Apr 22, 2024
4f2c722
issue / feature request templates
Apr 22, 2024
e5c528f
Merge branch 'dev' into hallvictoria/e2e-test-fix
hallvictoria Apr 23, 2024
a24dd70
typo
hallvictoria Apr 23, 2024
7e3d80f
formatting
hallvictoria Apr 23, 2024
e4cc43a
except JSONDecodeError for retries
hallvictoria Apr 23, 2024
7832224
removed instafail
Apr 24, 2024
b558b65
Merge branch 'dev' into hallvictoria/e2e-test-fix
hallvictoria May 1, 2024
13bcb6d
separate job for each test script
May 8, 2024
67eb84d
removed apostrophes
May 8, 2024
3e53754
fixed matrix
May 8, 2024
17270dc
3.7 & 3.8 db tests
May 8, 2024
7b34a3d
if cond validation
May 8, 2024
d616168
Matrix test types
hallvictoria May 13, 2024
c534201
fixed permissions
hallvictoria May 13, 2024
ba0b473
feedback
hallvictoria May 13, 2024
a6d990f
Merge branch 'dev' into hallvictoria/e2e-test-fix
hallvictoria May 14, 2024
37e7267
checked in permissions
May 15, 2024
206b28e
permissions + single file
May 15, 2024
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
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.
hallvictoria marked this conversation as resolved.
Show resolved Hide resolved
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: |
hallvictoria marked this conversation as resolved.
Show resolved Hide resolved
.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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import logging
import time
from datetime import datetime

import azure.functions as func

bp = func.Blueprint()


@bp.route(route="default_template")
def default_template(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')

name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')

if name:
return func.HttpResponse(
f"Hello, {name}. This HTTP triggered function "
f"executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. "
"Pass a name in the query string or in the request body for a"
" personalized response.",
status_code=200
)


@bp.route(route="http_func")
def http_func(req: func.HttpRequest) -> func.HttpResponse:
time.sleep(1)

current_time = datetime.now().strftime("%H:%M:%S")
return func.HttpResponse(f"{current_time}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import azure.functions as func
from blueprint_directory.blueprint import bp

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

app.register_functions(bp)
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,16 @@ def return_not_processed_last(req: func.HttpRequest, testEntities):
table_name="EventHubBatchTest")
def mytimer(mytimer: func.TimerRequest, testEntity) -> None:
logging.info("This timer trigger function executed successfully")


@app.function_name(name="mytimer2")
@app.schedule(schedule="*/1 * * * * *", arg_name="mytimer",
run_on_startup=False,
use_monitor=False)
@app.generic_input_binding(
arg_name="testEntity",
type="table",
connection="AzureWebJobsStorage",
table_name="EventHubBatchTest")
def mytimer2(mytimer: func.TimerRequest, testEntity):
logging.info("Timer trigger with none return and no type hint")
Loading
Loading