Skip to content

Commit

Permalink
Pipeline updates (#437)
Browse files Browse the repository at this point in the history
Pipeline improvements

* Added python versioning parameters to nightly pipeline

* Added test enable/disable switches to nightly pipeline

* Added windows MSI test environment to nightly pipeline

* Modified nightly parameter defaults

* Remove azure subscription parameter - use 'AzureServiceConnection' value from variable group

* Remove azure-cli edge tests

* Parameterize variable group in create-release pipeline
  • Loading branch information
c-ryan-k authored Sep 29, 2021
1 parent 3d8e578 commit 71f3f32
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 42 deletions.
14 changes: 6 additions & 8 deletions .azure-devops/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ pr: none
trigger: none

parameters:
- name: variableGroup
type: string
default: 'aziotcli_test_primary'
- name: vmImage
type: string
default: 'ubuntu-18.04'
Expand Down Expand Up @@ -31,9 +34,9 @@ parameters:
- name: 'testHub'
type: boolean
default: true
- name: azureSubscription
type: string
default: 'AzIoTCLIService'

variables:
- group: ${{ parameters.variableGroup }}

stages:
- stage: 'build'
Expand Down Expand Up @@ -93,7 +96,6 @@ stages:
parameters:
path: 'azext_iot/tests/central'
name: 'iot-central'
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testADT'
Expand All @@ -104,7 +106,6 @@ stages:
parameters:
path: 'azext_iot/tests/digitaltwins'
name: 'azure-digitaltwins'
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testDPS'
Expand All @@ -115,7 +116,6 @@ stages:
parameters:
path: 'azext_iot/tests/dps'
name: 'device-provisioning-service'
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testHub_job_1'
Expand All @@ -126,7 +126,6 @@ stages:
parameters:
path: 'azext_iot/tests/iothub/configurations azext_iot/tests/iothub/core azext_iot/tests/iothub/jobs'
name: 'iot-hub-1'
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testHub_job_2'
Expand All @@ -137,7 +136,6 @@ stages:
parameters:
path: 'azext_iot/tests/iothub/devices azext_iot/tests/iothub/messaging azext_iot/tests/iothub/modules'
name: 'iot-hub-2'
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'unitTests'
Expand Down
68 changes: 50 additions & 18 deletions .azure-devops/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
# Run nightly at midnight.
# Run nightly at midnight (Pacific).
schedules:
- cron: "0 0 * * *"
- cron: "0 7 * * *"
displayName: Nightly Integration Build
branches:
include:
- dev

variables:
pythonVersion: '3.6.x'
architecture: 'x64'

parameters:
- name: vmImage
type: string
default: 'ubuntu-18.04'
values:
- 'ubuntu-18.04'
- 'ubuntu-latest'
- name: pythonVersion
type: string
default: '3.8.x'
values:
- '3.6.x'
- '3.8.x'
- '3.9.x'
- name: architecture
type: string
default: 'x64'
- name: 'testCentral'
type: boolean
default: true
- name: 'testADT'
type: boolean
default: true
- name: 'testDPS'
type: boolean
default: true
- name: 'testHub'
type: boolean
default: true

variables:
- group: aziotcli_test_nightly
- name: pythonVersion
value: ${{ parameters.pythonVersion }}
- name: architecture
value: ${{ parameters.architecture }}

stages:
- stage: 'build'
Expand Down Expand Up @@ -62,37 +87,44 @@ stages:

- template: templates/install-and-record-version.yml

- stage: 'test_edge'
displayName: 'Run all tests with edge CLI'
- stage: 'test_min'
displayName: 'Run all tests with min CLI'
pool:
vmImage: ${{ parameters.vmImage }}
dependsOn: build
jobs:
- template: templates/nightly-tests.yml
parameters:
azureCLIVersion: edge
azureCLIVersion: min
pythonVersion: $(pythonVersion)

- stage: 'test_min'
displayName: 'Run all tests with min CLI'
testADT: ${{ parameters.testADT }}
testCentral: ${{ parameters.testCentral }}
testDPS: ${{ parameters.testDPS }}
testHub: ${{ parameters.testHub }}

- stage: 'test_msi'
displayName: 'Run all tests against Windows MSI install'
pool:
vmImage: ${{ parameters.vmImage }}
dependsOn: test_edge
vmImage: 'vs2017-win2016'
dependsOn: test_min
jobs:
- template: templates/nightly-tests.yml
parameters:
azureCLIVersion: min
azureCLIVersion: msi
pythonVersion: $(pythonVersion)
testADT: ${{ parameters.testADT }}
testCentral: ${{ parameters.testCentral }}
testDPS: ${{ parameters.testDPS }}
testHub: ${{ parameters.testHub }}

- stage: 'kpi'
displayName: 'Build KPIs'
dependsOn: [build, test_edge, test_min]
dependsOn: [build, test_min, test_msi]
jobs:
- job: 'calculateCodeCoverage'
displayName: 'Calculate distributed code coverage'
steps:
- template: templates/calculate-code-coverage.yml
parameters:
pythonVersion: $(pythonVersion)
architecture: $(architecture)

architecture: $(architecture)
3 changes: 0 additions & 3 deletions .azure-devops/templates/install-azure-cli-edge.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .azure-devops/templates/install-azure-cli-msi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- script: choco install azure-cli
displayName: 'Install released azure-cli from MSI'
- task: PowerShell@2
displayName: 'Set Windows MSI Python Executable PATH'
inputs:
targetType: 'inline'
script: |
echo "##vso[task.prependPath]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2"
echo "##vso[task.prependPath]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Scripts"
24 changes: 18 additions & 6 deletions .azure-devops/templates/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,78 @@ parameters:
values:
- min
- released
- edge
- msi
- name: azureSubscription
type: string
default: 'az_cli_nightly_conn'
- name: 'testCentral'
type: boolean
default: true
- name: 'testADT'
type: boolean
default: true
- name: 'testDPS'
type: boolean
default: true
- name: 'testHub'
type: boolean
default: true

jobs:

- job: 'testCentral'
displayName: 'Test IoT Central'
condition: eq('${{ parameters.testCentral }}', true)
steps:
- template: run-tests-parallel.yml
parameters:
path: 'azext_iot/tests/central'
name: 'iot-central'
azureCLIVersion: ${{ parameters.azureCLIVersion }}
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testADT'
displayName: 'Test Azure DigitalTwins'
condition: eq('${{ parameters.testADT }}', true)
steps:
- template: run-tests-parallel.yml
parameters:
path: 'azext_iot/tests/digitaltwins'
name: 'azure-digitaltwins'
azureCLIVersion: ${{ parameters.azureCLIVersion }}
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testDPS'
displayName: 'Test DPS'
condition: eq('${{ parameters.testDPS }}', true)
steps:
- template: run-tests-parallel.yml
parameters:
path: 'azext_iot/tests/dps'
name: 'device-provisioning-service'
azureCLIVersion: ${{ parameters.azureCLIVersion }}
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testHub_job_1'
displayName: 'Test IoT Hub - config, core and jobs'
condition: eq('${{ parameters.testHub }}', true)
steps:
- template: run-tests-parallel.yml
parameters:
path: 'azext_iot/tests/iothub/configurations azext_iot/tests/iothub/core azext_iot/tests/iothub/jobs'
name: 'iot-hub-1'
azureCLIVersion: ${{ parameters.azureCLIVersion }}
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'testHub_job_2'
condition: eq('${{ parameters.testHub }}', true)
displayName: 'Test IoT Hub - devices, messaging and modules'
steps:
- template: run-tests-parallel.yml
parameters:
path: 'azext_iot/tests/iothub/devices azext_iot/tests/iothub/messaging azext_iot/tests/iothub/modules'
name: 'iot-hub-2'
azureCLIVersion: ${{ parameters.azureCLIVersion }}
azureSubscription: ${{ parameters.azureSubscription }}
pythonVersion: ${{ parameters.pythonVersion }}

- job: 'unitTests'
Expand Down
4 changes: 2 additions & 2 deletions .azure-devops/templates/run-tests-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parameters:
values:
- min
- released
- edge
- msi
- name: path
type: string
default: 'azext_iot/tests'
Expand Down Expand Up @@ -76,7 +76,7 @@ steps:
continueOnError: true
displayName: '${{ parameters.name }} integration tests'
inputs:
azureSubscription: ${{ parameters.azureSubscription }}
azureSubscription: $(AzureServiceConnection)
scriptType: bash
scriptLocation: inlineScript
${{ if containsValue(parameters.serial_execution_dirs, parameters.path) }}:
Expand Down
10 changes: 5 additions & 5 deletions .azure-devops/templates/setup-dev-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
values:
- min
- released
- edge
- msi

steps:
- task: UsePythonVersion@0
Expand All @@ -25,13 +25,13 @@ steps:
- ${{ if eq(parameters.azureCLIVersion, 'released') }}:
- template: install-azure-cli-released.yml

- ${{ if eq(parameters.azureCLIVersion, 'edge') }}:
- template: install-azure-cli-edge.yml

- template: download-install-local-azure-test-sdk.yml
- ${{ if eq(parameters.azureCLIVersion, 'msi') }}:
- template: install-azure-cli-msi.yml

- template: setup-ci-machine.yml

- template: download-install-local-azure-test-sdk.yml

- template: download-install-local-azure-iot-cli-extension.yml

- template: set-pythonpath.yml

0 comments on commit 71f3f32

Please sign in to comment.