From 6f5a4e3e31dde6f2bd1d58cc4e0e79cce826fb12 Mon Sep 17 00:00:00 2001 From: ZelinWang Date: Wed, 15 Feb 2023 11:05:48 +0800 Subject: [PATCH] {CI} Move CLI command test coverage config to azure-cli repo (#25441) * Create cmdcov.yml * Update cmdcov.yml * Update cmdcov.yml * Update cmdcov.yml --- scripts/ci/cmdcov.yml | 215 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 scripts/ci/cmdcov.yml diff --git a/scripts/ci/cmdcov.yml b/scripts/ci/cmdcov.yml new file mode 100644 index 00000000000..7503a5474f8 --- /dev/null +++ b/scripts/ci/cmdcov.yml @@ -0,0 +1,215 @@ +# ----------------------------------------------------------------------------- +# Base on: +# https://github.com/Azure/azure-cli/blob/dev/.github/CODEOWNERS +# https://github.com/Azure/azure-cli-extensions/blob/main/.github/CODEOWNERS + +# Add module identity to CLI_OWN_MODULES after pr https://github.com/Azure/azure-cli/pull/21041 +# Move module container out of CLI_OWN_MODULES. +# Move module privatedns out of CLI_OWN_MODULES. + +CLI_OWN_MODULES: + - cloud + - databoxedge + - identity + - keyvault + - monitor + - network + - profile + - resource + - role + - storage + - vm + - azext_account + - azext_ad + - azext_automanage + - azext_automation + - azext_azure-firewall + - azext_blockchain +# - azext_cloudservice # azure-mgmt-compute~=20.0.0 (azure-mgmt-compute-29.0.0) install failed + - azext_communication + - azext_confluent +# - azext_connection-monitor-preview # compatible with your current CLI core version 2.44.1.(2.0.81) + - azext_costmanagement + - azext_custom-providers + - azext_databox + - azext_datafactory + - azext_dns-resolver + - azext_dynatrace + - azext_edgeorder + - azext_elastic + - azext_express-route-cross-connection + - azext_healthcareapis + - azext_hpc-cache + - azext_image-gallery + - azext_init + - azext_interactive + - azext_internet-analyzer + - azext_ip-group + - azext_keyvault-preview + - azext_log-analytics-solution + - azext_logic + - azext_logz + - azext_mobile-network + - azext_monitor-control-service + - azext_network-manager + - azext_next + - azext_peering + - azext_purview + - azext_scheduled-query + - azext_stack-hci + - azext_storage-blob-preview + - azext_storage-preview + - azext_storagesync + - azext_swiftlet + - azext_timeseriesinsights + - azext_virtual-network-tap + - azext_virtual-wan + +EXCLUDE_MODULES: + - batchai + - extension + - feedback + - find + - interactive + - kusto + - util + +GLOBAL_EXCLUDE_COMMANDS: + - wait + +EXCLUDE_COMMANDS: + network: + # No bastion to test + - network bastion rdp + - network bastion ssh + - network bastion tunnel + # No dns to test + - network dns record-set a list + - network dns record-set aaaa delete + - network dns record-set aaaa list + - network dns record-set aaaa show + - network dns record-set aaaa update + - network dns record-set caa delete + - network dns record-set caa list + - network dns record-set caa show + - network dns record-set caa update + - network dns record-set cname list + - network dns record-set cname show + - network dns record-set mx delete + - network dns record-set mx list + - network dns record-set mx show + - network dns record-set mx update + - network dns record-set ns delete + - network dns record-set ns list + - network dns record-set ns update + - network dns record-set ptr delete + - network dns record-set ptr list + - network dns record-set ptr show + - network dns record-set ptr update + - network dns record-set soa show + - network dns record-set srv delete + - network dns record-set srv list + - network dns record-set srv show + - network dns record-set srv update + - network dns record-set txt delete + - network dns record-set txt show + - network dns record-set txt update + resource: + # Permission denied + - account management-group subscription add + - account management-group subscription remove + # Hard to test + - bicep publish + - feature register + role: + # Deprecate + - ad app permission admin-consent + - ad group owner remove + - ad signed-in-user show + - ad sp owner list + - ad user list + # Move identity from role module to identity module + - identity show + - identity delete + - identity list + - identity list-operations + vm: + # Hard to test + - vm host restart + +GLOBAL_PARAMETERS: + - ["--debug"] + - ["--help", "-h"] + - ["--only-show-errors"] + - ["--output", "-o"] + - ["--query"] + - ["--query-examples"] + - ["--subscription"] + - ["--verbose"] + +GENERIC_UPDATE_PARAMETERS: + - ["--add"] + - ["--force-string"] + - ["--remove"] + - ["--set"] + +WAIT_CONDITION_PARAMETERS: + - ["--created"] + - ["--custom"] + - ["--deleted"] + - ["--exists"] + - ["--interval"] + - ["--timeout"] + - ["--updated"] + +OTHER_PARAMETERS: + # batch + - ["--account-name"] + - ["--account-key"] + - ["--account-endpoint"] + - ["--ids"] + - ["--ignore-errors"] + - ["--location", "-l"] + - ["--username", "-u"] + - ["--password", "-p"] + - ["--name", "-n"] + - ["--no-wait"] + - ["--resource-group", "-g"] + - ["--tags"] + - ["--yes", "-y"] + +CMD_PATTERN: + # self.cmd( # test.cmd( + - .\w{0,}cmd\(\n + # self.cmd('xxxx or self.cmd("xxx or test.cmd(' or fstring + - .\w{0,}cmd\(f?(?:\'|")(.*)(?:\'|") + # xxxcmd = '' or xxxcmd = "" or xxxcmd1 or ***Command or ***command or fstring + - (?:cmd|command|Command)\d* = f?(?:\'|"){1}([a-z]+.*)(?:\'|"){1} + # r'self.cmd\(\n', r'cmd = (?:\'|")(.*)(?:\'|")(.*)?', + # xxxcmd = """ or xxxcmd = ''' or xxxcmd1 + - cmd\d* = (?:"{3}|\'{3})(.*) + +# Match content in '' or "" +QUO_PATTERN: (["\'])((?:\\\1|(?:(?!\1)).)*)(\1) +# Match end: ) or checks= or ,\n +END_PATTERN: (\)|checks=|,\n) +# Match doc string ''' or """ +# If there are single quotes in the single quotes, you must use two consecutive single quotes to escape. +DOCS_END_PATTERN: '"{3}$|\''{3}$' +# Match end with ' or " +NOT_END_PATTERN: ^(\s)+(\'|") +# (# xxxx) +NUMBER_SIGN_PATTERN: ^\s*#.*$ + +RED: "red" +ORANGE: "orange" +GREEN: "green" +BLUE: "blue" +GOLD: "gold" + +RED_PCT: 30 +ORANGE_PCT: 60 +GREEN_PCT: 80 +BLUE_PCT: 100 + +ENCODING: "utf-8"