Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run supported tests with emulators #1564

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b6d16f6
run emulators for blob tests
Jul 3, 2024
6623726
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Aug 16, 2024
c4e3529
Merge branch 'dev' of https://github.com/Azure/azure-functions-python…
Aug 16, 2024
76197a2
blob, table, queue working. large refactor
Aug 16, 2024
f813c1f
Merge branch 'hallvictoria/emulators' of https://github.com/Azure/azu…
Aug 16, 2024
9899abf
directory changes
hallvictoria Aug 19, 2024
e6226f7
fix: public build, generic table creation, eh config
Aug 20, 2024
4aa4547
docker-compose
Aug 20, 2024
5db919a
emulator support
hallvictoria Aug 26, 2024
3ac2420
Merge branch 'hallvictoria/emulators' of https://github.com/Azure/azu…
hallvictoria Aug 26, 2024
a4bdeb2
skip eventhub metadata tests for 37
Aug 28, 2024
ea88ce4
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Aug 30, 2024
5d2c24a
run db blob tests in emulator
Aug 30, 2024
90ebd53
db blob tests dir change
Aug 30, 2024
8e27a26
Merge branch 'dev' of https://github.com/Azure/azure-functions-python…
Aug 30, 2024
f82778c
fix db test directory
Aug 30, 2024
67a0fa6
Merge branch 'dev' of https://github.com/Azure/azure-functions-python…
Sep 3, 2024
9775a97
merge
Sep 3, 2024
9675607
run emulator tests for 312
Sep 3, 2024
cd2bc31
remove git repo clone
Sep 4, 2024
984f819
refactor docker-compose, codeowners
Sep 12, 2024
9cfb04f
retries for flaky tests
Sep 12, 2024
572dfdd
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Sep 13, 2024
a62cc7e
Merge branch 'dev' into hallvictoria/emulators
YunchuWang Sep 19, 2024
e7c9c25
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Sep 27, 2024
923cf7a
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Oct 8, 2024
10d7df4
Merge branch 'dev' into hallvictoria/emulators
hallvictoria Oct 15, 2024
68f1a92
update codeowners
Oct 16, 2024
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
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# For all file changes, github would automatically
# include the following people in the PRs.

* @vrdmr @gavin-aguiar @YunchuWang @pdthummar @hallvictoria
* @vrdmr @gavin-aguiar @hallvictoria
4 changes: 4 additions & 0 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ extends:
dependsOn: Build
jobs:
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
- stage: RunEmulatorTests
dependsOn: Build
jobs:
- template: /eng/templates/official/jobs/ci-emulator-tests.yml@self
- stage: RunUnitTests
dependsOn: Build
jobs:
Expand Down
6 changes: 5 additions & 1 deletion eng/ci/public-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ extends:
- stage: RunUnitTests
dependsOn: Build
jobs:
- template: /eng/templates/jobs/ci-unit-tests.yml@self
- template: /eng/templates/jobs/ci-unit-tests.yml@self
- stage: RunEmulatorTests
dependsOn: Build
jobs:
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
85 changes: 85 additions & 0 deletions eng/templates/jobs/ci-emulator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
jobs:
- job: "TestPython"
displayName: "Run Python Emulator Tests"

pool:
name: 1es-pool-azfunc-public
image: 1es-ubuntu-22.04
os: linux

strategy:
matrix:
Python37:
PYTHON_VERSION: '3.7'
Python38:
PYTHON_VERSION: '3.8'
Python39:
PYTHON_VERSION: '3.9'
Python310:
PYTHON_VERSION: '3.10'
Python311:
PYTHON_VERSION: '3.11'
Python312:
PYTHON_VERSION: '3.12'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
- task: UseDotNet@2
displayName: 'Install .NET 8'
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 $(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))
- 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: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
- bash: |
chmod +x eng/scripts/test-sdk.sh
chmod +x eng/scripts/test-setup.sh

eng/scripts/test-sdk.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
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
displayName: 'Download Python Extension Artifact'
inputs:
buildType: specific
artifactName: $(PYTHONEXTENSIONNAME)
project: 'internal'
definition: 798
buildVersionToDownload: latest
targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact'
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
- bash: |
chmod +x eng/scripts/test-setup.sh
chmod +x eng/scripts/test-extensions.sh

eng/scripts/test-extensions.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
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: |
docker compose -f tests/emulator_tests/utils/docker-compose.yml pull
docker compose -f tests/emulator_tests/utils/docker-compose.yml up -d
displayName: 'Install Azurite and Start Emulators'
- bash: |
python -m pytest -q -n auto --dist loadfile --reruns 4 tests/emulator_tests
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
displayName: "Running $(PYTHON_VERSION) Python Emulator Tests"
85 changes: 85 additions & 0 deletions eng/templates/official/jobs/ci-emulator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
jobs:
- job: "TestPython"
displayName: "Run Python Emulator Tests"

pool:
name: 1es-pool-azfunc
image: 1es-ubuntu-22.04
os: linux

strategy:
matrix:
Python37:
PYTHON_VERSION: '3.7'
Python38:
PYTHON_VERSION: '3.8'
Python39:
PYTHON_VERSION: '3.9'
Python310:
PYTHON_VERSION: '3.10'
Python311:
PYTHON_VERSION: '3.11'
Python312:
PYTHON_VERSION: '3.12'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
- task: UseDotNet@2
displayName: 'Install .NET 8'
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 $(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))
- 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: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
- bash: |
chmod +x eng/scripts/test-sdk.sh
chmod +x eng/scripts/test-setup.sh

eng/scripts/test-sdk.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
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
displayName: 'Download Python Extension Artifact'
inputs:
buildType: specific
artifactName: $(PYTHONEXTENSIONNAME)
project: 'internal'
definition: 798
buildVersionToDownload: latest
targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact'
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
- bash: |
chmod +x eng/scripts/test-setup.sh
chmod +x eng/scripts/test-extensions.sh

eng/scripts/test-extensions.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
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: |
docker compose -f tests/emulator_tests/utils/docker-compose.yml pull
docker compose -f tests/emulator_tests/utils/docker-compose.yml up -d
displayName: 'Install Azurite and Start Emulators'
- bash: |
python -m pytest -q -n auto --dist loadfile --reruns 4 tests/emulator_tests
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
displayName: "Running $(PYTHON_VERSION) Python Emulator Tests"
Loading
Loading