From e7b618844b871095d276829f5cb715532006a964 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Thu, 14 Aug 2025 15:36:48 -0500 Subject: [PATCH] update worker.config --- workers/python/prodV4/worker.config.json | 1 + workers/tests/endtoend/test_eol_log.py | 41 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 workers/tests/endtoend/test_eol_log.py diff --git a/workers/python/prodV4/worker.config.json b/workers/python/prodV4/worker.config.json index eaa3c50cb..6c2ffe5e2 100644 --- a/workers/python/prodV4/worker.config.json +++ b/workers/python/prodV4/worker.config.json @@ -4,6 +4,7 @@ "defaultRuntimeVersion":"3.12", "supportedOperatingSystems":["LINUX", "OSX", "WINDOWS"], "supportedRuntimeVersions":["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], + "minimumSupportedRuntimeVersion":"3.9", "supportedArchitectures":["X64", "X86", "Arm64"], "extensions":[".py"], "defaultExecutablePath":"python", diff --git a/workers/tests/endtoend/test_eol_log.py b/workers/tests/endtoend/test_eol_log.py new file mode 100644 index 000000000..1cbf08110 --- /dev/null +++ b/workers/tests/endtoend/test_eol_log.py @@ -0,0 +1,41 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +import re +import sys +import time +import typing + +from tests.utils import testutils +from unittest.case import skipIf + +REQUEST_TIMEOUT_SEC = 5 + + +@skipIf(sys.version_info.minor >= 9, + '3.9+ is supported.') +class TestEOLFunctions(testutils.WebHostTestCase): + + @classmethod + def get_script_dir(cls): + return testutils.E2E_TESTS_FOLDER / 'timer_functions' + + def test_timer(self): + time.sleep(1) + # Checking webhost status. + r = self.webhost.request('GET', '', no_prefix=True, + timeout=REQUEST_TIMEOUT_SEC) + self.assertTrue(r.ok) + + def check_log_timer(self, host_out: typing.List[str]): + self.assertEqual(host_out.count("This timer trigger function executed " + "successfully"), 1) + pattern = ( + r"The configured runtime version '.*' " + r"for language '.*' " + r"is lower than the minimum supported version '.*'\. " + r"Please update to a supported version\. " + r"Visit aka\.ms/supported-language-versions for more information\." + ) + + found = any(re.search(pattern, log) for log in host_out) + self.assertTrue(found)