From 79e7b0382fef4f85b4db54291d2bc7a18d20fc18 Mon Sep 17 00:00:00 2001 From: gavin-aguiar Date: Mon, 10 Mar 2025 16:42:58 -0500 Subject: [PATCH 1/4] Updating test setup to build webhost --- tests/test_setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_setup.py b/tests/test_setup.py index fd6f0044e..6f9c3edd5 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -110,8 +110,13 @@ def compile_webhost(webhost_dir): print(f"Compiling Functions Host from {webhost_dir}") try: subprocess.run( - ["dotnet", "build", "WebJobs.Script.sln", "-o", "bin", - "/p:TreatWarningsAsErrors=false"], + [ + "dotnet", "build", "WebJobs.Script.sln", + "/m:1", # Disable parallel MSBuild + "/nodeReuse:false", # Prevent MSBuild node reuse + f"--property:OutputPath={webhost_dir}/bin", # Set output folder + "/p:TreatWarningsAsErrors=false" + ], check=True, cwd=str(webhost_dir), stdout=sys.stdout, @@ -120,7 +125,7 @@ def compile_webhost(webhost_dir): except subprocess.CalledProcessError: print( f"Failed to compile webhost in {webhost_dir}. " - ".NET Core SDK is required to build the solution. " + "A compatible .NET Core SDK is required to build the solution. " "Please visit https://aka.ms/dotnet-download", file=sys.stderr, ) From 6c1a01950c1eaaf41fead294cd34a1822cafb687 Mon Sep 17 00:00:00 2001 From: gavin-aguiar Date: Tue, 11 Mar 2025 17:49:12 -0500 Subject: [PATCH 2/4] Fix for consumption tests --- tests/consumption_tests/test_linux_consumption.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/consumption_tests/test_linux_consumption.py b/tests/consumption_tests/test_linux_consumption.py index 09f10fd91..1a969b9ab 100644 --- a/tests/consumption_tests/test_linux_consumption.py +++ b/tests/consumption_tests/test_linux_consumption.py @@ -6,7 +6,6 @@ from unittest import TestCase, skipIf from requests import Request -from tests.utils.testutils_lc import LinuxConsumptionWebHostController from azure_functions_worker.constants import ( PYTHON_ENABLE_DEBUG_LOGGING, @@ -14,6 +13,7 @@ PYTHON_ENABLE_WORKER_EXTENSIONS, PYTHON_ISOLATE_WORKER_DEPENDENCIES, ) +from tests.utils.testutils_lc import LinuxConsumptionWebHostController _DEFAULT_HOST_VERSION = "4" @@ -61,6 +61,7 @@ def test_http_no_auth(self): "AzureWebJobsStorage": self._storage, "SCM_RUN_FROM_PACKAGE": self._get_blob_url("HttpNoAuth") }) + req = Request('GET', f'{ctrl.url}/api/HttpTrigger') resp = ctrl.send_request(req) self.assertEqual(resp.status_code, 200) @@ -377,7 +378,8 @@ def generate_random_bytes_stream(): streamed_data, b'streamingtestingresponseisreturned') def _get_blob_url(self, scenario_name: str) -> str: + sas_token = os.getenv(f"SAS_TOKEN{self._py_shortform}") return ( f'https://pythonworker{self._py_shortform}sa.blob.core.windows.net/' - f'python-worker-lc-apps/{scenario_name}{self._py_shortform}.zip' + f'python-worker-lc-apps/{scenario_name}{self._py_shortform}.zip?{sas_token}' ) From 3266bf3559f627d5d16b780131a468acde688215 Mon Sep 17 00:00:00 2001 From: gavin-aguiar Date: Wed, 12 Mar 2025 11:45:43 -0500 Subject: [PATCH 3/4] Revert "Fix for consumption tests" This reverts commit 6c1a01950c1eaaf41fead294cd34a1822cafb687. --- tests/consumption_tests/test_linux_consumption.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/consumption_tests/test_linux_consumption.py b/tests/consumption_tests/test_linux_consumption.py index 1a969b9ab..09f10fd91 100644 --- a/tests/consumption_tests/test_linux_consumption.py +++ b/tests/consumption_tests/test_linux_consumption.py @@ -6,6 +6,7 @@ from unittest import TestCase, skipIf from requests import Request +from tests.utils.testutils_lc import LinuxConsumptionWebHostController from azure_functions_worker.constants import ( PYTHON_ENABLE_DEBUG_LOGGING, @@ -13,7 +14,6 @@ PYTHON_ENABLE_WORKER_EXTENSIONS, PYTHON_ISOLATE_WORKER_DEPENDENCIES, ) -from tests.utils.testutils_lc import LinuxConsumptionWebHostController _DEFAULT_HOST_VERSION = "4" @@ -61,7 +61,6 @@ def test_http_no_auth(self): "AzureWebJobsStorage": self._storage, "SCM_RUN_FROM_PACKAGE": self._get_blob_url("HttpNoAuth") }) - req = Request('GET', f'{ctrl.url}/api/HttpTrigger') resp = ctrl.send_request(req) self.assertEqual(resp.status_code, 200) @@ -378,8 +377,7 @@ def generate_random_bytes_stream(): streamed_data, b'streamingtestingresponseisreturned') def _get_blob_url(self, scenario_name: str) -> str: - sas_token = os.getenv(f"SAS_TOKEN{self._py_shortform}") return ( f'https://pythonworker{self._py_shortform}sa.blob.core.windows.net/' - f'python-worker-lc-apps/{scenario_name}{self._py_shortform}.zip?{sas_token}' + f'python-worker-lc-apps/{scenario_name}{self._py_shortform}.zip' ) From 6e34ae2911edfbb37862121f85d8f3a94d01190f Mon Sep 17 00:00:00 2001 From: gavin-aguiar Date: Wed, 12 Mar 2025 11:47:45 -0500 Subject: [PATCH 4/4] Revert and skip lc tests --- eng/ci/integration-tests.yml | 9 +++++---- eng/ci/official-build.yml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/eng/ci/integration-tests.yml b/eng/ci/integration-tests.yml index 6f8f69d9e..40594ab27 100644 --- a/eng/ci/integration-tests.yml +++ b/eng/ci/integration-tests.yml @@ -47,7 +47,8 @@ extends: dependsOn: [] jobs: - template: /eng/templates/official/jobs/ci-e2e-tests.yml@self - - stage: RunLCTests - dependsOn: [] - jobs: - - template: /eng/templates/official/jobs/ci-lc-tests.yml@self +# Skipping consumption tests till pipeline is fixed +# - stage: RunLCTests +# dependsOn: [] +# jobs: +# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 568fdf16b..7a555e8a4 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -72,7 +72,8 @@ extends: dependsOn: Build jobs: - template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self - - stage: RunLinuxConsumptionTests - dependsOn: Build - jobs: - - template: /eng/templates/official/jobs/ci-lc-tests.yml@self +# Skipping consumption tests till pipeline is fixed +# - stage: RunLinuxConsumptionTests +# dependsOn: Build +# jobs: +# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self