Skip to content

Commit

Permalink
{CI} Move CLI command test coverage config to azure-cli repo (#25441)
Browse files Browse the repository at this point in the history
* Create cmdcov.yml

* Update cmdcov.yml

* Update cmdcov.yml

* Update cmdcov.yml
  • Loading branch information
wangzelin007 authored Feb 15, 2023
1 parent de1f27e commit 6f5a4e3
Showing 1 changed file with 215 additions and 0 deletions.
215 changes: 215 additions & 0 deletions scripts/ci/cmdcov.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 6f5a4e3

Please sign in to comment.