Skip to content

Commit c6becc5

Browse files
authored
Update extensions to the latest version (#649)
Remove system log checking because not generated by user Skip .sh shell when running on windows
1 parent 7c9bcc4 commit c6becc5

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
# TODO: change this to something more stable when available.
2020
WEBHOST_URL = ('https://ci.appveyor.com/api/buildjobs/19gqd7drpxhkedea'
21-
'/artifacts'
22-
'/Functions.Binaries.2.0.13036.no-runtime.zip')
21+
'/artifacts/Functions.Binaries.2.0.13036.no-runtime.zip')
2322

2423
# Extensions necessary for non-core bindings.
2524
AZURE_EXTENSIONS = """\
@@ -32,23 +31,23 @@
3231
<ItemGroup>
3332
<PackageReference
3433
Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator"
35-
Version="1.0.1"
34+
Version="1.1.7"
3635
/>
3736
<PackageReference
3837
Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB"
39-
Version="3.0.1"
38+
Version="3.0.5"
4039
/>
4140
<PackageReference
4241
Include="Microsoft.Azure.WebJobs.Extensions.EventHubs"
43-
Version="3.0.0"
42+
Version="3.0.6"
4443
/>
4544
<PackageReference
4645
Include="Microsoft.Azure.WebJobs.Extensions.EventGrid"
47-
Version="2.0.0"
46+
Version="2.1.0"
4847
/>
4948
<PackageReference
5049
Include="Microsoft.Azure.WebJobs.Extensions.Storage"
51-
Version="3.0.0"
50+
Version="3.0.10"
5251
/>
5352
<PackageReference
5453
Include="Microsoft.Azure.WebJobs.ServiceBus"

tests/unittests/test_http_functions.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,20 @@ def test_async_logging(self):
9090
self.assertEqual(r.text, 'OK-async')
9191

9292
def check_log_async_logging(self, host_out: typing.List[str]):
93+
# Host out only contains user logs
9394
self.assertIn('hello info', host_out)
9495
self.assertIn('and another error', host_out)
9596

96-
# We should see "Function is async"
97-
is_async = any([ho.startswith("Function is async") for ho in host_out])
98-
self.assertTrue(is_async)
99-
10097
def test_sync_logging(self):
10198
# Test that logging doesn't *break* things.
10299
r = self.webhost.request('GET', 'sync_logging')
103100
self.assertEqual(r.status_code, 200)
104101
self.assertEqual(r.text, 'OK-sync')
105102

106103
def check_log_sync_logging(self, host_out: typing.List[str]):
104+
# Host out only contains user logs
107105
self.assertIn('a gracefully handled error', host_out)
108106

109-
# We should see a warning "Function is sync"
110-
is_sync = any([ho.startswith("Function is sync") for ho in host_out])
111-
self.assertTrue(is_sync)
112-
113107
def test_return_context(self):
114108
r = self.webhost.request('GET', 'return_context')
115109
self.assertEqual(r.status_code, 200)

tests/unittests/test_loader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ async def _runner():
8080

8181
stdout, stderr = await proc.communicate()
8282

83-
self.assertEqual(stdout.strip().split(b'\n'), [b'True', b'True'])
83+
# Trimming off carriage return charater when testing on Windows
84+
stdout_lines = [
85+
l.replace(b'\r', b'') for l in stdout.strip().split(b'\n')
86+
]
87+
self.assertEqual(stdout_lines, [b'True', b'True'])
8488

8589
finally:
8690
subprocess.run([

tests/unittests/test_rpc_messages.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import typing
55
import tempfile
6+
import unittest
67

78
from azure_functions_worker import protos
89
from azure_functions_worker import testutils
@@ -78,11 +79,15 @@ def _verify_sys_path_import(self, result, expected_output):
7879
finally:
7980
self._reset_environ()
8081

82+
@unittest.skipIf(sys.platform == 'win32',
83+
'Linux .sh script only works on Linux')
8184
def test_failed_sys_path_import(self):
8285
self._verify_sys_path_import(
8386
'fail',
8487
"No module named 'test_module'")
8588

89+
@unittest.skipIf(sys.platform == 'win32',
90+
'Linux .sh script only works on Linux')
8691
def test_successful_sys_path_import(self):
8792
self._verify_sys_path_import(
8893
'success',
@@ -105,11 +110,15 @@ def _verify_azure_namespace_import(self, result, expected_output):
105110
finally:
106111
self._reset_environ()
107112

113+
@unittest.skipIf(sys.platform == 'win32',
114+
'Linux .sh script only works on Linux')
108115
def test_failed_azure_namespace_import(self):
109116
self._verify_azure_namespace_import(
110117
'false',
111118
'module_b fails to import')
112119

120+
@unittest.skipIf(sys.platform == 'win32',
121+
'Linux .sh script only works on Linux')
113122
def test_successful_azure_namespace_import(self):
114123
self._verify_azure_namespace_import(
115124
'true',

0 commit comments

Comments
 (0)