Skip to content

Commit 3baa53b

Browse files
authored
Merge branch 'dev' into hallvictoria/allow-nill-data
2 parents 8cad4fd + 30789ed commit 3baa53b

File tree

24 files changed

+113
-173
lines changed

24 files changed

+113
-173
lines changed

.github/workflows/ci_consumption_workflow.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ name: CI Consumption E2E tests
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
custom_image:
10+
description: "Use a custom image to run consumption tests"
11+
required: false
812
push:
9-
branches: [ dev, master, main, release/* ]
13+
branches: [ dev, main, release/* ]
1014
pull_request:
11-
branches: [ dev, master, main, release/* ]
15+
branches: [ dev, main, release/* ]
1216

1317
jobs:
1418
build:
@@ -35,24 +39,29 @@ jobs:
3539
if: matrix.python-version == 3.7
3640
env:
3741
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
42+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
3843
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
3944
- name: Running 3.8 Tests
4045
if: matrix.python-version == 3.8
4146
env:
4247
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
48+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
4349
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
4450
- name: Running 3.9 Tests
4551
if: matrix.python-version == 3.9
4652
env:
4753
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
54+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
4855
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
4956
- name: Running 3.10 Tests
5057
if: matrix.python-version == 3.10
5158
env:
5259
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
60+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
5361
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
5462
- name: Running 3.11 Tests
5563
if: matrix.python-version == 3.11
5664
env:
5765
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
66+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
5867
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests

.github/workflows/ci_docker_con_workflow.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: CI Docker Consumption tests
55
on:
66
workflow_dispatch:
77
schedule:
8-
# Monday to Thursday 2 AM PDT build
9-
# * is a special character in YAML so you have to quote this string
10-
- cron: "0 9 * * *"
8+
# Run everyday at 5 AM CST
9+
- cron: "0 10 * * *"
1110

1211
jobs:
1312
build:
@@ -30,7 +29,6 @@ jobs:
3029
python-version: ${{ matrix.python-version }}
3130
- name: Install dependencies
3231
run: |
33-
python -m pip install -U -e .[dev]
3432
python setup.py build
3533
- name: Running 3.7 Tests
3634
if: matrix.python-version == 3.7

.github/workflows/ci_docker_custom_workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python-version: ${{ env.python_version }}
5050
- name: Install dependencies
5151
run: |
52-
python -m pip install -U -e .[dev]
52+
python setup.py build
5353
- name: Running 3.7 Tests
5454
if: env.python_version == 3.7
5555
env:

.github/workflows/ci_docker_ded_workflow.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: CI Docker Dedicated tests
55
on:
66
workflow_dispatch:
77
schedule:
8-
# Monday to Thursday 1 AM PDT build
9-
# * is a special character in YAML so you have to quote this string
10-
- cron: "0 8 * * *"
8+
# Run everyday at 4 AM CST
9+
- cron: "0 9 * * *"
1110

1211
jobs:
1312
build:
@@ -30,7 +29,6 @@ jobs:
3029
python-version: ${{ matrix.python-version }}
3130
- name: Install dependencies
3231
run: |
33-
python -m pip install -U -e .[dev]
3432
python setup.py build
3533
- name: Running 3.7 Tests
3634
if: matrix.python-version == 3.7

.github/workflows/ci_e2e_workflow.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111
required: false
1212
default: "false"
1313
push:
14-
branches: [dev, master, main, release/*]
14+
branches: [dev, main, release/*]
1515
pull_request:
16-
branches: [dev, master, main, release/*]
16+
branches: [dev, main, release/*]
1717
schedule:
18-
# Monday to Thursday 1 AM PDT build
18+
# Monday to Thursday 3 AM CST build
1919
# * is a special character in YAML so you have to quote this string
2020
- cron: "0 8 * * 1,2,3,4"
2121

@@ -35,10 +35,6 @@ jobs:
3535
uses: actions/setup-python@v5
3636
with:
3737
python-version: ${{ matrix.python-version }}
38-
- name: Set up Dotnet 6.x
39-
uses: actions/setup-dotnet@v4
40-
with:
41-
dotnet-version: "6.x"
4238
- name: Set up Dotnet 8.0.x
4339
uses: actions/setup-dotnet@v4
4440
with:

.github/workflows/ci_ut_workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ on:
1111
required: false
1212
default: "false"
1313
schedule:
14-
# Monday to Thursday 1 AM PDT build
14+
# Monday to Thursday 3 AM CST build
1515
# * is a special character in YAML so you have to quote this string
1616
- cron: "0 8 * * 1,2,3,4"
1717
push:
1818
pull_request:
19-
branches: [ dev, master, main, release/* ]
19+
branches: [ dev, main, release/* ]
2020

2121
jobs:
2222
build:
@@ -63,6 +63,7 @@ jobs:
6363
# Retry a couple times to avoid certificate issue
6464
retry 5 python setup.py build
6565
retry 5 python setup.py webhost --branch-name=dev
66+
retry 5 python setup.py extension
6667
mkdir logs
6768
- name: Test with pytest
6869
env:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ What are the supported Python versions?
1515
|----------------------------------|------------|------------|------------|------------|-------------|-------------|
1616
| Azure Functions 2.0 (deprecated) ||| - | - | - | - |
1717
| Azure Functions 3.0 (deprecated) ||||| - | - |
18-
| Azure Functions 4.0 | - | |||| coming soon |
18+
| Azure Functions 4.0 | - | - |||| |
1919

2020
For information about Azure Functions Runtime, please refer to [Azure Functions runtime versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions) page.
2121

tests/endtoend/eventhub_batch_functions/eventhub_batch_functions_stein/function_app.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
connection="AzureWebJobsEventHubConnectionString",
1919
data_type="string",
2020
cardinality="many")
21-
@app.table_output(arg_name="$return",
22-
connection="AzureWebJobsStorage",
23-
table_name="EventHubBatchTest")
24-
def eventhub_multiple(events):
21+
@app.blob_output(arg_name="$return",
22+
path="python-worker-tests/test-eventhub-batch-triggered.txt",
23+
connection="AzureWebJobsStorage")
24+
def eventhub_multiple(events) -> str:
2525
table_entries = []
2626
for event in events:
2727
json_entry = event.get_body()
@@ -46,13 +46,12 @@ def eventhub_output_batch(req: func.HttpRequest, out: func.Out[str]) -> str:
4646

4747
# Retrieve the event data from storage blob and return it as Http response
4848
@app.function_name(name="get_eventhub_batch_triggered")
49-
@app.route(route="get_eventhub_batch_triggered/{id}")
50-
@app.table_input(arg_name="testEntities",
51-
connection="AzureWebJobsStorage",
52-
table_name="EventHubBatchTest",
53-
partition_key="{id}")
54-
def get_eventhub_batch_triggered(req: func.HttpRequest, testEntities):
55-
return func.HttpResponse(status_code=200, body=testEntities)
49+
@app.route(route="get_eventhub_batch_triggered")
50+
@app.blob_input(arg_name="testEntities",
51+
path="python-worker-tests/test-eventhub-batch-triggered.txt",
52+
connection="AzureWebJobsStorage")
53+
def get_eventhub_batch_triggered(req: func.HttpRequest, testEntities: func.InputStream):
54+
return func.HttpResponse(status_code=200, body=testEntities.read().decode('utf-8'))
5655

5756

5857
# Retrieve the event data from storage blob and return it as Http response

tests/endtoend/eventhub_batch_functions/eventhub_multiple/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# This is an actual EventHub trigger which handles Eventhub events in batches.
77
# It serializes multiple event data into a json and store it into a blob.
8-
def main(events):
8+
def main(events) -> str:
99
table_entries = []
1010
for event in events:
1111
json_entry = event.get_body()

tests/endtoend/eventhub_batch_functions/eventhub_multiple/function.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
},
1414
{
1515
"direction": "out",
16-
"type": "table",
16+
"type": "blob",
1717
"name": "$return",
18-
"tableName": "EventHubBatchTest",
18+
"path": "python-worker-tests/test-eventhub-batch-triggered.txt",
1919
"connection": "AzureWebJobsStorage"
2020
}
2121
]

tests/endtoend/eventhub_batch_functions/get_eventhub_batch_triggered/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55

66
# Retrieve the event data from storage blob and return it as Http response
7-
def main(req: func.HttpRequest, testEntities):
8-
return func.HttpResponse(status_code=200, body=testEntities)
7+
def main(req: func.HttpRequest, testEntities: func.InputStream):
8+
return func.HttpResponse(status_code=200, body=testEntities.read().decode('utf-8'))

tests/endtoend/eventhub_batch_functions/get_eventhub_batch_triggered/function.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
},
1313
{
1414
"direction": "in",
15-
"type": "table",
15+
"type": "blob",
1616
"name": "testEntities",
17-
"partitionKey": "WillBePopulated",
18-
"tableName": "EventHubBatchTest",
17+
"path": "python-worker-tests/test-eventhub-batch-triggered.txt",
1918
"connection": "AzureWebJobsStorage"
2019
},
2120
{

tests/endtoend/table_functions/table_functions_stein/function_app.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
row_key='{id}',
1616
partition_key="test")
1717
def table_in_binding(req: func.HttpRequest, testEntity):
18-
headers_dict = json.loads(testEntity)
19-
return func.HttpResponse(status_code=200, headers=headers_dict)
18+
return func.HttpResponse(status_code=200, body=testEntity)
2019

2120

2221
@app.function_name(name="table_out_binding")
@@ -28,6 +27,5 @@ def table_out_binding(req: func.HttpRequest, resp: func.Out[func.HttpResponse]):
2827
row_key_uuid = str(uuid.uuid4())
2928
table_dict = {'PartitionKey': 'test', 'RowKey': row_key_uuid}
3029
table_json = json.dumps(table_dict)
31-
http_resp = func.HttpResponse(status_code=200, headers=table_dict)
32-
resp.set(http_resp)
30+
resp.set(table_json)
3331
return table_json

tests/endtoend/table_functions/table_functions_stein/generic/function_app.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
row_key="{id}",
2020
partition_key="test")
2121
def table_in_binding(req: func.HttpRequest, testEntity):
22-
headers_dict = json.loads(testEntity)
23-
return func.HttpResponse(status_code=200, headers=headers_dict)
22+
return func.HttpResponse(status_code=200, body=testEntity)
2423

2524

2625
@app.function_name(name="table_out_binding")
@@ -36,6 +35,5 @@ def table_out_binding(req: func.HttpRequest, resp: func.Out[func.HttpResponse]):
3635
row_key_uuid = str(uuid.uuid4())
3736
table_dict = {'PartitionKey': 'test', 'RowKey': row_key_uuid}
3837
table_json = json.dumps(table_dict)
39-
http_resp = func.HttpResponse(status_code=200, headers=table_dict)
40-
resp.set(http_resp)
38+
resp.set(table_json)
4139
return table_json
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
import json
4-
53
import azure.functions as func
64

75

86
def main(req: func.HttpRequest, testEntity):
9-
headers_dict = json.loads(testEntity)
10-
return func.HttpResponse(status_code=200, headers=headers_dict)
7+
return func.HttpResponse(status_code=200, body=testEntity)

tests/endtoend/table_functions/table_out_binding/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ def main(req: func.HttpRequest, resp: func.Out[func.HttpResponse]):
1010
row_key_uuid = str(uuid.uuid4())
1111
table_dict = {'PartitionKey': 'test', 'RowKey': row_key_uuid}
1212
table_json = json.dumps(table_dict)
13-
http_resp = func.HttpResponse(status_code=200, headers=table_dict)
14-
resp.set(http_resp)
13+
resp.set(table_json)
1514
return table_json

0 commit comments

Comments
 (0)