Skip to content

Commit 11e9ed9

Browse files
author
Victoria Hall
committed
logging test and async httpv2 changes
1 parent df8855f commit 11e9ed9

File tree

8 files changed

+17
-206
lines changed

8 files changed

+17
-206
lines changed

eng/ci/official-build.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ extends:
4343
- stage: Build
4444
jobs:
4545
- template: /eng/templates/official/jobs/build-artifacts.yml@self
46-
- stage: RunAllE2ETests
47-
dependsOn: Build
48-
jobs:
49-
- template: /eng/templates/official/jobs/ci-all-e2e-tests.yml@self
46+
5047
- stage: RunE2ETests
5148
dependsOn: Build
5249
jobs:

eng/templates/official/jobs/ci-all-e2e-tests.yml

-56
This file was deleted.

eng/templates/official/jobs/ci-consumption-tests.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
jobs:
22
- job: "TestPython"
3-
displayName: "Run Python Linux Consumption Tests"
3+
displayName: "Run Python Docker Consumption Tests"
44

55
pool:
66
name: 1es-pool-azfunc
77
image: 1es-ubuntu-22.04
88
os: linux
99

1010
strategy:
11-
maxParallel: 1
1211
matrix:
1312
Python37:
1413
PYTHON_VERSION: '3.7'
@@ -61,7 +60,7 @@ jobs:
6160
inputs:
6261
versionSpec: $(PYTHON_VERSION)
6362
- bash: |
64-
python .\setup.py build
63+
python setup.py build
6564
displayName: 'Install dependencies'
6665
- bash: |
6766
python -m pytest --reruns 4 -vv --instafail tests/endtoend

eng/templates/official/jobs/ci-dedicated-tests.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
jobs:
22
- job: "TestPython"
3-
displayName: "Run Python Linux Consumption Tests"
3+
displayName: "Run Python Docker Dedicated Tests"
44

55
pool:
66
name: 1es-pool-azfunc
77
image: 1es-ubuntu-22.04
88
os: linux
99

1010
strategy:
11-
maxParallel: 1
1211
matrix:
1312
Python37:
1413
PYTHON_VERSION: '3.7'
@@ -61,7 +60,7 @@ jobs:
6160
inputs:
6261
versionSpec: $(PYTHON_VERSION)
6362
- bash: |
64-
python .\setup.py build
63+
python setup.py build
6564
displayName: 'Install dependencies'
6665
- bash: |
6766
python -m pytest --reruns 4 -vv --instafail tests/endtoend

eng/templates/official/jobs/ci-e2e-tests.yml

+7-130
Original file line numberDiff line numberDiff line change
@@ -9,163 +9,44 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
python-37-fwpc:
12+
Python37:
1313
PYTHON_VERSION: '3.7'
14-
TEST_TYPE: 'fwpc-e2e-tests'
1514
STORAGE_CONNECTION: $(LinuxStorageConnectionString37)
1615
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString37)
1716
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString37)
1817
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString37)
1918
SQL_CONNECTION: $(LinuxSqlConnectionString37)
2019
EVENTGRID_URI: $(LinuxEventGridTopicUriString37)
2120
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString37)
22-
python-37-e2e:
23-
PYTHON_VERSION: '3.7'
24-
SIMPLIFIED_PYTHON_VERSION: '37'
25-
TEST_TYPE: 'e2e-tests'
26-
STORAGE_CONNECTION: $(LinuxStorageConnectionString37)
27-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString37)
28-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString37)
29-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString37)
30-
SQL_CONNECTION: $(LinuxSqlConnectionString37)
31-
EVENTGRID_URI: $(LinuxEventGridTopicUriString37)
32-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString37)
33-
python-37-deferred-bindings:
34-
PYTHON_VERSION: '3.7'
35-
SIMPLIFIED_PYTHON_VERSION: '37'
36-
TEST_TYPE: 'deferred-bindings-e2e-tests'
37-
STORAGE_CONNECTION: $(LinuxStorageConnectionString37)
38-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString37)
39-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString37)
40-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString37)
41-
SQL_CONNECTION: $(LinuxSqlConnectionString37)
42-
EVENTGRID_URI: $(LinuxEventGridTopicUriString37)
43-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString37)
44-
python-38-fwpc:
21+
Python38:
4522
PYTHON_VERSION: '3.8'
46-
SIMPLIFIED_PYTHON_VERSION: '38'
47-
TEST_TYPE: 'fwpc-e2e-tests'
4823
STORAGE_CONNECTION: $(LinuxStorageConnectionString38)
4924
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString38)
5025
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString38)
5126
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString38)
5227
SQL_CONNECTION: $(LinuxSqlConnectionString38)
5328
EVENTGRID_URI: $(LinuxEventGridTopicUriString38)
5429
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString38)
55-
python-38-e2e:
56-
PYTHON_VERSION: '3.8'
57-
SIMPLIFIED_PYTHON_VERSION: '38'
58-
TEST_TYPE: 'e2e-tests'
59-
STORAGE_CONNECTION: $(LinuxStorageConnectionString38)
60-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString38)
61-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString38)
62-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString38)
63-
SQL_CONNECTION: $(LinuxSqlConnectionString38)
64-
EVENTGRID_URI: $(LinuxEventGridTopicUriString38)
65-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString38)
66-
python-38-deferred-bindings:
67-
PYTHON_VERSION: '3.8'
68-
SIMPLIFIED_PYTHON_VERSION: '38'
69-
TEST_TYPE: 'deferred-bindings-e2e-tests'
70-
STORAGE_CONNECTION: $(LinuxStorageConnectionString38)
71-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString38)
72-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString38)
73-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString38)
74-
SQL_CONNECTION: $(LinuxSqlConnectionString38)
75-
EVENTGRID_URI: $(LinuxEventGridTopicUriString38)
76-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString38)
77-
python-39-fwpc:
78-
PYTHON_VERSION: '3.9'
79-
SIMPLIFIED_PYTHON_VERSION: '39'
80-
TEST_TYPE: 'fwpc-e2e-tests'
81-
STORAGE_CONNECTION: $(LinuxStorageConnectionString39)
82-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString39)
83-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString39)
84-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString39)
85-
SQL_CONNECTION: $(LinuxSqlConnectionString39)
86-
EVENTGRID_URI: $(LinuxEventGridTopicUriString39)
87-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString39)
88-
python-39-e2e:
30+
Python39:
8931
PYTHON_VERSION: '3.9'
90-
SIMPLIFIED_PYTHON_VERSION: '39'
91-
TEST_TYPE: 'e2e-tests'
9232
STORAGE_CONNECTION: $(LinuxStorageConnectionString39)
9333
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString39)
9434
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString39)
9535
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString39)
9636
SQL_CONNECTION: $(LinuxSqlConnectionString39)
9737
EVENTGRID_URI: $(LinuxEventGridTopicUriString39)
9838
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString39)
99-
python-39-deferred-bindings:
100-
PYTHON_VERSION: '3.9'
101-
SIMPLIFIED_PYTHON_VERSION: '39'
102-
TEST_TYPE: 'deferred-bindings-e2e-tests'
103-
STORAGE_CONNECTION: $(LinuxStorageConnectionString39)
104-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString39)
105-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString39)
106-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString39)
107-
SQL_CONNECTION: $(LinuxSqlConnectionString39)
108-
EVENTGRID_URI: $(LinuxEventGridTopicUriString39)
109-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString39)
110-
python-310-fwpc:
111-
PYTHON_VERSION: '3.10'
112-
SIMPLIFIED_PYTHON_VERSION: '310'
113-
TEST_TYPE: 'fwpc-e2e-tests'
114-
STORAGE_CONNECTION: $(LinuxStorageConnectionString310)
115-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString310)
116-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString310)
117-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString310)
118-
SQL_CONNECTION: $(LinuxSqlConnectionString310)
119-
EVENTGRID_URI: $(LinuxEventGridTopicUriString310)
120-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString310)
121-
python-310-e2e:
122-
PYTHON_VERSION: '3.10'
123-
SIMPLIFIED_PYTHON_VERSION: '310'
124-
TEST_TYPE: 'e2e-tests'
125-
STORAGE_CONNECTION: $(LinuxStorageConnectionString310)
126-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString310)
127-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString310)
128-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString310)
129-
SQL_CONNECTION: $(LinuxSqlConnectionString310)
130-
EVENTGRID_URI: $(LinuxEventGridTopicUriString310)
131-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString310)
132-
python-310-deferred-bindings:
39+
Python310:
13340
PYTHON_VERSION: '3.10'
134-
SIMPLIFIED_PYTHON_VERSION: '310'
135-
TEST_TYPE: 'deferred-bindings-e2e-tests'
13641
STORAGE_CONNECTION: $(LinuxStorageConnectionString310)
13742
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString310)
13843
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString310)
13944
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString310)
14045
SQL_CONNECTION: $(LinuxSqlConnectionString310)
14146
EVENTGRID_URI: $(LinuxEventGridTopicUriString310)
14247
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString310)
143-
python-311-fwpc:
144-
PYTHON_VERSION: '3.11'
145-
SIMPLIFIED_PYTHON_VERSION: '311'
146-
TEST_TYPE: 'fwpc-e2e-tests'
147-
STORAGE_CONNECTION: $(LinuxStorageConnectionString311)
148-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString311)
149-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString311)
150-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString311)
151-
SQL_CONNECTION: $(LinuxSqlConnectionString311)
152-
EVENTGRID_URI: $(LinuxEventGridTopicUriString311)
153-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString311)
154-
python-311-e2e:
155-
PYTHON_VERSION: '3.11'
156-
SIMPLIFIED_PYTHON_VERSION: '311'
157-
TEST_TYPE: 'e2e-tests'
158-
STORAGE_CONNECTION: $(LinuxStorageConnectionString311)
159-
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString311)
160-
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString311)
161-
SERVICEBUS_CONNECTION: $(LinuxServiceBusConnectionString311)
162-
SQL_CONNECTION: $(LinuxSqlConnectionString311)
163-
EVENTGRID_URI: $(LinuxEventGridTopicUriString311)
164-
EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString311)
165-
python-311-deferred-bindings:
48+
Python311:
16649
PYTHON_VERSION: '3.11'
167-
SIMPLIFIED_PYTHON_VERSION: '311'
168-
TEST_TYPE: 'deferred-bindings-e2e-tests'
16950
STORAGE_CONNECTION: $(LinuxStorageConnectionString311)
17051
COSMOSDB_CONNECTION: $(LinuxCosmosDBConnectionString311)
17152
EVENTHUB_CONNECTION: $(LinuxEventHubConnectionString311)
@@ -199,11 +80,7 @@ jobs:
19980
mkdir logs
20081
displayName: 'Install dependencies and the worker'
20182
- bash: |
202-
chmod +x .github/Scripts/$(TEST_TYPE).sh
203-
displayName: 'Grant execute permission'
204-
205-
- bash: |
206-
.github/Scripts/$(TEST_TYPE).sh
83+
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
20784
env:
20885
AzureWebJobsStorage: $(STORAGE_CONNECTION)
20986
AzureWebJobsCosmosDBConnectionString: $(COSMOSDB_CONNECTION)
@@ -212,4 +89,4 @@ jobs:
21289
AzureWebJobsSqlConnectionString: $(SQL_CONNECTION)
21390
AzureWebJobsEventGridTopicUri: $(EVENTGRID_URI)
21491
AzureWebJobsEventGridConnectionKey: $(EVENTGRID_CONNECTION)
215-
displayName: "Running $(PYTHON_VERSION) $(TEST_TYPE) tests"
92+
displayName: "Running $(PYTHON_VERSION)"

eng/templates/official/jobs/ci-lc-tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
os: linux
99

1010
strategy:
11-
maxParallel: 1
1211
matrix:
1312
Python37:
1413
PYTHON_VERSION: '3.7'
@@ -73,7 +72,7 @@ jobs:
7372
fi
7473
7574
# Retry a couple times to avoid certificate issue
76-
retry 5 python .\setup.py build
75+
python setup.py build
7776
displayName: 'Install dependencies and the worker'
7877
- bash: |
7978
python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests

tests/unittests/http_functions/http_v2_functions/fastapi/function_app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def async_return_str(req: Request):
9797

9898

9999
@app.route(route="debug_logging")
100-
def debug_logging(req: Request):
100+
async def debug_logging(req: Request):
101101
logging.critical('logging critical', exc_info=True)
102102
logging.info('logging info', exc_info=True)
103103
logging.warning('logging warning', exc_info=True)
@@ -107,7 +107,7 @@ def debug_logging(req: Request):
107107

108108

109109
@app.route(route="debug_user_logging")
110-
def debug_user_logging(req: Request):
110+
async def debug_user_logging(req: Request):
111111
logger.setLevel(logging.DEBUG)
112112

113113
logging.critical('logging critical', exc_info=True)

tests/unittests/test_logging.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,5 @@ def raising_function():
5656
self.assertIn("call1", processed_exception)
5757
self.assertIn("call2", processed_exception)
5858
self.assertIn("f", processed_exception)
59-
file_path_present = False
60-
for line in processed_exception:
61-
if "tests/unittests/test_logging.py" in line:
62-
file_path_present = True
63-
break
64-
self.assertTrue(file_path_present)
59+
self.assertRegex(processed_exception,
60+
r".*tests\\unittests\\test_logging.py.*")

0 commit comments

Comments
 (0)