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

Merged
merged 41 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
72941ff
Merge branch 'dev' of https://github.com/Azure/azure-functions-python…
hallvictoria Nov 4, 2024
f73ce51
run emulator tests on schedule, lowercase config
hallvictoria Nov 4, 2024
37d0fbb
merge conflict
Dec 4, 2024
f3117c2
merge miss
Dec 4, 2024
a415089
merge miss
Dec 4, 2024
40ce8b4
Merge branch 'dev' of https://github.com/Azure/azure-functions-python…
Dec 18, 2024
5f6e2a9
move servicebus tests to emulators
Dec 18, 2024
7e3b79c
parameter miss
Dec 18, 2024
b262797
formatting
Dec 18, 2024
23ea45c
merge miss
Dec 18, 2024
584e8e4
lint
Dec 18, 2024
a150fe7
feedback
hallvictoria Dec 19, 2024
463d4eb
container name
hallvictoria Dec 19, 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
46 changes: 46 additions & 0 deletions eng/ci/emulator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
trigger: none # ensure this is not ran as a CI build
hallvictoria marked this conversation as resolved.
Show resolved Hide resolved

pr:
branches:
include:
- dev
- release/*

schedules:
- cron: "0 8 * * 1,2,3,4,5"
displayName: Monday to Friday 3 AM CST build
branches:
include:
- dev
always: true

resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: eng
type: git
name: engineering
ref: refs/tags/release

variables:
- template: /ci/variables/build.yml@eng
- template: /ci/variables/cfs.yml@eng
- template: /eng/templates/utils/variables.yml@self

extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows

stages:
- stage: RunEmulatorTests
jobs:
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
parameters:
PoolName: 1es-pool-azfunc
6 changes: 6 additions & 0 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ extends:
dependsOn: Build
jobs:
- template: /eng/templates/official/jobs/ci-e2e-tests.yml@self
- stage: RunEmulatorTests
dependsOn: Build
jobs:
- template: /eng/templates/jobs/ci-emulator-tests.yml@self
parameters:
PoolName: 1es-pool-azfunc
- stage: RunUnitTests
dependsOn: Build
jobs:
Expand Down
8 changes: 7 additions & 1 deletion eng/ci/public-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ 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
parameters:
PoolName: 1es-pool-azfunc-public
100 changes: 100 additions & 0 deletions eng/templates/jobs/ci-emulator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
jobs:
- job: "TestPython"
displayName: "Run Python Emulator Tests"

pool:
name: ${{ parameters.PoolName }}
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/eventhub/docker-compose.yml pull
docker compose -f 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
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
displayName: "Running $(PYTHON_VERSION) Python Linux Emulator Tests"
- bash: |
# Stop and remove EventHub Emulator container to free up the port
docker stop eventhubs-emulator
docker container rm --force eventhubs-emulator
docker compose -f tests/emulator_tests/utils/servicebus/docker-compose.yml pull
docker compose -f tests/emulator_tests/utils/servicebus/docker-compose.yml up -d
env:
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
env:
AzureWebJobsStorage: "UseDevelopmentStorage=true"
AzureWebJobsServiceBusConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
displayName: "Running $(PYTHON_VERSION) Python ServiceBus Linux Emulator Tests"
Loading
Loading