Skip to content

Commit 4849b3d

Browse files
authored
Merge branch 'dev' into sdk/1.12.0
2 parents c76fe9f + 749bfb4 commit 4849b3d

File tree

10 files changed

+26
-88
lines changed

10 files changed

+26
-88
lines changed

.ci/e2e_integration_test/pipeline.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pool:
1111

1212
variables:
1313
DOTNET_VERSION: '3.1.x'
14-
DOTNET_VERSION_5: '5.0.x'
1514
DOTNET_VERSION_6: '6.x'
1615
PYTHON_VERSION: '3.9'
1716

@@ -26,11 +25,6 @@ steps:
2625
inputs:
2726
packageType: 'sdk'
2827
version: $(DOTNET_VERSION)
29-
- task: UseDotNet@2
30-
displayName: 'Install DotNet 5'
31-
inputs:
32-
packageType: 'sdk'
33-
version: $(DOTNET_VERSION_5)
3428
- task: UseDotNet@2
3529
displayName: 'Install DotNet 6'
3630
inputs:

.github/workflows/ci_e2e_workflow.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
uses: actions/setup-dotnet@v1
3535
with:
3636
dotnet-version: '3.1.x'
37-
- name: Set up Dotnet 5.0.x
38-
uses: actions/setup-dotnet@v1
39-
with:
40-
dotnet-version: '5.0.x'
4137
- name: Set up Dotnet 6.x
4238
uses: actions/setup-dotnet@v1
4339
with:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ dev, *dev, main*, release* ]
16+
branches: [ dev, v3.x-dev, main*, release* ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ dev ]
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript', 'python' ]
35+
language: [ 'python' ]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

.github/workflows/perf-testing-setup.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ jobs:
2727
uses: actions/setup-dotnet@v1
2828
with:
2929
dotnet-version: '3.1.405'
30-
- name: Set up Dotnet 5.0.x
31-
uses: actions/setup-dotnet@v1
32-
with:
33-
dotnet-version: '5.0.x'
3430
- name: Set up Dotnet 6.x
3531
uses: actions/setup-dotnet@v1
3632
with:

.github/workflows/ut_ci_workflow.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: "Python UT CI Run"
1919
runs-on: ubuntu-latest
2020
strategy:
21-
fail-fast: true
21+
fail-fast: false
2222
matrix:
2323
python-version: [ 3.7, 3.8, 3.9, "3.10" ]
2424
steps:
@@ -31,10 +31,6 @@ jobs:
3131
uses: actions/setup-dotnet@v1
3232
with:
3333
dotnet-version: '3.1.x'
34-
- name: Set up Dotnet 5.0.x
35-
uses: actions/setup-dotnet@v1
36-
with:
37-
dotnet-version: '5.0.x'
3834
- name: Set up Dotnet 6.x
3935
uses: actions/setup-dotnet@v1
4036
with:

azure_functions_worker/dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def _handle__functions_metadata_request(self, request):
314314
try:
315315
fx_metadata_results = []
316316
indexed_functions = loader.index_function_app(function_path)
317-
logger.info('Indexed function app and found {} functions',
317+
logger.info('Indexed function app and found %s functions',
318318
len(indexed_functions))
319319
if indexed_functions:
320320
indexed_function_logs: List[str] = []

azure_functions_worker/testutils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@
8383
</PropertyGroup>
8484
<ItemGroup>
8585
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs"
86-
Version="5.0.0" />
86+
Version="5.1.2.0" />
8787
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid"
88-
Version="3.1.0" />
88+
Version="3.2.0" />
8989
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB"
9090
Version="3.0.10" />
9191
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage"
9292
Version="4.0.5" />
9393
<PackageReference
9494
Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs"
95-
Version="5.0.0" />
95+
Version="5.1.0" />
9696
<PackageReference
9797
Include="Microsoft.Azure.WebJobs.Extensions.Storage.Queues"
98-
Version="5.0.0" />
98+
Version="5.1.0" />
9999
<PackageReference
100100
Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator"
101101
Version="1.1.3" />

tests/unittests/test_code_quality.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class TestCodeQuality(unittest.TestCase):
1313
def test_mypy(self):
1414
try:
1515
import mypy # NoQA
16-
except ImportError:
17-
raise unittest.SkipTest('mypy module is missing')
16+
except ImportError as e:
17+
raise unittest.SkipTest('mypy module is missing') from e
1818

1919
try:
2020
subprocess.run(
@@ -26,16 +26,17 @@ def test_mypy(self):
2626
except subprocess.CalledProcessError as ex:
2727
if (sys.version_info[1] == 7
2828
and sys.version_info[2] == 3):
29-
raise unittest.SkipTest('Subprocess start failing for 3.7.3')
29+
raise unittest.SkipTest('Subprocess start failing for 3.7.3') \
30+
from ex
3031
output = ex.output.decode()
3132
raise AssertionError(
3233
f'mypy validation failed:\n{output}') from None
3334

3435
def test_flake8(self):
3536
try:
3637
import flake8 # NoQA
37-
except ImportError:
38-
raise unittest.SkipTest('flake8 moudule is missing')
38+
except ImportError as e:
39+
raise unittest.SkipTest('flake8 moudule is missing') from e
3940

4041
config_path = ROOT_PATH / '.flake8'
4142
if not config_path.exists():

tests/unittests/test_enable_debug_logging_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def setUpClass(cls):
3434
super().setUpClass()
3535

3636
@classmethod
37-
def tearDownClass(self):
37+
def tearDownClass(cls):
3838
super().tearDownClass()
39-
self._patch_environ.stop()
39+
cls._patch_environ.stop()
4040

4141
@classmethod
4242
def get_script_dir(cls):
@@ -71,9 +71,9 @@ def setUpClass(cls):
7171
super().setUpClass()
7272

7373
@classmethod
74-
def tearDownClass(self):
74+
def tearDownClass(cls):
7575
super().tearDownClass()
76-
self._patch_environ.stop()
76+
cls._patch_environ.stop()
7777

7878
@classmethod
7979
def get_script_dir(cls):
@@ -114,12 +114,12 @@ def setUpClass(cls):
114114
super().setUpClass()
115115

116116
@classmethod
117-
def tearDownClass(self):
118-
host_json = TESTS_ROOT / self.get_script_dir() / 'host.json'
117+
def tearDownClass(cls):
118+
host_json = TESTS_ROOT / cls.get_script_dir() / 'host.json'
119119
remove_path(host_json)
120120

121121
super().tearDownClass()
122-
self._patch_environ.stop()
122+
cls._patch_environ.stop()
123123

124124
@classmethod
125125
def get_script_dir(cls):

tests/unittests/test_utilities_dependency.py

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3+
import importlib.util
34
import os
45
import sys
5-
import importlib.util
66
import unittest
77
from unittest.mock import patch
88

99
from azure_functions_worker import testutils
10-
from azure_functions_worker.utils.common import is_python_version
1110
from azure_functions_worker.utils.dependency import DependencyManager
1211

1312

@@ -555,12 +554,8 @@ def test_use_worker_dependencies_disable(self):
555554
with self.assertRaises(ImportError):
556555
import common_module # NoQA
557556

558-
@unittest.skipUnless(
559-
sys.version_info.major == 3 and sys.version_info.minor != 10,
560-
'Test only available for Python 3.6, 3.7, 3.8 or 3.9'
561-
)
562-
def test_use_worker_dependencies_default_python_36_37_38_39(self):
563-
# Feature should be disabled in Python 3.6, 3.7, 3.8 and 3.9
557+
def test_use_worker_dependencies_default_python_all_versions(self):
558+
# Feature should be disabled for all python versions
564559
# Setup paths
565560
DependencyManager.worker_deps_path = self._worker_deps_path
566561
DependencyManager.cx_deps_path = self._customer_deps_path
@@ -571,25 +566,6 @@ def test_use_worker_dependencies_default_python_36_37_38_39(self):
571566
with self.assertRaises(ImportError):
572567
import common_module # NoQA
573568

574-
@unittest.skipUnless(
575-
sys.version_info.major == 3 and sys.version_info.minor == 10,
576-
'Test only available for Python 3.10'
577-
)
578-
def test_use_worker_dependencies_default_python_310(self):
579-
# Feature should be enabled in Python 3.10 by default
580-
# Setup paths
581-
DependencyManager.worker_deps_path = self._worker_deps_path
582-
DependencyManager.cx_deps_path = self._customer_deps_path
583-
DependencyManager.cx_working_dir = self._customer_func_path
584-
585-
# Ensure the common_module is imported from _worker_deps_path
586-
DependencyManager.use_worker_dependencies()
587-
import common_module # NoQA
588-
self.assertEqual(
589-
common_module.package_location,
590-
os.path.join(self._worker_deps_path, 'common_module')
591-
)
592-
593569
def test_prioritize_customer_dependencies(self):
594570
# Setup app settings
595571
os.environ['PYTHON_ISOLATE_WORKER_DEPENDENCIES'] = 'true'
@@ -628,10 +604,8 @@ def test_prioritize_customer_dependencies_disable(self):
628604
with self.assertRaises(ImportError):
629605
import common_module # NoQA
630606

631-
@unittest.skipIf(is_python_version('3.10'),
632-
'Test not available for python 3.10')
633-
def test_prioritize_customer_dependencies_default_python_36_37_38_39(self):
634-
# Feature should be disabled in Python 3.6, 3.7, 3.8 and 3.9
607+
def test_prioritize_customer_dependencies_default_all_versions(self):
608+
# Feature should be disabled in Python for all versions
635609
# Setup paths
636610
DependencyManager.worker_deps_path = self._worker_deps_path
637611
DependencyManager.cx_deps_path = self._customer_deps_path
@@ -642,25 +616,6 @@ def test_prioritize_customer_dependencies_default_python_36_37_38_39(self):
642616
with self.assertRaises(ImportError):
643617
import common_module # NoQA
644618

645-
@unittest.skipUnless(
646-
sys.version_info.major == 3 and sys.version_info.minor == 10,
647-
'Test only available for Python 3.10'
648-
)
649-
def test_prioritize_customer_dependencies_default_python_310(self):
650-
# Feature should be enabled in Python 3.10 by default
651-
# Setup paths
652-
DependencyManager.worker_deps_path = self._worker_deps_path
653-
DependencyManager.cx_deps_path = self._customer_deps_path
654-
DependencyManager.cx_working_dir = self._customer_func_path
655-
656-
# Ensure the common_module is imported from _customer_deps_path
657-
DependencyManager.prioritize_customer_dependencies()
658-
import common_module # NoQA
659-
self.assertEqual(
660-
common_module.package_location,
661-
os.path.join(self._customer_deps_path, 'common_module')
662-
)
663-
664619
def test_prioritize_customer_dependencies_from_working_directory(self):
665620
self._initialize_scenario()
666621

0 commit comments

Comments
 (0)