Skip to content

Commit e89f264

Browse files
authored
fix: run tests in official build (#1757)
* run official tests * new line * update pytest-xdist versions * update pytest-xdist versions * run without xdist * revert pyproject changes * skip connection string test
1 parent 3e9f4b3 commit e89f264

File tree

12 files changed

+90
-85
lines changed

12 files changed

+90
-85
lines changed

eng/ci/official-build.yml

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -52,67 +52,67 @@ extends:
5252
- stage: BuildPythonWorker
5353
jobs:
5454
- template: /eng/templates/official/jobs/build-artifacts.yml@self
55-
# - stage: RunWorkerE2ETests
56-
# dependsOn: BuildPythonWorker
57-
# jobs:
58-
# - template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
59-
# - stage: RunWorkerEmulatorTests
60-
# dependsOn: BuildPythonWorker
61-
# jobs:
62-
# - template: /eng/templates/jobs/ci-emulator-tests.yml@self
63-
# parameters:
64-
# PoolName: 1es-pool-azfunc
65-
# - stage: RunWorkerUnitTests
66-
# dependsOn: BuildPythonWorker
67-
# jobs:
68-
# - template: /eng/templates/jobs/ci-unit-tests.yml@self
69-
# parameters:
70-
# PoolName: 1es-pool-azfunc
71-
# - stage: RunWorkerDockerConsumptionTests
72-
# dependsOn: BuildPythonWorker
73-
# jobs:
74-
# - template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
75-
# - stage: RunWorkerDockerDedicatedTests
76-
# dependsOn: BuildPythonWorker
77-
# jobs:
78-
# - template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
79-
# - stage: RunWorkerLinuxConsumptionTests
80-
# dependsOn: BuildPythonWorker
81-
# jobs:
82-
# - template: /eng/templates/official/jobs/ci-lc-tests.yml@self
55+
- stage: RunWorkerE2ETests
56+
dependsOn: BuildPythonWorker
57+
jobs:
58+
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
59+
- stage: RunWorkerEmulatorTests
60+
dependsOn: BuildPythonWorker
61+
jobs:
62+
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
63+
parameters:
64+
PoolName: 1es-pool-azfunc
65+
- stage: RunWorkerUnitTests
66+
dependsOn: BuildPythonWorker
67+
jobs:
68+
- template: /eng/templates/jobs/ci-unit-tests.yml@self
69+
parameters:
70+
PoolName: 1es-pool-azfunc
71+
- stage: RunWorkerDockerConsumptionTests
72+
dependsOn: BuildPythonWorker
73+
jobs:
74+
- template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self
75+
- stage: RunWorkerDockerDedicatedTests
76+
dependsOn: BuildPythonWorker
77+
jobs:
78+
- template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self
79+
- stage: RunWorkerLinuxConsumptionTests
80+
dependsOn: BuildPythonWorker
81+
jobs:
82+
- template: /eng/templates/official/jobs/ci-lc-tests.yml@self
8383

84-
# # Python V2 Library Build and Test Stages
85-
# - stage: BuildV2Library
86-
# dependsOn: []
87-
# jobs:
88-
# - template: /eng/templates/official/jobs/build-library.yml@self
89-
# parameters:
90-
# PROJECT_NAME: 'Python V2 Library'
91-
# PROJECT_DIRECTORY: 'runtimes/v2'
92-
# ARTIFACT_NAME: 'azure-functions-runtime'
93-
# - stage: RunV2LibraryUnitTests
94-
# dependsOn: BuildV2Library
95-
# jobs:
96-
# - template: /eng/templates/jobs/ci-library-unit-tests.yml@self
97-
# parameters:
98-
# PROJECT_NAME: 'Python V2 Library'
99-
# PROJECT_DIRECTORY: 'runtimes/v2'
100-
# PoolName: 1es-pool-azfunc
84+
# Python V2 Library Build and Test Stages
85+
- stage: BuildV2Library
86+
dependsOn: []
87+
jobs:
88+
- template: /eng/templates/official/jobs/build-library.yml@self
89+
parameters:
90+
PROJECT_NAME: 'Python V2 Library'
91+
PROJECT_DIRECTORY: 'runtimes/v2'
92+
ARTIFACT_NAME: 'azure-functions-runtime'
93+
- stage: RunV2LibraryUnitTests
94+
dependsOn: BuildV2Library
95+
jobs:
96+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
97+
parameters:
98+
PROJECT_NAME: 'Python V2 Library'
99+
PROJECT_DIRECTORY: 'runtimes/v2'
100+
PoolName: 1es-pool-azfunc
101101

102-
# # Python V1 Library Build and Test Stages
103-
# - stage: BuildV1Library
104-
# dependsOn: []
105-
# jobs:
106-
# - template: /eng/templates/official/jobs/build-library.yml@self
107-
# parameters:
108-
# PROJECT_NAME: 'Python V1 Library'
109-
# PROJECT_DIRECTORY: 'runtimes/v1'
110-
# ARTIFACT_NAME: 'azure-functions-runtime-v1'
111-
# - stage: RunV1LibraryUnitTests
112-
# dependsOn: BuildV1Library
113-
# jobs:
114-
# - template: /eng/templates/jobs/ci-library-unit-tests.yml@self
115-
# parameters:
116-
# PROJECT_NAME: 'Python V1 Library'
117-
# PROJECT_DIRECTORY: 'runtimes/v1'
118-
# PoolName: 1es-pool-azfunc
102+
# Python V1 Library Build and Test Stages
103+
- stage: BuildV1Library
104+
dependsOn: []
105+
jobs:
106+
- template: /eng/templates/official/jobs/build-library.yml@self
107+
parameters:
108+
PROJECT_NAME: 'Python V1 Library'
109+
PROJECT_DIRECTORY: 'runtimes/v1'
110+
ARTIFACT_NAME: 'azure-functions-runtime-v1'
111+
- stage: RunV1LibraryUnitTests
112+
dependsOn: BuildV1Library
113+
jobs:
114+
- template: /eng/templates/jobs/ci-library-unit-tests.yml@self
115+
parameters:
116+
PROJECT_NAME: 'Python V1 Library'
117+
PROJECT_DIRECTORY: 'runtimes/v1'
118+
PoolName: 1es-pool-azfunc

eng/ci/worker-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ extends:
5050
- template: /eng/templates/official/jobs/publish-library-release.yml@self
5151
parameters:
5252
PROJECT_DIRECTORY: 'runtimes/v2'
53+
VERSION_FILE: 'runtimes/v2/azure_functions_runtime/version.py'
5354
PROJECT_NAME: 'azure-functions-runtime'
5455
BRANCH_NAME: 'release-v2'
55-
TEST_BRANCH_NAME: 'test-release-v2'
5656
condition: eq(${{ parameters.V2LibraryRelease }}, True)
5757
- stage: ReleasePythonV1Library
5858
dependsOn: []
@@ -61,7 +61,7 @@ extends:
6161
- template: /eng/templates/official/jobs/publish-library-release.yml@self
6262
parameters:
6363
PROJECT_DIRECTORY: 'runtimes/v1'
64+
VERSION_FILE: 'runtimes/v1/azure_functions_runtime_v1/version.py'
6465
PROJECT_NAME: 'azure-functions-runtime-v1'
6566
BRANCH_NAME: 'release-v1'
66-
TEST_BRANCH_NAME: 'test-release-v1'
6767
condition: eq(${{ parameters.V1LibraryRelease }}, True)

eng/templates/jobs/ci-emulator-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
docker compose -f ${{ parameters.PROJECT_DIRECTORY }}/tests/emulator_tests/utils/eventhub/docker-compose.yml up -d
8989
displayName: 'Install Azurite and Start EventHub Emulator'
9090
- bash: |
91-
python -m pytest -q -n auto --dist loadfile --reruns 4 --ignore=tests/emulator_tests/test_servicebus_functions.py tests/emulator_tests
91+
python -m pytest -q --dist loadfile --reruns 4 --ignore=tests/emulator_tests/test_servicebus_functions.py tests/emulator_tests
9292
env:
9393
AzureWebJobsStorage: "UseDevelopmentStorage=true"
9494
AzureWebJobsEventHubConnectionString: $(EmulatorEventHubConnectionString)
@@ -107,7 +107,7 @@ jobs:
107107
AzureWebJobsSQLPassword: $(AzureWebJobsSQLPassword)
108108
displayName: 'Install Azurite and Start ServiceBus Emulator'
109109
- bash: |
110-
python -m pytest -q -n auto --dist loadfile --reruns 4 tests/emulator_tests/test_servicebus_functions.py
110+
python -m pytest -q --dist loadfile --reruns 4 tests/emulator_tests/test_servicebus_functions.py
111111
env:
112112
AzureWebJobsStorage: "UseDevelopmentStorage=true"
113113
AzureWebJobsServiceBusConnectionString: $(EmulatorServiceBusConnectionString)

eng/templates/jobs/ci-library-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }}
3030
displayName: 'Install dependencies'
3131
- bash: |
32-
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./${{ parameters.PROJECT_DIRECTORY }} --cov-report xml --cov-branch tests/unittests
32+
python -m pytest -q --dist loadfile --reruns 4 --instafail --cov=./${{ parameters.PROJECT_DIRECTORY }} --cov-report xml --cov-branch tests/unittests
3333
displayName: "Running $(PYTHON_VERSION) Unit Tests"
3434
env:
3535
AzureWebJobsStorage: $(LinuxStorageConnectionString312)

eng/templates/jobs/ci-unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ jobs:
5151
5252
if [ "$PY_MINOR" -ge 13 ]; then
5353
echo "Running proxy_worker tests (Python >= 3.13)..."
54-
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail \
54+
python -m pytest -q --dist loadfile --reruns 4 --instafail \
5555
--cov=./proxy_worker --cov-report xml --cov-branch tests/unittest_proxy
5656
else
5757
echo "Running unittests (Python < 3.13)..."
58-
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail \
58+
python -m pytest -q --dist loadfile --reruns 4 --instafail \
5959
--cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests
6060
fi
6161
displayName: "Running $(PYTHON_VERSION) Unit Tests"

eng/templates/official/jobs/ci-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
Write-Host "skipTest: $(skipTest)"
154154
displayName: 'Display skipTest variable'
155155
- bash: |
156-
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
156+
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
157157
env:
158158
AzureWebJobsStorage: $(STORAGE_CONNECTION)
159159
AzureWebJobsCosmosDBConnectionString: $(COSMOSDB_CONNECTION)

eng/templates/official/jobs/ci-lc-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
displayName: 'Display CONTAINER_SAS_TOKEN variable'
101101
102102
- bash: |
103-
python -m pytest -n auto --dist loadfile -vv --instafail tests/consumption_tests
103+
python -m pytest --dist loadfile -vv --instafail tests/consumption_tests
104104
env:
105105
AzureWebJobsStorage: $(AZURE_STORAGE_CONNECTION_STRING)
106106
_DUMMY_CONT_KEY: $(_DUMMY_CONT_KEY)

eng/templates/official/jobs/publish-library-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
parameters:
22
PROJECT_DIRECTORY: ''
3+
VERSION_FILE: ''
34
PROJECT_NAME: ''
45
BRANCH_NAME: ''
5-
TEST_BRANCH_NAME: ''
6-
76

87
jobs:
98

@@ -17,6 +16,7 @@ jobs:
1716
- template: /eng/templates/shared/github-release-branch.yml@self
1817
parameters:
1918
PROJECT_DIRECTORY: ${{ parameters.PROJECT_DIRECTORY }}
19+
VERSION_FILE: ${{ parameters.VERSION_FILE }}
2020
BRANCH_NAME: ${{ parameters.BRANCH_NAME }}
2121

2222
- job: "CheckReleaseBranch"

eng/templates/shared/github-release-branch.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
parameters:
22
PROJECT_DIRECTORY: ''
3+
VERSION_FILE: ''
34
BRANCH_NAME: ''
5+
PROJECT_NAME: ''
46

57
steps:
68
- powershell: |
79
$githubToken = "$(GithubPat)"
810
$newWorkerVersion = "$(NewWorkerVersion)"
9-
$versionFile = "${{ parameters.PROJECT_DIRECTORY}}/version.py"
11+
$versionFile = "${{ parameters.VERSION_FILE}}"
1012
$newBranch = "${{ parameters.BRANCH_NAME}}/$newWorkerVersion"
1113
1214
if ($newWorkerVersion -match '^(\d+)\.(\d+)\.(\d+)([a-zA-Z0-9\-\.]*)?$') {
@@ -20,13 +22,13 @@ steps:
2022
git checkout -b "$newBranch"
2123
2224
# Runtime Release Only
23-
if (${{ parameters.PROJECT_DIRECTORY}} -ne "workers")
25+
if ("${{ parameters.PROJECT_DIRECTORY}}" -ne "workers")
2426
{
2527
# Modify Runtime Version in workers/pyproject.toml
2628
Write-Host "Replacing Runtime version in worker's pyproject.toml"
2729
((Get-Content workers/pyproject.toml) -replace '"${{ parameters.PROJECT_NAME }}==[^";]+', "`"${{ parameters.PROJECT_NAME }}==$newLibraryVersion") -join "`n" | Set-Content -NoNewline workers/pyproject.toml
2830
29-
# Change ${{ parameters.PROJECT_DIRECTORY}}/version.py version
31+
# Change $versionFile version
3032
Write-Host "Change version number in version.py to $newWorkerVersion"
3133
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $versionFile
3234
@@ -35,18 +37,20 @@ steps:
3537
}
3638
3739
# Worker Release Only
38-
if (${{ parameters.PROJECT_DIRECTORY}} -eq "workers")
40+
if ("${{ parameters.PROJECT_DIRECTORY}}" -eq "workers")
3941
{
4042
# Change azure_functions_worker version
41-
Write-Host "Change version number in version.py to $newWorkerVersion"
42-
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline ${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py
43+
Write-Host "Change azure_functions_worker version to $newWorkerVersion"
44+
$afwVersionFile = "${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py"
45+
((Get-Content $afwVersionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $afwVersionFile
4346
4447
# Change proxy_worker version
45-
Write-Host "Change version number in version.py to $newWorkerVersion"
46-
((Get-Content $versionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline ${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py
48+
Write-Host "Change proxy_worker version to $newWorkerVersion"
49+
$proxyVersionFile = "${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py"
50+
((Get-Content $proxyVersionFile) -replace "VERSION = '(\d+).(\d+).*'", "VERSION = '$newWorkerVersion'" -join "`n") + "`n" | Set-Content -NoNewline $proxyVersionFile
4751
48-
git add ${{ parameters.PROJECT_DIRECTORY}}/azure_functions_worker/version.py
49-
git add ${{ parameters.PROJECT_DIRECTORY}}/proxy_worker/version.py
52+
git add $afwVersionFile
53+
git add $proxyVersionFile
5054
}
5155
5256
git commit -m "build: update ${{ parameters.PROJECT_DIRECTORY}} version to $newWorkerVersion"

runtimes/v1/tests/unittests/test_datumdef.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def test_parse_cookie_attr_same_site_explicit_none(self):
6767
def test_parse_to_rpc_http_cookie_list_none(self):
6868
self.assertEqual(parse_to_rpc_http_cookie_list(None, protos), None)
6969

70-
@unittest.skip("TODO: fix this test. Figure out what to do with Timestamp")
7170
def test_parse_to_rpc_http_cookie_list_valid(self):
7271
headers = [
7372
'foo=bar; Path=/some/path; Secure; HttpOnly; Domain=123; '

0 commit comments

Comments
 (0)