-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Pipeline updates Added nightly build pipeline Added template to run tests against minimum supported AZ CLI * Pipeline parameter refactoring * Moved deprecated ubuntu images to `ubuntu-latest` Co-authored-by: Paymaun <[email protected]>
- Loading branch information
Showing
7 changed files
with
253 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Run nightly at midnight. | ||
schedules: | ||
- cron: "0 0 * * *" | ||
displayName: Nightly Integration Build | ||
branches: | ||
include: | ||
- dev | ||
|
||
variables: | ||
pythonVersion: '3.6.x' | ||
architecture: 'x64' | ||
|
||
stages: | ||
- stage: 'build' | ||
displayName: 'Build and Publish Artifacts' | ||
jobs: | ||
|
||
- job: 'Build_Publish_Azure_IoT_CLI_Extension' | ||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: $(pythonVersion) | ||
architecture: $(architecture) | ||
|
||
- template: templates/setup-ci-machine.yml | ||
|
||
- template: templates/build-publish-azure-iot-cli-extension.yml | ||
|
||
- job: 'Build_Publish_Azure_CLI_Test_SDK' | ||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: $(pythonVersion) | ||
architecture: $(architecture) | ||
|
||
- template: templates/setup-ci-machine.yml | ||
|
||
- template: templates/build-publish-azure-cli-test-sdk.yml | ||
|
||
- job: 'recordVersion' | ||
displayName: 'Install and verify version' | ||
dependsOn: [Build_Publish_Azure_IoT_CLI_Extension, Build_Publish_Azure_CLI_Test_SDK] | ||
steps: | ||
- template: templates/setup-dev-test-env.yml | ||
parameters: | ||
pythonVersion: $(pythonVersion) | ||
architecture: $(architecture) | ||
|
||
- template: templates/install-and-record-version.yml | ||
|
||
- stage: 'test' | ||
displayName: 'Run all tests' | ||
pool: | ||
vmImage: 'ubuntu-latest' | ||
dependsOn: build | ||
jobs: | ||
- job: 'azEdge' | ||
displayName: 'Test against edge AZ CLI' | ||
steps: | ||
- template: templates/nightly-tests.yml | ||
parameters: | ||
azureCLIVersion: 'edge' | ||
- job: 'azMin' | ||
dependsOn: 'azEdge' | ||
displayName: 'Test against minimum supported AZ CLI' | ||
steps: | ||
- template: templates/nightly-tests.yml | ||
parameters: | ||
azureCLIVersion: 'min' | ||
|
||
- stage: 'kpi' | ||
displayName: 'Build KPIs' | ||
dependsOn: [build, test] | ||
jobs: | ||
- job: 'calculateCodeCoverage' | ||
displayName: 'Calculate distributed code coverage' | ||
steps: | ||
- template: templates/calculate-code-coverage.yml | ||
parameters: | ||
pythonVersion: $(pythonVersion) | ||
architecture: $(architecture) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
steps: | ||
- task: PythonScript@0 | ||
displayName: 'Check minimum supported version of Azure CLI' | ||
inputs: | ||
scriptSource: 'inline' | ||
script: | | ||
import json | ||
with open("$(System.DefaultWorkingDirectory)/azext_iot/azext_metadata.json") as f: | ||
metadata = json.load(f) | ||
version = metadata['azext.minCliCoreVersion'] | ||
print('##vso[task.setvariable variable=min_cli_version]{}'.format(version)) | ||
- bash: | | ||
pip install azure-cli==$(min_cli_version) | ||
displayName: "Install minimum supported CLI version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
parameters: | ||
- name: pythonVersion | ||
type: string | ||
default: '3.6.x' | ||
- name: architecture | ||
type: string | ||
default: 'x64' | ||
- name: azureCLIVersion | ||
type: string | ||
default: released | ||
values: | ||
- min | ||
- released | ||
- edge | ||
|
||
steps: | ||
- template: setup-dev-test-env.yml | ||
parameters: | ||
architecture: ${{ parameters.architecture }} | ||
pythonVersion: ${{ parameters.pythonVersion }} | ||
azureCLIVersion: ${{ parameters.azureCLIVersion }} | ||
|
||
- template: set-testenv-sentinel.yml | ||
|
||
- script: | | ||
pytest -vv azext_iot/tests -k "_unit" --cov=azext_iot --cov-config .coveragerc --junitxml=junit/test-iotext-unit.xml | ||
displayName: 'All unit tests' | ||
env: | ||
COVERAGE_FILE: .coverage.all | ||
- task: AzureCLI@2 | ||
continueOnError: true | ||
displayName: 'All integration tests' | ||
inputs: | ||
azureSubscription: az-cli-nightly | ||
scriptType: bash | ||
scriptLocation: inlineScript | ||
inlineScript: | | ||
export COVERAGE_FILE=.coverage.all | ||
pytest -vv azext_iot/tests -k "_int" --cov=azext_iot --cov-config .coveragerc --junitxml=junit/test-iotext-int.xml | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathToPublish: .coverage.all | ||
publishLocation: 'Container' | ||
artifactName: 'coverage' | ||
|
||
- task: PublishTestResults@2 | ||
condition: succeededOrFailed() | ||
displayName: 'Publish Test Results' | ||
inputs: | ||
testResultsFormat: 'JUnit' | ||
testResultsFiles: '**/test-*.xml' | ||
testRunTitle: 'Publish test results for Python ${{ parameters.pythonVersion }} on OS $(Agent.OS)' | ||
searchFolder: '$(System.DefaultWorkingDirectory)' |
Oops, something went wrong.