Skip to content

Commit 30789ed

Browse files
Docker tests updates (#1457)
* Docker tests updates * Fixed consumption custom image if empty * Updated extension csproj to use .net8 * Update extensions to include System.Drawing.Common * Update extensions to include System.Text.Json * Added table extension * table & eh, unit, lint * eh test * lint --------- Co-authored-by: hallvictoria <victoriahall@microsoft.com>
1 parent 4c8fb7b commit 30789ed

File tree

24 files changed

+113
-173
lines changed

24 files changed

+113
-173
lines changed

.github/workflows/ci_consumption_workflow.yml

Lines changed: 11 additions & 2 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 3 additions & 7 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 11 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
]

0 commit comments

Comments
 (0)