Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,67 +52,67 @@ extends:
- stage: BuildPythonWorker
jobs:
- template: /eng/templates/official/jobs/build-artifacts.yml@self
# - stage: RunWorkerE2ETests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
# - stage: RunWorkerEmulatorTests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/jobs/ci-emulator-tests.yml@self
# parameters:
# PoolName: 1es-pool-azfunc
# - stage: RunWorkerUnitTests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/jobs/ci-unit-tests.yml@self
# parameters:
# PoolName: 1es-pool-azfunc
# - stage: RunWorkerDockerConsumptionTests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
# - stage: RunWorkerDockerDedicatedTests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
# - stage: RunWorkerLinuxConsumptionTests
# dependsOn: BuildPythonWorker
# jobs:
# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self
- stage: RunWorkerE2ETests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
- stage: RunWorkerEmulatorTests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
parameters:
PoolName: 1es-pool-azfunc
- stage: RunWorkerUnitTests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/jobs/ci-unit-tests.yml@self
parameters:
PoolName: 1es-pool-azfunc
- stage: RunWorkerDockerConsumptionTests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
- stage: RunWorkerDockerDedicatedTests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
- stage: RunWorkerLinuxConsumptionTests
dependsOn: BuildPythonWorker
jobs:
- template: /eng/templates/official/jobs/ci-lc-tests.yml@self

# # Python V2 Library Build and Test Stages
# - stage: BuildV2Library
# dependsOn: []
# jobs:
# - template: /eng/templates/official/jobs/build-library.yml@self
# parameters:
# PROJECT_NAME: 'Python V2 Library'
# PROJECT_DIRECTORY: 'runtimes/v2'
# ARTIFACT_NAME: 'azure-functions-runtime'
# - stage: RunV2LibraryUnitTests
# dependsOn: BuildV2Library
# jobs:
# - template: /eng/templates/jobs/ci-library-unit-tests.yml@self
# parameters:
# PROJECT_NAME: 'Python V2 Library'
# PROJECT_DIRECTORY: 'runtimes/v2'
# PoolName: 1es-pool-azfunc
# Python V2 Library Build and Test Stages
- stage: BuildV2Library
dependsOn: []
jobs:
- template: /eng/templates/official/jobs/build-library.yml@self
parameters:
PROJECT_NAME: 'Python V2 Library'
PROJECT_DIRECTORY: 'runtimes/v2'
ARTIFACT_NAME: 'azure-functions-runtime'
- stage: RunV2LibraryUnitTests
dependsOn: BuildV2Library
jobs:
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
parameters:
PROJECT_NAME: 'Python V2 Library'
PROJECT_DIRECTORY: 'runtimes/v2'
PoolName: 1es-pool-azfunc

# # Python V1 Library Build and Test Stages
# - stage: BuildV1Library
# dependsOn: []
# jobs:
# - template: /eng/templates/official/jobs/build-library.yml@self
# parameters:
# PROJECT_NAME: 'Python V1 Library'
# PROJECT_DIRECTORY: 'runtimes/v1'
# ARTIFACT_NAME: 'azure-functions-runtime-v1'
# - stage: RunV1LibraryUnitTests
# dependsOn: BuildV1Library
# jobs:
# - template: /eng/templates/jobs/ci-library-unit-tests.yml@self
# parameters:
# PROJECT_NAME: 'Python V1 Library'
# PROJECT_DIRECTORY: 'runtimes/v1'
# PoolName: 1es-pool-azfunc
# Python V1 Library Build and Test Stages
- stage: BuildV1Library
dependsOn: []
jobs:
- template: /eng/templates/official/jobs/build-library.yml@self
parameters:
PROJECT_NAME: 'Python V1 Library'
PROJECT_DIRECTORY: 'runtimes/v1'
ARTIFACT_NAME: 'azure-functions-runtime-v1'
- stage: RunV1LibraryUnitTests
dependsOn: BuildV1Library
jobs:
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
parameters:
PROJECT_NAME: 'Python V1 Library'
PROJECT_DIRECTORY: 'runtimes/v1'
PoolName: 1es-pool-azfunc
4 changes: 2 additions & 2 deletions eng/ci/worker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ extends:
- template: /eng/templates/official/jobs/publish-library-release.yml@self
parameters:
PROJECT_DIRECTORY: 'runtimes/v2'
VERSION_FILE: 'runtimes/v2/azure_functions_runtime/version.py'
PROJECT_NAME: 'azure-functions-runtime'
BRANCH_NAME: 'release-v2'
TEST_BRANCH_NAME: 'test-release-v2'
condition: eq(${{ parameters.V2LibraryRelease }}, True)
- stage: ReleasePythonV1Library
dependsOn: []
Expand All @@ -61,7 +61,7 @@ extends:
- template: /eng/templates/official/jobs/publish-library-release.yml@self
parameters:
PROJECT_DIRECTORY: 'runtimes/v1'
VERSION_FILE: 'runtimes/v1/azure_functions_runtime_v1/version.py'
PROJECT_NAME: 'azure-functions-runtime-v1'
BRANCH_NAME: 'release-v1'
TEST_BRANCH_NAME: 'test-release-v1'
condition: eq(${{ parameters.V1LibraryRelease }}, True)
4 changes: 2 additions & 2 deletions eng/templates/jobs/ci-emulator-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
docker compose -f ${{ parameters.PROJECT_DIRECTORY }}/tests/emulator_tests/utils/eventhub/docker-compose.yml up -d
displayName: 'Install Azurite and Start EventHub Emulator'
- bash: |
python -m pytest -q -n auto --dist loadfile --reruns 4 --ignore=tests/emulator_tests/test_servicebus_functions.py tests/emulator_tests
python -m pytest -q --dist loadfile --reruns 4 --ignore=tests/emulator_tests/test_servicebus_functions.py tests/emulator_tests
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsEventHubConnectionString: $(EmulatorEventHubConnectionString)
Expand All @@ -107,7 +107,7 @@ jobs:
AzureWebJobsSQLPassword: $(AzureWebJobsSQLPassword)
displayName: 'Install Azurite and Start ServiceBus Emulator'
- bash: |
python -m pytest -q -n auto --dist loadfile --reruns 4 tests/emulator_tests/test_servicebus_functions.py
python -m pytest -q --dist loadfile --reruns 4 tests/emulator_tests/test_servicebus_functions.py
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsServiceBusConnectionString: $(EmulatorServiceBusConnectionString)
Expand Down
2 changes: 1 addition & 1 deletion eng/templates/jobs/ci-library-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }}
displayName: 'Install dependencies'
- bash: |
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./${{ parameters.PROJECT_DIRECTORY }} --cov-report xml --cov-branch tests/unittests
python -m pytest -q --dist loadfile --reruns 4 --instafail --cov=./${{ parameters.PROJECT_DIRECTORY }} --cov-report xml --cov-branch tests/unittests
displayName: "Running $(PYTHON_VERSION) Unit Tests"
env:
AzureWebJobsStorage: $(LinuxStorageConnectionString312)
Expand Down
4 changes: 2 additions & 2 deletions eng/templates/jobs/ci-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:

if [ "$PY_MINOR" -ge 13 ]; then
echo "Running proxy_worker tests (Python >= 3.13)..."
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail \
python -m pytest -q --dist loadfile --reruns 4 --instafail \
--cov=./proxy_worker --cov-report xml --cov-branch tests/unittest_proxy
else
echo "Running unittests (Python < 3.13)..."
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail \
python -m pytest -q --dist loadfile --reruns 4 --instafail \
--cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests
fi
displayName: "Running $(PYTHON_VERSION) Unit Tests"
Expand Down
2 changes: 1 addition & 1 deletion eng/templates/official/jobs/ci-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
Write-Host "skipTest: $(skipTest)"
displayName: 'Display skipTest 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
python -m pytest -q --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:
AzureWebJobsStorage: $(STORAGE_CONNECTION)
AzureWebJobsCosmosDBConnectionString: $(COSMOSDB_CONNECTION)
Expand Down
2 changes: 1 addition & 1 deletion eng/templates/official/jobs/ci-lc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
displayName: 'Display CONTAINER_SAS_TOKEN variable'

- bash: |
python -m pytest -n auto --dist loadfile -vv --instafail tests/consumption_tests
python -m pytest --dist loadfile -vv --instafail tests/consumption_tests
env:
AzureWebJobsStorage: $(AZURE_STORAGE_CONNECTION_STRING)
_DUMMY_CONT_KEY: $(_DUMMY_CONT_KEY)
Expand Down
4 changes: 2 additions & 2 deletions eng/templates/official/jobs/publish-library-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
parameters:
PROJECT_DIRECTORY: ''
VERSION_FILE: ''
PROJECT_NAME: ''
BRANCH_NAME: ''
TEST_BRANCH_NAME: ''


jobs:

Expand All @@ -17,6 +16,7 @@ jobs:
- template: /eng/templates/shared/github-release-branch.yml@self
parameters:
PROJECT_DIRECTORY: ${{ parameters.PROJECT_DIRECTORY }}
VERSION_FILE: ${{ parameters.VERSION_FILE }}
BRANCH_NAME: ${{ parameters.BRANCH_NAME }}

- job: "CheckReleaseBranch"
Expand Down
24 changes: 14 additions & 10 deletions eng/templates/shared/github-release-branch.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
parameters:
PROJECT_DIRECTORY: ''
VERSION_FILE: ''
BRANCH_NAME: ''
PROJECT_NAME: ''

steps:
- powershell: |
$githubToken = "$(GithubPat)"
$newWorkerVersion = "$(NewWorkerVersion)"
$versionFile = "${{ parameters.PROJECT_DIRECTORY}}/version.py"
$versionFile = "${{ parameters.VERSION_FILE}}"
$newBranch = "${{ parameters.BRANCH_NAME}}/$newWorkerVersion"

if ($newWorkerVersion -match '^(\d+)\.(\d+)\.(\d+)([a-zA-Z0-9\-\.]*)?$') {
Expand All @@ -20,13 +22,13 @@ steps:
git checkout -b "$newBranch"

# Runtime Release Only
if (${{ parameters.PROJECT_DIRECTORY}} -ne "workers")
if ("${{ parameters.PROJECT_DIRECTORY}}" -ne "workers")
{
# Modify Runtime Version in workers/pyproject.toml
Write-Host "Replacing Runtime version in worker's pyproject.toml"
((Get-Content workers/pyproject.toml) -replace '"${{ parameters.PROJECT_NAME }}==[^";]+', "`"${{ parameters.PROJECT_NAME }}==$newLibraryVersion") -join "`n" | Set-Content -NoNewline workers/pyproject.toml

# Change ${{ parameters.PROJECT_DIRECTORY}}/version.py version
# Change $versionFile version
Write-Host "Change version number in version.py to $newWorkerVersion"
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $versionFile

Expand All @@ -35,18 +37,20 @@ steps:
}

# Worker Release Only
if (${{ parameters.PROJECT_DIRECTORY}} -eq "workers")
if ("${{ parameters.PROJECT_DIRECTORY}}" -eq "workers")
{
# Change azure_functions_worker version
Write-Host "Change version number in version.py to $newWorkerVersion"
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline ${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py
Write-Host "Change azure_functions_worker version to $newWorkerVersion"
$afwVersionFile = "${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py"
((Get-Content $afwVersionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $afwVersionFile

# Change proxy_worker version
Write-Host "Change version number in version.py to $newWorkerVersion"
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline ${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py
Write-Host "Change proxy_worker version to $newWorkerVersion"
$proxyVersionFile = "${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py"
((Get-Content $proxyVersionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $proxyVersionFile

git add ${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py
git add ${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py
git add $afwVersionFile
git add $proxyVersionFile
}

git commit -m "build: update ${{ parameters.PROJECT_DIRECTORY}} version to $newWorkerVersion"
Expand Down
1 change: 0 additions & 1 deletion runtimes/v1/tests/unittests/test_datumdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_parse_cookie_attr_same_site_explicit_none(self):
def test_parse_to_rpc_http_cookie_list_none(self):
self.assertEqual(parse_to_rpc_http_cookie_list(None, protos), None)

@unittest.skip("TODO: fix this test. Figure out what to do with Timestamp")
def test_parse_to_rpc_http_cookie_list_valid(self):
headers = [
'foo=bar; Path=/some/path; Secure; HttpOnly; Domain=123; '
Expand Down
1 change: 0 additions & 1 deletion runtimes/v2/tests/unittests/test_datumdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_parse_cookie_attr_same_site_explicit_none(self):
def test_parse_to_rpc_http_cookie_list_none(self):
self.assertEqual(parse_to_rpc_http_cookie_list(None, protos), None)

@unittest.skip("TODO: fix this test. Figure out what to do with Timestamp")
def test_parse_to_rpc_http_cookie_list_valid(self):
headers = [
'foo=bar; Path=/some/path; Secure; HttpOnly; Domain=123; '
Expand Down
3 changes: 3 additions & 0 deletions runtimes/v2/tests/unittests/test_deferred_bindings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest

import azure.functions as func
import azurefunctions.extensions.base as clients
import tests.protos as protos
Expand All @@ -20,6 +22,7 @@

class TestDeferredBindingsEnabled(testutils.AsyncTestCase):

@unittest.skip("TODO: Move to emulator.")
def test_mbd_deferred_bindings_enabled_decode(self):
binding = BlobClientConverter
pb = protos.ParameterBinding(name='test',
Expand Down
Loading