From 5c5b1dd08317ad94d2eb1f8ab9a226a189a34256 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 17 Jul 2024 09:36:08 -0500 Subject: [PATCH 01/10] added or condition --- eng/templates/official/jobs/ci-e2e-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 25c5d9453..d33aab275 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -89,7 +89,7 @@ jobs: definition: 679 buildVersionToDownload: latest targetPath: '$(Pipeline.Workspace)/PythonSdkArtifact' - condition: eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*') + condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*'), eq(variables['USETESTPYTHONSDK'], true)) - bash: | python -m pip install --upgrade pip python -m pip install -e $(Pipeline.Workspace)/PythonSdkArtifact @@ -107,7 +107,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install test python sdk, dependencies and the worker' - condition: eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*') + condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*'), eq(variables['USETESTPYTHONSDK'], true)) - task: DownloadPipelineArtifact@2 displayName: 'Download Python Extension Artifact' inputs: @@ -117,7 +117,7 @@ jobs: definition: 798 buildVersionToDownload: latest targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact' - condition: eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*') + condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*'), eq(variables['USETESTPYTHONEXTENSIONS'], true)) - bash: | python -m pip install --upgrade pip @@ -137,7 +137,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install test python extension, dependencies and the worker' - condition: eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*') + condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*'), 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: From e87f45e4851116196bf3d5fb836c85de1ba0c6b3 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 23 Jul 2024 11:57:18 -0500 Subject: [PATCH 02/10] updated condition --- eng/ci/integration-tests.yml | 4 ++++ eng/templates/official/jobs/ci-e2e-tests.yml | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/eng/ci/integration-tests.yml b/eng/ci/integration-tests.yml index 31b5455a3..b94d7fd10 100644 --- a/eng/ci/integration-tests.yml +++ b/eng/ci/integration-tests.yml @@ -29,6 +29,10 @@ variables: - template: /ci/variables/build.yml@eng - template: /ci/variables/cfs.yml@eng - group: python-integration-resources + - name: isSdkRelease + value: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/sdk/')] + - name: isExtensionsRelease + value: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/extensions/')] extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1es diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 3161fd290..0138322ef 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -88,7 +88,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install dependencies and the worker' - condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/sdk/*'), ne(variables['Build.SourceBranch'], 'refs/heads/extensions/*')) + condition: and(ne(variables.isSdkRelease, true), ne(variables.isExtensionsRelease, true)) - task: DownloadPipelineArtifact@2 displayName: 'Download Python SDK Artifact' inputs: @@ -98,7 +98,7 @@ jobs: definition: 679 buildVersionToDownload: latest targetPath: '$(Pipeline.Workspace)/PythonSdkArtifact' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*'), eq(variables['USETESTPYTHONSDK'], true)) + condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) - bash: | python -m pip install --upgrade pip python -m pip install -e $(Pipeline.Workspace)/PythonSdkArtifact @@ -116,7 +116,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install test python sdk, dependencies and the worker' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*'), eq(variables['USETESTPYTHONSDK'], true)) + condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) - task: DownloadPipelineArtifact@2 displayName: 'Download Python Extension Artifact' inputs: @@ -126,7 +126,7 @@ jobs: definition: 798 buildVersionToDownload: latest targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*'), eq(variables['USETESTPYTHONEXTENSIONS'], true)) + condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true)) - bash: | python -m pip install --upgrade pip @@ -146,7 +146,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install test python extension, dependencies and the worker' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/extensions/*'), eq(variables['USETESTPYTHONEXTENSIONS'], true)) + condition: or(eq(variables.isExtensionsRelease, true), 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: @@ -157,5 +157,5 @@ jobs: AzureWebJobsSqlConnectionString: $(SQL_CONNECTION) AzureWebJobsEventGridTopicUri: $(EVENTGRID_URI) AzureWebJobsEventGridConnectionKey: $(EVENTGRID_CONNECTION) - USETESTPYTHONSDK: eq(variables['Build.SourceBranch'], 'refs/heads/sdk/*') + USETESTPYTHONSDK: eq(variables.isSdkRelease, true) displayName: "Running $(PYTHON_VERSION) Python E2E Tests" From c1183a3ffcfd23c8991b9316f07a056d8b667606 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 23 Jul 2024 13:40:13 -0500 Subject: [PATCH 03/10] updated condition --- eng/templates/official/jobs/ci-e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 0138322ef..f70a8ed8d 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -88,7 +88,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install dependencies and the worker' - condition: and(ne(variables.isSdkRelease, true), ne(variables.isExtensionsRelease, true)) + condition: and(ne(variables.isSdkRelease, true), ne(variables.isExtensionsRelease, true), ne(variables['USETESTPYTHONSDK'], true), ne(variables['USETESTPYTHONEXTENSIONS'], true)) - task: DownloadPipelineArtifact@2 displayName: 'Download Python SDK Artifact' inputs: From 6f888fb67aaaafd1f8a5c2127a52a3c9bd0c66fb Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 23 Jul 2024 15:25:40 -0500 Subject: [PATCH 04/10] easier readability --- eng/templates/official/jobs/ci-e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index f70a8ed8d..bd8a8a10a 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -88,7 +88,7 @@ jobs: python -m invoke -c test_setup webhost --branch-name=dev python -m invoke -c test_setup extensions displayName: 'Install dependencies and the worker' - condition: and(ne(variables.isSdkRelease, true), ne(variables.isExtensionsRelease, true), ne(variables['USETESTPYTHONSDK'], true), ne(variables['USETESTPYTHONEXTENSIONS'], true)) + condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) - task: DownloadPipelineArtifact@2 displayName: 'Download Python SDK Artifact' inputs: From 66437989e733cc609c40b68c72e455f57edc991b Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 11:40:17 -0500 Subject: [PATCH 05/10] script for installing deps, test setup --- eng/scripts/install-dependencies.sh | 12 +++++++++ eng/scripts/test-setup.sh | 6 +++++ eng/templates/jobs/ci-unit-tests.yml | 16 +++-------- .../official/jobs/ci-custom-image-tests.yml | 8 +----- .../jobs/ci-docker-consumption-tests.yml | 6 +---- .../jobs/ci-docker-dedicated-tests.yml | 6 +---- eng/templates/official/jobs/ci-e2e-tests.yml | 27 +++---------------- 7 files changed, 28 insertions(+), 53 deletions(-) create mode 100644 eng/scripts/install-dependencies.sh create mode 100644 eng/scripts/test-setup.sh diff --git a/eng/scripts/install-dependencies.sh b/eng/scripts/install-dependencies.sh new file mode 100644 index 000000000..b64e0d547 --- /dev/null +++ b/eng/scripts/install-dependencies.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +python -m pip install --upgrade pip +python -m pip install -U azure-functions --pre +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 \ No newline at end of file diff --git a/eng/scripts/test-setup.sh b/eng/scripts/test-setup.sh new file mode 100644 index 000000000..d062021dc --- /dev/null +++ b/eng/scripts/test-setup.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +cd tests +python -m invoke -c test_setup build-protos +python -m invoke -c test_setup webhost --branch-name=dev +python -m invoke -c test_setup extensions \ No newline at end of file diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index cf31f94f6..d1e071547 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -26,20 +26,10 @@ jobs: inputs: version: 8.0.x - bash: | - python -m pip install --upgrade pip - python -m pip install -U azure-functions --pre - python -m pip install -U -e .[dev] - - if [[ $(PYTHON_VERSION) != "3.7" ]]; then - python -m pip install --pre -U -e .[test-http-v2] - fi - - cd tests - python -m invoke -c test_setup build-protos - python -m invoke -c test_setup webhost --branch-name=dev - python -m invoke -c test_setup extensions + .eng/scripts/install-dependencies.sh + .eng/scripts/test-setup.sh displayName: 'Install dependencies' - bash: | - python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests + python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests displayName: "Running $(PYTHON_VERSION) Unit Tests" \ No newline at end of file diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index 2a280fa3a..d3aefb18c 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,13 +12,7 @@ jobs: inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) - bash: | - 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 + .eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-consumption-tests.yml b/eng/templates/official/jobs/ci-docker-consumption-tests.yml index 56d2e8f67..3971c4da3 100644 --- a/eng/templates/official/jobs/ci-docker-consumption-tests.yml +++ b/eng/templates/official/jobs/ci-docker-consumption-tests.yml @@ -51,11 +51,7 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - python -m pip install -U -e .[dev] - python -m pip install --pre -U -e .[test-http-v2] - if [[ $(PYTHON_VERSION) != "3.8" ]]; then - python -m pip install --pre -U -e .[test-deferred-bindings] - fi + .eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index caea1ac52..580e29aec 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -51,11 +51,7 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - python -m pip install -U -e .[dev] - python -m pip install --pre -U -e .[test-http-v2] - if [[ $(PYTHON_VERSION) != "3.8" ]]; then - python -m pip install --pre -U -e .[test-deferred-bindings] - fi + .eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index bd8a8a10a..88021fd92 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -72,21 +72,8 @@ jobs: inputs: version: 8.0.x - bash: | - python -m pip install --upgrade pip - python -m pip install -U azure-functions --pre - 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 - - cd tests - python -m invoke -c test_setup build-protos - python -m invoke -c test_setup webhost --branch-name=dev - python -m invoke -c test_setup extensions + .eng/scripts/install-dependencies.sh + .eng/scripts/test-setup.sh displayName: 'Install dependencies and the worker' condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) - task: DownloadPipelineArtifact@2 @@ -111,10 +98,7 @@ jobs: python -m pip install --pre -U -e .[test-deferred-bindings] fi - cd tests - python -m invoke -c test_setup build-protos - python -m invoke -c test_setup webhost --branch-name=dev - python -m invoke -c test_setup extensions + .eng/scripts/test-setup.sh displayName: 'Install test python sdk, dependencies and the worker' condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) - task: DownloadPipelineArtifact@2 @@ -141,10 +125,7 @@ jobs: python -m pip install -U -e .[dev] - cd tests - python -m invoke -c test_setup build-protos - python -m invoke -c test_setup webhost --branch-name=dev - python -m invoke -c test_setup extensions + .eng/scripts/test-setup.sh displayName: 'Install test python extension, dependencies and the worker' condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true)) - bash: | From d38cf7070b575f48e5620d7b8eba421f80d629e1 Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 11:47:53 -0500 Subject: [PATCH 06/10] typo, deleted old scripts --- .github/Scripts/deferred-bindings-e2e-tests.sh | 2 -- .github/Scripts/e2e-tests.sh | 2 -- .github/Scripts/fwpc-e2e-tests.sh | 2 -- eng/templates/jobs/ci-unit-tests.yml | 4 ++-- eng/templates/official/jobs/ci-custom-image-tests.yml | 2 +- .../official/jobs/ci-docker-consumption-tests.yml | 2 +- eng/templates/official/jobs/ci-docker-dedicated-tests.yml | 2 +- eng/templates/official/jobs/ci-e2e-tests.yml | 8 ++++---- python/test/worker.config.json | 4 ++-- 9 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 .github/Scripts/deferred-bindings-e2e-tests.sh delete mode 100644 .github/Scripts/e2e-tests.sh delete mode 100644 .github/Scripts/fwpc-e2e-tests.sh diff --git a/.github/Scripts/deferred-bindings-e2e-tests.sh b/.github/Scripts/deferred-bindings-e2e-tests.sh deleted file mode 100644 index 78c5a5829..000000000 --- a/.github/Scripts/deferred-bindings-e2e-tests.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/extension_tests/deferred_bindings_tests \ No newline at end of file diff --git a/.github/Scripts/e2e-tests.sh b/.github/Scripts/e2e-tests.sh deleted file mode 100644 index 83cd221b8..000000000 --- a/.github/Scripts/e2e-tests.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -python -m pytest -q -n auto --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append --ignore=tests/endtoend/test_worker_process_count_functions.py --ignore=tests/endtoend/test_threadpool_thread_count_functions.py tests/endtoend \ No newline at end of file diff --git a/.github/Scripts/fwpc-e2e-tests.sh b/.github/Scripts/fwpc-e2e-tests.sh deleted file mode 100644 index d1196cb80..000000000 --- a/.github/Scripts/fwpc-e2e-tests.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -python -m pytest -q -n 1 --dist loadfile --reruns 4 --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend/test_worker_process_count_functions.py tests/endtoend/test_threadpool_thread_count_functions.py \ No newline at end of file diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index d1e071547..91482e611 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -26,8 +26,8 @@ jobs: inputs: version: 8.0.x - bash: | - .eng/scripts/install-dependencies.sh - .eng/scripts/test-setup.sh + eng/scripts/install-dependencies.sh + eng/scripts/test-setup.sh displayName: 'Install dependencies' - bash: | python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index d3aefb18c..2a1db006a 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,7 +12,7 @@ jobs: inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) - bash: | - .eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-consumption-tests.yml b/eng/templates/official/jobs/ci-docker-consumption-tests.yml index 3971c4da3..268a6a7cf 100644 --- a/eng/templates/official/jobs/ci-docker-consumption-tests.yml +++ b/eng/templates/official/jobs/ci-docker-consumption-tests.yml @@ -51,7 +51,7 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - .eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index 580e29aec..2b852d33a 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -51,7 +51,7 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - .eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 88021fd92..c1a50bf80 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -72,8 +72,8 @@ jobs: inputs: version: 8.0.x - bash: | - .eng/scripts/install-dependencies.sh - .eng/scripts/test-setup.sh + eng/scripts/install-dependencies.sh + eng/scripts/test-setup.sh displayName: 'Install dependencies and the worker' condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) - task: DownloadPipelineArtifact@2 @@ -98,7 +98,7 @@ jobs: python -m pip install --pre -U -e .[test-deferred-bindings] fi - .eng/scripts/test-setup.sh + eng/scripts/test-setup.sh displayName: 'Install test python sdk, dependencies and the worker' condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) - task: DownloadPipelineArtifact@2 @@ -125,7 +125,7 @@ jobs: python -m pip install -U -e .[dev] - .eng/scripts/test-setup.sh + eng/scripts/test-setup.sh displayName: 'Install test python extension, dependencies and the worker' condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true)) - bash: | diff --git a/python/test/worker.config.json b/python/test/worker.config.json index 3fc2a9236..c8f9bf626 100644 --- a/python/test/worker.config.json +++ b/python/test/worker.config.json @@ -2,8 +2,8 @@ "description":{ "language":"python", "extensions":[".py"], - "defaultExecutablePath":"python", + "defaultExecutablePath":"C:\\Users\\victoriahall\\Documents\\repos\\azure-functions-python-worker\\.venv\\Scripts\\python.exe", "defaultWorkerPath":"worker.py", "workerIndexing": "true" } -} +} \ No newline at end of file From d5a28fe8866002fcaed4b755ccf1d40959947612 Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 11:57:02 -0500 Subject: [PATCH 07/10] grant execute permissions --- eng/templates/jobs/ci-unit-tests.yml | 3 +++ eng/templates/official/jobs/ci-custom-image-tests.yml | 2 ++ eng/templates/official/jobs/ci-docker-consumption-tests.yml | 2 ++ eng/templates/official/jobs/ci-docker-dedicated-tests.yml | 2 ++ eng/templates/official/jobs/ci-e2e-tests.yml | 6 ++++++ 5 files changed, 15 insertions(+) diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index 91482e611..d0db9fee8 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -26,6 +26,9 @@ jobs: inputs: version: 8.0.x - bash: | + chmod +x eng/scripts/install-dependencies.sh + chmod +x eng/scripts/test-setup.sh + eng/scripts/install-dependencies.sh eng/scripts/test-setup.sh displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index 2a1db006a..4114fca9f 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,6 +12,8 @@ jobs: inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) - bash: | + chmod +x eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos diff --git a/eng/templates/official/jobs/ci-docker-consumption-tests.yml b/eng/templates/official/jobs/ci-docker-consumption-tests.yml index 268a6a7cf..355c19e28 100644 --- a/eng/templates/official/jobs/ci-docker-consumption-tests.yml +++ b/eng/templates/official/jobs/ci-docker-consumption-tests.yml @@ -51,6 +51,8 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | + chmod +x eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index 2b852d33a..cacabb5c2 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -51,6 +51,8 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | + chmod +x eng/scripts/install-dependencies.sh + eng/scripts/install-dependencies.sh cd tests python -m invoke -c test_setup build-protos diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index c1a50bf80..5e7c88b47 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -72,6 +72,9 @@ jobs: inputs: version: 8.0.x - bash: | + chmod +x eng/scripts/install-dependencies.sh + chmod +x eng/scripts/test-setup.sh + eng/scripts/install-dependencies.sh eng/scripts/test-setup.sh displayName: 'Install dependencies and the worker' @@ -98,6 +101,7 @@ jobs: python -m pip install --pre -U -e .[test-deferred-bindings] fi + chmod +x eng/scripts/test-setup.sh eng/scripts/test-setup.sh displayName: 'Install test python sdk, dependencies and the worker' condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true)) @@ -125,6 +129,8 @@ jobs: python -m pip install -U -e .[dev] + + chmod +x eng/scripts/test-setup.sh eng/scripts/test-setup.sh displayName: 'Install test python extension, dependencies and the worker' condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true)) From cffd1fbf396b852acbade25362e1617365feadd7 Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 12:51:02 -0500 Subject: [PATCH 08/10] revert worker config --- python/test/worker.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/test/worker.config.json b/python/test/worker.config.json index c8f9bf626..dbb1480b7 100644 --- a/python/test/worker.config.json +++ b/python/test/worker.config.json @@ -2,7 +2,7 @@ "description":{ "language":"python", "extensions":[".py"], - "defaultExecutablePath":"C:\\Users\\victoriahall\\Documents\\repos\\azure-functions-python-worker\\.venv\\Scripts\\python.exe", + "defaultExecutablePath":"python", "defaultWorkerPath":"worker.py", "workerIndexing": "true" } From 0c65489f76a0ec899c4e2e3512119fadbf68eb8b Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 13:14:08 -0500 Subject: [PATCH 09/10] delete install deps script --- eng/scripts/install-dependencies.sh | 12 ------------ eng/templates/jobs/ci-unit-tests.yml | 10 +++++++--- .../official/jobs/ci-custom-image-tests.yml | 10 +++++++--- .../official/jobs/ci-docker-consumption-tests.yml | 8 +++++--- .../official/jobs/ci-docker-dedicated-tests.yml | 8 +++++--- eng/templates/official/jobs/ci-e2e-tests.yml | 13 ++++++++++--- 6 files changed, 34 insertions(+), 27 deletions(-) delete mode 100644 eng/scripts/install-dependencies.sh diff --git a/eng/scripts/install-dependencies.sh b/eng/scripts/install-dependencies.sh deleted file mode 100644 index b64e0d547..000000000 --- a/eng/scripts/install-dependencies.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -python -m pip install --upgrade pip -python -m pip install -U azure-functions --pre -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 \ No newline at end of file diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index d0db9fee8..3821de611 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -26,10 +26,14 @@ jobs: inputs: version: 8.0.x - bash: | - chmod +x eng/scripts/install-dependencies.sh + python -m pip install --upgrade pip + python -m pip install -U azure-functions --pre + python -m pip install -U -e .[dev] + if [[ $(PYTHON_VERSION) != "3.7" ]]; then + python -m pip install --pre -U -e .[test-http-v2] + fi + chmod +x eng/scripts/test-setup.sh - - eng/scripts/install-dependencies.sh eng/scripts/test-setup.sh displayName: 'Install dependencies' - bash: | diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index 4114fca9f..2a280fa3a 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,9 +12,13 @@ jobs: inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) - bash: | - chmod +x eng/scripts/install-dependencies.sh - - eng/scripts/install-dependencies.sh + 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 cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-consumption-tests.yml b/eng/templates/official/jobs/ci-docker-consumption-tests.yml index 355c19e28..56d2e8f67 100644 --- a/eng/templates/official/jobs/ci-docker-consumption-tests.yml +++ b/eng/templates/official/jobs/ci-docker-consumption-tests.yml @@ -51,9 +51,11 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - chmod +x eng/scripts/install-dependencies.sh - - eng/scripts/install-dependencies.sh + python -m pip install -U -e .[dev] + python -m pip install --pre -U -e .[test-http-v2] + if [[ $(PYTHON_VERSION) != "3.8" ]]; then + python -m pip install --pre -U -e .[test-deferred-bindings] + fi cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index cacabb5c2..caea1ac52 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -51,9 +51,11 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - chmod +x eng/scripts/install-dependencies.sh - - eng/scripts/install-dependencies.sh + python -m pip install -U -e .[dev] + python -m pip install --pre -U -e .[test-http-v2] + if [[ $(PYTHON_VERSION) != "3.8" ]]; then + python -m pip install --pre -U -e .[test-deferred-bindings] + fi cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 5e7c88b47..4c1e9f833 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -72,10 +72,17 @@ jobs: inputs: version: 8.0.x - bash: | - chmod +x eng/scripts/install-dependencies.sh + python -m pip install --upgrade pip + python -m pip install -U azure-functions --pre + 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 + chmod +x eng/scripts/test-setup.sh - - eng/scripts/install-dependencies.sh eng/scripts/test-setup.sh displayName: 'Install dependencies and the worker' condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) From 635b4ce58bf36be65f84da43c0f5bc34f0dec34f Mon Sep 17 00:00:00 2001 From: hallvictoria Date: Mon, 29 Jul 2024 14:17:40 -0500 Subject: [PATCH 10/10] re-added isntall-deps script --- eng/scripts/install-dependencies.sh | 12 ++++++++++++ eng/templates/jobs/ci-unit-tests.yml | 10 +++------- .../official/jobs/ci-custom-image-tests.yml | 10 +++------- .../official/jobs/ci-docker-consumption-tests.yml | 8 +++----- .../official/jobs/ci-docker-dedicated-tests.yml | 8 +++----- eng/templates/official/jobs/ci-e2e-tests.yml | 13 +++---------- 6 files changed, 27 insertions(+), 34 deletions(-) create mode 100644 eng/scripts/install-dependencies.sh diff --git a/eng/scripts/install-dependencies.sh b/eng/scripts/install-dependencies.sh new file mode 100644 index 000000000..d1b953642 --- /dev/null +++ b/eng/scripts/install-dependencies.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +python -m pip install --upgrade pip +python -m pip install -U azure-functions --pre +python -m pip install -U -e .[dev] + +if [[ $1 != "3.7" ]]; then + python -m pip install --pre -U -e .[test-http-v2] +fi +if [[ $1 != "3.7" && $1 != "3.8" ]]; then + python -m pip install --pre -U -e .[test-deferred-bindings] +fi \ No newline at end of file diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index 3821de611..099084516 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -26,14 +26,10 @@ jobs: inputs: version: 8.0.x - bash: | - python -m pip install --upgrade pip - python -m pip install -U azure-functions --pre - python -m pip install -U -e .[dev] - if [[ $(PYTHON_VERSION) != "3.7" ]]; then - python -m pip install --pre -U -e .[test-http-v2] - fi - + chmod +x eng/scripts/install-dependencies.sh chmod +x eng/scripts/test-setup.sh + + eng/scripts/install-dependencies.sh $(PYTHON_VERSION) eng/scripts/test-setup.sh displayName: 'Install dependencies' - bash: | diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index 2a280fa3a..cb08f8a5b 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,13 +12,9 @@ jobs: inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) - bash: | - 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 + chmod +x eng/scripts/install-dependencies.sh + + eng/scripts/install-dependencies.sh $(PYTHON_VERSION) cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-consumption-tests.yml b/eng/templates/official/jobs/ci-docker-consumption-tests.yml index 56d2e8f67..f1a4a23f1 100644 --- a/eng/templates/official/jobs/ci-docker-consumption-tests.yml +++ b/eng/templates/official/jobs/ci-docker-consumption-tests.yml @@ -51,11 +51,9 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - python -m pip install -U -e .[dev] - python -m pip install --pre -U -e .[test-http-v2] - if [[ $(PYTHON_VERSION) != "3.8" ]]; then - python -m pip install --pre -U -e .[test-deferred-bindings] - fi + chmod +x eng/scripts/install-dependencies.sh + + eng/scripts/install-dependencies.sh $(PYTHON_VERSION) cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index caea1ac52..b76b1f883 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -51,11 +51,9 @@ jobs: inputs: versionSpec: $(PYTHON_VERSION) - bash: | - python -m pip install -U -e .[dev] - python -m pip install --pre -U -e .[test-http-v2] - if [[ $(PYTHON_VERSION) != "3.8" ]]; then - python -m pip install --pre -U -e .[test-deferred-bindings] - fi + chmod +x eng/scripts/install-dependencies.sh + + eng/scripts/install-dependencies.sh $(PYTHON_VERSION) cd tests python -m invoke -c test_setup build-protos displayName: 'Install dependencies' diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 4c1e9f833..9d12ee2e6 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -72,17 +72,10 @@ jobs: inputs: version: 8.0.x - bash: | - python -m pip install --upgrade pip - python -m pip install -U azure-functions --pre - 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 - + chmod +x eng/scripts/install-dependencies.sh chmod +x eng/scripts/test-setup.sh + + eng/scripts/install-dependencies.sh $(PYTHON_VERSION) eng/scripts/test-setup.sh displayName: 'Install dependencies and the worker' condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false))