Skip to content

Commit

Permalink
Cosmos Pipeline Refactor (#7227)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
danieljurek authored Sep 12, 2019
1 parent 977cbda commit 56c39bb
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 214 deletions.
5 changes: 4 additions & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
MaxParallel: 0
BeforeTestSteps: []
BuildTargetingString: 'azure-*'
TestMarkArgument: ''
Matrix:
Linux_Python35:
OSName: 'Linux'
Expand All @@ -22,6 +23,7 @@ jobs:
- job: 'Test'
variables:
skipComponentGovernanceDetection: true
CoverageArg: --disablecov

timeoutInMinutes: 120
strategy:
Expand All @@ -37,9 +39,10 @@ jobs:
parameters:
BuildTargetingString: ${{ parameters.BuildTargetingString }}
ServiceDirectory: ${{ parameters.ServiceDirectory }}
CoverageArg: '--disablecov'
CoverageArg: $(CoverageArg)
EnvVars: ${{ parameters.EnvVars }}
BeforeTestSteps: ${{ parameters.BeforeTestSteps }}
PythonVersion: $(PythonVersion)
OSName: $(OSName)
ToxTestEnv: "whl"
TestMarkArgument: ${{ parameters.TestMarkArgument }}
44 changes: 44 additions & 0 deletions eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
parameters:
Artifacts: []
ServiceDirectory: not-specified
EmulatorMsiUrl: 'https://aka.ms/cosmosdb-emulator'
EmulatorStartParameters: ''

stages:
- stage: Build
jobs:
- template: ../jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
# Skip emulator tests in the CI run
TestMarkArgument: not cosmosEmulator

- job: Emulator
strategy:
matrix:
Windows_Python35:
OSVmImage: 'windows-2019'
OSName: Windows
PythonVersion: '3.5'
Windows_Python27:
OSVmImage: 'windows-2019'
OSName: Windows
PythonVersion: '2.7'
pool:
vmImage: $(OSVmImage)

steps:
- template: eng/pipelines/templates/steps/cosmos-emulator.yml@azure-sdk-tools
parameters:
EmulatorMsiUrl: ${{ parameters.EmulatorMsiUrl }}
StartParameters: ${{ parameters.EmulatorStartParameters }}

- template: ../steps/build-test.yml
parameters:
TestMarkArgument: not globaldb
EnvVars:
ACCOUNT_HOST: https://localhost:8081/
ServiceDirectory: ${{ parameters.ServiceDirectory }}
PythonVersion: $(PythonVersion)
OSName: $(OSName)
ToxTestEnv: 'whl,sdist'
105 changes: 0 additions & 105 deletions sdk/cosmos/.azure-pipelines/cosmos.live.yml

This file was deleted.

103 changes: 0 additions & 103 deletions sdk/cosmos/.azure-pipelines/cosmos.test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from azure.cosmos import _retry_utility
import test_config

pytestmark = pytest.mark.cosmosEmulator
pytestmark = [pytest.mark.cosmosEmulator, pytest.mark.globaldb]

location_changed = False

Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos/test/globaldb_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes
import test_config

pytestmark = pytest.mark.cosmosEmulator
pytestmark = [pytest.mark.cosmosEmulator, pytest.mark.globaldb]

#IMPORTANT NOTES:

Expand Down
12 changes: 9 additions & 3 deletions sdk/cosmos/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# DO NOT EDIT THIS FILE
# This file is generated automatically and any changes will be lost.

resources:
repositories:
- repository: azure-sdk-tools
type: github
name: Azure/azure-sdk-tools
endpoint: azure

trigger:
branches:
include:
Expand All @@ -21,8 +28,7 @@ pr:
include:
- sdk/cosmos/

jobs:
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-client.yml
stages:
- template: ../../eng/pipelines/templates/stages/cosmos-sdk-client.yml
parameters:
ServiceDirectory: cosmos
TestMarkArgument: not cosmosEmulator
28 changes: 28 additions & 0 deletions sdk/cosmos/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
trigger: none

jobs:
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml
parameters:
MaxParallel: 1
Matrix:
Linux_Python35:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
PythonVersion: '3.5'
MacOs_Python37:
OSName: 'MacOS'
OSVmImage: 'macOS-10.14'
PythonVersion: '3.7'
Windows_Python27:
OSName: 'Windows'
OSVmImage: 'windows-2019'
PythonVersion: '2.7'
Linux_Pypy3:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
PythonVersion: 'pypy3'
ServiceDirectory: cosmos
TestMarkArgument: not globaldb
EnvVars:
ACCOUNT_KEY: $(python-cosmos-live-account-key)
ACCOUNT_HOST: $(python-cosmos-live-account-host)

0 comments on commit 56c39bb

Please sign in to comment.