From 5417eac51d64d7f51f6633d418ae8831ea9eca41 Mon Sep 17 00:00:00 2001 From: evelyn-ys Date: Mon, 31 Oct 2022 14:25:43 +0800 Subject: [PATCH 1/3] Log each extension recording test time --- .../templates/automation_test.yml | 16 ++ .azure-pipelines/templates/azdev_setup.yml | 3 +- azure-pipelines-full-tests.yml | 261 ++++++++++++++++++ 3 files changed, 279 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/automation_test.yml b/.azure-pipelines/templates/automation_test.yml index ac7c2a8561f..7629b637bc3 100644 --- a/.azure-pipelines/templates/automation_test.yml +++ b/.azure-pipelines/templates/automation_test.yml @@ -23,6 +23,10 @@ parameters: displayName: Run test for specific module type: string default: '' +- name: ext_module + displayName: Run test for specific extension module + type: string + default: '' steps: - task: UsePythonVersion@0 @@ -57,6 +61,18 @@ steps: exit 0 fi + # Test specific extension module + ext_module="${{ parameters.ext_module }}" + if [[ -n $ext_module ]]; then + echo "Installing extension '$ext_module'" + azdev extension add $ext_module + echo "Running test for extension '$ext_module'" + azdev test $ext_module --discover --no-exitfirst --verbose --pytest-args "--durations=0" + echo "Uninstalling extension '$ext_module'" + azdev extension remove $ext_module + exit 0 + fi + if [[ "$(Build.Reason)" == "PullRequest" && "${{ parameters.fullTest }}" == 'False' ]]; then echo "Running incremental test" # If CI is set to shallow fetch, target branch should be expilictly fetched. diff --git a/.azure-pipelines/templates/azdev_setup.yml b/.azure-pipelines/templates/azdev_setup.yml index d2514a004d6..8b0724306f7 100644 --- a/.azure-pipelines/templates/azdev_setup.yml +++ b/.azure-pipelines/templates/azdev_setup.yml @@ -4,10 +4,11 @@ parameters: default: '.' - name: CLIExtensionRepoPath type: string - default: '' + default: '.' steps: - bash: | set -ev + git clone https://github.com/Azure/azure-cli-extensions.git python -m venv env chmod +x env/bin/activate diff --git a/azure-pipelines-full-tests.yml b/azure-pipelines-full-tests.yml index e9f9541c5de..f81971706fd 100644 --- a/azure-pipelines-full-tests.yml +++ b/azure-pipelines-full-tests.yml @@ -135,3 +135,264 @@ jobs: instance_cnt: '8' instance_idx: '$(Instance_idx)' fullTest: true + +- job: AutomationExtensionFullTestPython310ProfileLatest + displayName: Automation Extension Full Test Python310 Profile Latest + timeoutInMinutes: 9999 + strategy: + maxParallel: 124 + matrix: + account: + Target: account + acrtransfer: + Target: acrtransfer + ad: + Target: ad + aem: + Target: aem + ai-examples: + Target: ai-examples + aks-preview: + Target: aks-preview + alertsmanagement: + Target: alertsmanagement + alias: + Target: alias + amg: + Target: amg + application-insights: + Target: application-insights + appservice-kube: + Target: appservice-kube + attestation: + Target: attestation + authV2: + Target: authV2 + automation: + Target: automation + azure-firewall: + Target: azure-firewall + blockchain: + Target: blockchain + blueprint: + Target: blueprint + change-analysis: + Target: change-analysis + cli-translator: + Target: cli-translator + cloudservice: + Target: cloudservice + communication: + Target: communication + confidentialledger: + Target: confidentialledger + confluent: + Target: confluent + connectedk8s: + Target: connectedk8s + connectedmachine: + Target: connectedmachine + connectedvmware: + Target: connectedvmware + connection-monitor-preview: + Target: connection-monitor-preview + containerapp: + Target: containerapp + cosmosdb-preview: + Target: cosmosdb-preview + costmanagement: + Target: costmanagement + custom-providers: + Target: custom-providers + databox: + Target: databox + databricks: + Target: databricks + datadog: + Target: datadog + datafactory: + Target: datafactory + datamigration: + Target: datamigration + dataprotection: + Target: dataprotection + datashare: + Target: datashare + db-up: + Target: db-up + desktopvirtualization: + Target: desktopvirtualization + dev-spaces: + Target: dev-spaces + diskpool: + Target: diskpool + dms-preview: + Target: dms-preview + dnc: + Target: dnc + dns-resolver: + Target: dns-resolver + edgeorder: + Target: edgeorder + elastic-san: + Target: elastic-san + elastic: + Target: elastic + eventgrid: + Target: eventgrid + express-route-cross-connection: + Target: express-route-cross-connection + fleet: + Target: fleet + fluid-relay: + Target: fluid-relay + footprint: + Target: footprint + front-door: + Target: front-door + functionapp: + Target: functionapp + guestconfig: + Target: guestconfig + hack: + Target: hack + hardware-security-modules: + Target: hardware-security-modules + healthbot: + Target: healthbot + healthcareapis: + Target: healthcareapis + hpc-cache: + Target: hpc-cache + image-copy: + Target: image-copy + image-gallery: + Target: image-gallery + import-export: + Target: import-export + init: + Target: init + interactive: + Target: interactive + internet-analyzer: + Target: internet-analyzer + ip-group: + Target: ip-group + k8s-configuration: + Target: k8s-configuration + k8s-extension: + Target: k8s-extension + kusto: + Target: kusto + log-analytics-solution: + Target: log-analytics-solution + log-analytics: + Target: log-analytics + logic: + Target: logic + logz: + Target: logz + maintenance: + Target: maintenance + managementpartner: + Target: managementpartner + mesh: + Target: mesh + mixed-reality: + Target: mixed-reality + monitor-control-service: + Target: monitor-control-service + netappfiles-preview: + Target: netappfiles-preview + network-manager: + Target: network-manager + next: + Target: next + nginx: + Target: nginx + notification-hub: + Target: notification-hub + offazure: + Target: offazure + orbital: + Target: orbital + peering: + Target: peering + portal: + Target: portal + powerbidedicated: + Target: powerbidedicated + providerhub: + Target: providerhub + purview: + Target: purview + quantum: + Target: quantum + quota: + Target: quota + rdbms-connect: + Target: rdbms-connect + redisenterprise: + Target: redisenterprise + reservation: + Target: reservation + resource-graph: + Target: resource-graph + resource-mover: + Target: resource-mover + scenario-guide: + Target: scenario-guide + scheduled-query: + Target: scheduled-query + scvmm: + Target: scvmm + securityinsight: + Target: securityinsight + serial-console: + Target: serial-console + spring-cloud: + Target: spring-cloud + spring: + Target: spring + ssh: + Target: ssh + stack-hci: + Target: stack-hci + storage-blob-preview: + Target: storage-blob-preview + storage-preview: + Target: storage-preview + storagesync: + Target: storagesync + stream-analytics: + Target: stream-analytics + subscription: + Target: subscription + support: + Target: support + swiftlet: + Target: swiftlet + timeseriesinsights: + Target: timeseriesinsights + traffic-collector: + Target: traffic-collector + virtual-network-tap: + Target: virtual-network-tap + virtual-wan: + Target: virtual-wan + vm-repair: + Target: vm-repair + vmware: + Target: vmware + webapp: + Target: webapp + webpubsub: + Target: webpubsub + pool: + vmImage: 'ubuntu-20.04' + steps: + - template: .azure-pipelines/templates/automation_test.yml + parameters: + pythonVersion: '3.10' + profile: 'latest' + ext_module: '$(Target)' \ No newline at end of file From 7b5b1368ed0edcc717905e53fcc90cef00f98004 Mon Sep 17 00:00:00 2001 From: evelyn-ys Date: Mon, 31 Oct 2022 14:55:43 +0800 Subject: [PATCH 2/3] ADO pool --- azure-pipelines-full-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-full-tests.yml b/azure-pipelines-full-tests.yml index f81971706fd..bab0501dab6 100644 --- a/azure-pipelines-full-tests.yml +++ b/azure-pipelines-full-tests.yml @@ -389,7 +389,7 @@ jobs: webpubsub: Target: webpubsub pool: - vmImage: 'ubuntu-20.04' + name: ${{ variables.ubuntu_pool }} steps: - template: .azure-pipelines/templates/automation_test.yml parameters: From 8d197f00e46a0e8eda32d0a4833458595042b6d2 Mon Sep 17 00:00:00 2001 From: evelyn-ys Date: Tue, 1 Nov 2022 10:00:32 +0800 Subject: [PATCH 3/3] extension path --- .azure-pipelines/templates/automation_test.yml | 2 +- .azure-pipelines/templates/azdev_setup.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/automation_test.yml b/.azure-pipelines/templates/automation_test.yml index 7629b637bc3..c9110e32cc9 100644 --- a/.azure-pipelines/templates/automation_test.yml +++ b/.azure-pipelines/templates/automation_test.yml @@ -67,7 +67,7 @@ steps: echo "Installing extension '$ext_module'" azdev extension add $ext_module echo "Running test for extension '$ext_module'" - azdev test $ext_module --discover --no-exitfirst --verbose --pytest-args "--durations=0" + azdev test $ext_module --no-exitfirst --pytest-args "--durations=0" echo "Uninstalling extension '$ext_module'" azdev extension remove $ext_module exit 0 diff --git a/.azure-pipelines/templates/azdev_setup.yml b/.azure-pipelines/templates/azdev_setup.yml index 8b0724306f7..9d6e045aef2 100644 --- a/.azure-pipelines/templates/azdev_setup.yml +++ b/.azure-pipelines/templates/azdev_setup.yml @@ -4,7 +4,7 @@ parameters: default: '.' - name: CLIExtensionRepoPath type: string - default: '.' + default: 'azure-cli-extensions' steps: - bash: | set -ev