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

Experimenting with cosmos emulator CI #33446

Closed
Closed
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
54 changes: 14 additions & 40 deletions eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,27 @@ parameters:
- name: ServiceDirectory
type: string
default: not-specified
- name: EmulatorMsiUrl
type: string
default: https://aka.ms/cosmosdb-emulator
- name: InjectedPackages
type: string
default: ''
- name: EmulatorStartParameters
type: string
default: ''
- name: TestProxy
type: boolean
default: false

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
# Skip emulator tests in the CI run
TestMarkArgument: not cosmosEmulator
InjectedPackages: ${{parameters.InjectedPackages}}
Artifacts: ${{parameters.Artifacts}}

# - stage: Test_Emulator
# dependsOn: []
# jobs:
# - job: Emulator
# strategy:
# matrix:
# Windows_Python36:
# OSVmImage: 'windows-2022'
# PythonVersion: '3.6'
# pool:
# vmImage: $(OSVmImage)
#
# steps:
# - template: /eng/common/pipelines/templates/steps/cosmos-emulator.yml
# parameters:
# EmulatorMsiUrl: ${{ parameters.EmulatorMsiUrl }}
# StartParameters: ${{ parameters.EmulatorStartParameters }}
#
# - template: /eng/pipelines/templates/steps/build-test.yml
# parameters:
# TestMarkArgument: not globaldb
# EnvVars:
# ACCOUNT_HOST: https://localhost:8081/
# ServiceDirectory: ${{ parameters.ServiceDirectory }}
# PythonVersion: $(PythonVersion)
# OSVmImage: $(OSVmImage)
# ToxTestEnv: 'whl,sdist'
# InjectedPackages: ${{parameters.InjectedPackages}}
ServiceDirectory: cosmos
BeforeTestSteps:
- template: /eng/common/pipelines/templates/steps/cosmos-emulator.yml
parameters:
StartParameters: '/noexplorer /noui /enablepreview /EnableSqlComputeEndpoint /SqlComputePort=9999 /disableratelimiting /partitioncount=50 /consistency=Session'
# TestMarkArgument: not cosmosEmulator
MatrixConfigs:
- Name: Python_cosmos_emulator
Path: sdk/cosmos/cosmos-emulator-matrix.json
Selection: all
GenerateVMJobs: true
Artifacts:
- name: azure-cosmos
safeName: azurecosmos
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos/test/test_crud_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ async def _set_up(cls):
test_config._test_config.TEST_DATABASE_ID)

async def _clear(self):
print("Clearing databases")
async for db in self.client.list_databases():
self.client.delete_database(db["id"])

Expand Down
68 changes: 68 additions & 0 deletions sdk/cosmos/cosmos-emulator-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"displayNames": {
"--disablecov": "",
"false": "",
"true": ""
},
"matrix": {
"Agent": {
"windows-2022": { "OSVmImage": "MMS2022", "Pool": "azsdk-pool-mms-win-2022-general" }
},
"EmulatorConfig": {
"Emulator Tests Python 3.7": {
"PythonVersion": 3.7,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
},
"Emulator Tests Python 3.8": {
"PythonVersion": 3.8,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
},
"Emulator Tests Python 3.9": {
"PythonVersion": 3.9,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
},
"Emulator Tests Python 3.10": {
"PythonVersion": 3.10,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
},
"Emulator Tests Python 3.11": {
"PythonVersion": 3.11,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
},
"Emulator Tests Python 3.12": {
"PythonVersion": 3.12,
"CoverageArg": "--disablecov",
"TestSamples": "false",
"ToxTestEnv": "'whl,sdist'",
"ACCOUNT_HOST": "https://localhost:8081/",
"ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Skip.Analyze": "true"
}
}
}
}
Loading