diff --git a/eng/ci/public-build.yml b/eng/ci/public-build.yml index a1a50691d..6d62ec288 100644 --- a/eng/ci/public-build.yml +++ b/eng/ci/public-build.yml @@ -36,7 +36,8 @@ extends: compiled: enabled: true # still only runs for default branch runSourceLanguagesInSourceAnalysis: true - + settings: + skipBuildTagsForGitHubPullRequests: ${{ variables['System.PullRequest.IsFork'] }} stages: - stage: Build jobs: diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index a2d34d213..efa46257a 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -77,8 +77,64 @@ jobs: python setup.py build python setup.py webhost --branch-name=dev python setup.py extension - mkdir logs displayName: 'Install dependencies and the worker' + condition: and(eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) + - task: DownloadPipelineArtifact@2 + displayName: 'Download Python SDK Artifact' + inputs: + buildType: specific + artifactName: 'azure-functions' + project: 'internal' + definition: 679 + buildVersionToDownload: latest + targetPath: '$(Pipeline.Workspace)/PythonSdkArtifact' + condition: eq(variables['USETESTPYTHONSDK'], true) + - bash: | + python -m pip install --upgrade pip + python -m pip install -e $(Pipeline.Workspace)/PythonSdkArtifact + python -m pip install -U -e .[dev] + + if [[ $(PYTHON_VERSION) != "3.7" ]]; then + python -m pip install --pre -U -e .[test-http-v2] + fi + if [[ $(PYTHON_VERSION) != "3.7" && $(PYTHON_VERSION) != "3.8" ]]; then + python -m pip install --pre -U -e .[test-deferred-bindings] + fi + + python setup.py build + python setup.py webhost --branch-name=dev + python setup.py extension + displayName: 'Install test python sdk, dependencies and the worker' + condition: eq(variables['USETESTPYTHONSDK'], true) + - task: DownloadPipelineArtifact@2 + displayName: 'Download Python Extension Artifact' + inputs: + buildType: specific + artifactName: $(PYTHONEXTENSIONNAME) + project: 'internal' + definition: 798 + buildVersionToDownload: latest + targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact' + condition: eq(variables['USETESTPYTHONEXTENSIONS'], true) + - bash: | + python -m pip install --upgrade pip + + if [[ $(PYTHON_VERSION) != "3.7" ]]; then + python -m pip install -e $(Pipeline.Workspace)/PythonExtensionArtifact + python -m pip install --pre -U -e .[test-http-v2] + fi + if [[ $(PYTHON_VERSION) != "3.7" && $(PYTHON_VERSION) != "3.8" ]]; then + python -m pip install -e $(Pipeline.Workspace)/PythonExtensionArtifact + python -m pip install --pre -U -e .[test-deferred-bindings] + fi + + python -m pip install -U -e .[dev] + + python setup.py build + python setup.py webhost --branch-name=dev + python setup.py extension + displayName: 'Install test python extension, dependencies and the worker' + condition: eq(variables['USETESTPYTHONEXTENSIONS'], true) - 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: @@ -89,4 +145,5 @@ jobs: AzureWebJobsSqlConnectionString: $(SQL_CONNECTION) AzureWebJobsEventGridTopicUri: $(EVENTGRID_URI) AzureWebJobsEventGridConnectionKey: $(EVENTGRID_CONNECTION) + USETESTPYTHONSDK: $(USETESTPYTHONSDK) 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 c2f5cedb8..c1b918072 100644 --- a/tests/endtoend/test_dependency_isolation_functions.py +++ b/tests/endtoend/test_dependency_isolation_functions.py @@ -118,6 +118,8 @@ def test_paths_resolution(self): ).lower() ) + @skipIf(is_envvar_true('USETESTPYTHONSDK'), + '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 libraries version should match the ones in @@ -125,7 +127,6 @@ def test_loading_libraries_from_customers_package(self): """ r: Response = self.webhost.request('GET', 'report_dependencies') libraries = r.json()['libraries'] - self.assertEqual( libraries['proto.expected.version'], libraries['proto.version'] )