Skip to content

Commit 56c39bb

Browse files
authored
Cosmos Pipeline Refactor (Azure#7227)
* add emulator to ci.yml * mark globaldb tests, try removing emulator from live tests * use the accepted gating cosmos emulator url * live tests * remove redundant BuildTargetingString * make coverage arg into a variable because of build-test.yml's construction * remove extra comment, extra templates don't add value here given that this file is cosmos-specific already * remove old cosmos pipelines * remove extra comment
1 parent 977cbda commit 56c39bb

File tree

8 files changed

+87
-214
lines changed

8 files changed

+87
-214
lines changed

eng/pipelines/templates/jobs/archetype-sdk-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parameters:
44
MaxParallel: 0
55
BeforeTestSteps: []
66
BuildTargetingString: 'azure-*'
7+
TestMarkArgument: ''
78
Matrix:
89
Linux_Python35:
910
OSName: 'Linux'
@@ -22,6 +23,7 @@ jobs:
2223
- job: 'Test'
2324
variables:
2425
skipComponentGovernanceDetection: true
26+
CoverageArg: --disablecov
2527

2628
timeoutInMinutes: 120
2729
strategy:
@@ -37,9 +39,10 @@ jobs:
3739
parameters:
3840
BuildTargetingString: ${{ parameters.BuildTargetingString }}
3941
ServiceDirectory: ${{ parameters.ServiceDirectory }}
40-
CoverageArg: '--disablecov'
42+
CoverageArg: $(CoverageArg)
4143
EnvVars: ${{ parameters.EnvVars }}
4244
BeforeTestSteps: ${{ parameters.BeforeTestSteps }}
4345
PythonVersion: $(PythonVersion)
4446
OSName: $(OSName)
4547
ToxTestEnv: "whl"
48+
TestMarkArgument: ${{ parameters.TestMarkArgument }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
parameters:
2+
Artifacts: []
3+
ServiceDirectory: not-specified
4+
EmulatorMsiUrl: 'https://aka.ms/cosmosdb-emulator'
5+
EmulatorStartParameters: ''
6+
7+
stages:
8+
- stage: Build
9+
jobs:
10+
- template: ../jobs/archetype-sdk-client.yml
11+
parameters:
12+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
13+
# Skip emulator tests in the CI run
14+
TestMarkArgument: not cosmosEmulator
15+
16+
- job: Emulator
17+
strategy:
18+
matrix:
19+
Windows_Python35:
20+
OSVmImage: 'windows-2019'
21+
OSName: Windows
22+
PythonVersion: '3.5'
23+
Windows_Python27:
24+
OSVmImage: 'windows-2019'
25+
OSName: Windows
26+
PythonVersion: '2.7'
27+
pool:
28+
vmImage: $(OSVmImage)
29+
30+
steps:
31+
- template: eng/pipelines/templates/steps/cosmos-emulator.yml@azure-sdk-tools
32+
parameters:
33+
EmulatorMsiUrl: ${{ parameters.EmulatorMsiUrl }}
34+
StartParameters: ${{ parameters.EmulatorStartParameters }}
35+
36+
- template: ../steps/build-test.yml
37+
parameters:
38+
TestMarkArgument: not globaldb
39+
EnvVars:
40+
ACCOUNT_HOST: https://localhost:8081/
41+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
42+
PythonVersion: $(PythonVersion)
43+
OSName: $(OSName)
44+
ToxTestEnv: 'whl,sdist'

sdk/cosmos/.azure-pipelines/cosmos.live.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.

sdk/cosmos/.azure-pipelines/cosmos.test.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from azure.cosmos import _retry_utility
3333
import test_config
3434

35-
pytestmark = pytest.mark.cosmosEmulator
35+
pytestmark = [pytest.mark.cosmosEmulator, pytest.mark.globaldb]
3636

3737
location_changed = False
3838

sdk/cosmos/azure-cosmos/test/globaldb_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes
3636
import test_config
3737

38-
pytestmark = pytest.mark.cosmosEmulator
38+
pytestmark = [pytest.mark.cosmosEmulator, pytest.mark.globaldb]
3939

4040
#IMPORTANT NOTES:
4141

sdk/cosmos/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# DO NOT EDIT THIS FILE
22
# This file is generated automatically and any changes will be lost.
33

4+
resources:
5+
repositories:
6+
- repository: azure-sdk-tools
7+
type: github
8+
name: Azure/azure-sdk-tools
9+
endpoint: azure
10+
411
trigger:
512
branches:
613
include:
@@ -21,8 +28,7 @@ pr:
2128
include:
2229
- sdk/cosmos/
2330

24-
jobs:
25-
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-client.yml
31+
stages:
32+
- template: ../../eng/pipelines/templates/stages/cosmos-sdk-client.yml
2633
parameters:
2734
ServiceDirectory: cosmos
28-
TestMarkArgument: not cosmosEmulator

sdk/cosmos/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
trigger: none
2+
3+
jobs:
4+
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml
5+
parameters:
6+
MaxParallel: 1
7+
Matrix:
8+
Linux_Python35:
9+
OSName: 'Linux'
10+
OSVmImage: 'ubuntu-16.04'
11+
PythonVersion: '3.5'
12+
MacOs_Python37:
13+
OSName: 'MacOS'
14+
OSVmImage: 'macOS-10.14'
15+
PythonVersion: '3.7'
16+
Windows_Python27:
17+
OSName: 'Windows'
18+
OSVmImage: 'windows-2019'
19+
PythonVersion: '2.7'
20+
Linux_Pypy3:
21+
OSName: 'Linux'
22+
OSVmImage: 'ubuntu-16.04'
23+
PythonVersion: 'pypy3'
24+
ServiceDirectory: cosmos
25+
TestMarkArgument: not globaldb
26+
EnvVars:
27+
ACCOUNT_KEY: $(python-cosmos-live-account-key)
28+
ACCOUNT_HOST: $(python-cosmos-live-account-host)

0 commit comments

Comments
 (0)