From 7ba94222782bca087c8fda349ccdbab47a195c8c Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 15 Oct 2024 10:07:24 -0500 Subject: [PATCH] skipping dependency isolation test when using sdk artifact --- eng/templates/official/jobs/ci-e2e-tests.yml | 20 ++++++++++++++++++- .../test_dependency_isolation_functions.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index b69d9090..bd1e6254 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -115,6 +115,24 @@ jobs: eng/scripts/test-setup.sh displayName: 'Install test python extension, dependencies and the worker' condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true)) + - powershell: | + $pipelineVarSet = "$(USETESTPYTHONSDK)" + Write-Host "pipelineVarSet: $pipelineVarSet" + $branch = "$(Build.SourceBranch)" + Write-Host "Branch: $branch" + if($branch.StartsWith("refs/heads/sdk/") -or $pipelineVarSet -eq "true") + { + Write-Host "##vso[task.setvariable variable=skipDependencyIsolationTests;]true" + } + else + { + Write-Host "##vso[task.setvariable variable=skipDependencyIsolationTests;]false" + } + displayName: 'Set SkipDependencyIsolationTests variable' + condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) + - powershell: | + Write-Host "skipDependencyIsolationTests: $(skipDependencyIsolationTests)" + displayName: 'Display SkipDependencyIsolationTests variable' - bash: | python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend tests/extension_tests/deferred_bindings_tests tests/extension_tests/http_v2_tests env: @@ -125,5 +143,5 @@ jobs: AzureWebJobsSqlConnectionString: $(SQL_CONNECTION) AzureWebJobsEventGridTopicUri: $(EVENTGRID_URI) AzureWebJobsEventGridConnectionKey: $(EVENTGRID_CONNECTION) - USETESTPYTHONSDK: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) + skipDependencyIsolationTests: $(skipDependencyIsolationTests) displayName: "Running $(PYTHON_VERSION) Python E2E Tests" diff --git a/tests/endtoend/test_dependency_isolation_functions.py b/tests/endtoend/test_dependency_isolation_functions.py index ec1cc251..42efe551 100644 --- a/tests/endtoend/test_dependency_isolation_functions.py +++ b/tests/endtoend/test_dependency_isolation_functions.py @@ -121,7 +121,7 @@ def test_paths_resolution(self): ).lower() ) - @skipIf(is_envvar_true('USETESTPYTHONSDK'), + @skipIf(is_envvar_true('skipDependencyIsolationTests'), 'Running tests using an editable azure-functions package.') def test_loading_libraries_from_customers_package(self): """Since the Python now loaded the customer's dependencies, the