Skip to content

Commit e5bde46

Browse files
committed
Running tests in parallel
1 parent 28e5fdb commit e5bde46

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

.github/workflows/ci_e2e_workflow.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString36 }}
7777
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString36 }}
7878
run: |
79-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
79+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
8080
- name: Running 3.7 Tests
8181
if: matrix.python-version == 3.7
8282
env:
@@ -88,7 +88,7 @@ jobs:
8888
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }}
8989
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }}
9090
run: |
91-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
91+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
9292
- name: Running 3.8 Tests
9393
if: matrix.python-version == 3.8
9494
env:
@@ -100,7 +100,7 @@ jobs:
100100
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }}
101101
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }}
102102
run: |
103-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
103+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
104104
- name: Running 3.9 Tests
105105
if: matrix.python-version == 3.9
106106
env:
@@ -112,7 +112,7 @@ jobs:
112112
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }}
113113
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }}
114114
run: |
115-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
115+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
116116
- name: Running 3.10 Tests
117117
if: matrix.python-version == 3.10
118118
env:
@@ -124,7 +124,7 @@ jobs:
124124
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }}
125125
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }}
126126
run: |
127-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
127+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
128128
- name: Codecov
129129
uses: codecov/[email protected]
130130
with:

.github/workflows/ogf_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Install node and npm
8282
uses: actions/setup-node@v2
8383
with:
84-
node-version: '12'
84+
node-version: '16'
8585
check-latest: true
8686

8787
- name: Azure Login

.github/workflows/ut_ci_workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ jobs:
6464
retry 5 python setup.py extension
6565
- name: Test with pytest
6666
env:
67-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
67+
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} # needed for installing azure-functions-durable while running setup.py
6868
run: |
69-
python -m pytest --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests
69+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests
7070
- name: Codecov
7171
uses: codecov/[email protected]
7272
with:

tests/unittests/test_enable_debug_logging_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55
from unittest.mock import patch
66

7+
import pytest
8+
79
from tests.utils import testutils
810
from azure_functions_worker.constants import PYTHON_ENABLE_DEBUG_LOGGING
911
from tests.utils.testutils import TESTS_ROOT, remove_path
@@ -42,6 +44,7 @@ def tearDownClass(cls):
4244
def get_script_dir(cls):
4345
return testutils.UNIT_TESTS_FOLDER / 'log_filtering_functions'
4446

47+
@pytest.mark.flaky(reruns=3)
4548
def test_debug_logging_enabled(self):
4649
"""
4750
Verify when cx debug logging is enabled, cx function debug logs

tests/unittests/test_http_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def check_log_debug_logging(self, host_out: typing.List[str]):
111111
self.assertIn('logging error', host_out)
112112
self.assertNotIn('logging debug', host_out)
113113

114+
@pytest.mark.flaky(reruns=3)
114115
def test_debug_with_user_logging(self):
115116
r = self.webhost.request('GET', 'debug_user_logging')
116117
self.assertEqual(r.status_code, 200)
@@ -306,6 +307,7 @@ def test_application_octet_stream_content_type(self):
306307
if (os.path.exists(received_img_file)):
307308
os.remove(received_img_file)
308309

310+
@pytest.mark.flaky(reruns=3)
309311
def test_user_event_loop_error(self):
310312
# User event loop is not supported in HTTP trigger
311313
r = self.webhost.request('GET', 'user_event_loop/')

tests/unittests/test_log_filtering_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Licensed under the MIT License.
33
import typing
44

5+
import pytest
6+
57
from tests.utils import testutils
68

79
HOST_JSON_TEMPLATE_WITH_LOGLEVEL_INFO = """\
@@ -60,6 +62,7 @@ def check_log_debug_logging(self, host_out: typing.List[str]):
6062
# See HOST_JSON_TEMPLATE_WITH_LOGLEVEL_INFO, debug log is disabled
6163
self.assertNotIn('logging debug', host_out)
6264

65+
@pytest.mark.flaky(reruns=3)
6366
def test_debug_with_user_logging(self):
6467
r = self.webhost.request('GET', 'debug_user_logging')
6568
self.assertEqual(r.status_code, 200)

tests/unittests/test_third_party_http_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def tearDownClass(cls):
5353
def get_script_dir(cls):
5454
pass
5555

56+
@pytest.mark.flaky(reruns=3)
5657
def test_debug_logging(self):
5758
r = self.webhost.request('GET', 'debug_logging', no_prefix=True)
5859
self.assertEqual(r.status_code, 200)
@@ -64,6 +65,7 @@ def check_log_debug_logging(self, host_out: typing.List[str]):
6465
self.assertIn('logging error', host_out)
6566
self.assertNotIn('logging debug', host_out)
6667

68+
@pytest.mark.flaky(reruns=3)
6769
def test_debug_with_user_logging(self):
6870
r = self.webhost.request('GET', 'debug_user_logging',
6971
no_prefix=True)

0 commit comments

Comments
 (0)