azure-cli-dev-tools icon indicating copy to clipboard operation
azure-cli-dev-tools copied to clipboard

[CICD] Add CLI Command Test Coverage

Open wangzelin007 opened this issue 4 years ago • 6 comments

Description:

  • azdev cmdcov atuo generate CLI Command Test Coverage Report about every module to track and improve command-level test coverage.
  • azdev linter add rules to detect any missing test cases in every pull request and continuously improve code quality.

Examples

Check all CLI modules command test coverage.
    azdev cmdcov CLI

Check one or serveral modules command test coverage.
    azdev cmdcov vm storage

Check CLI modules command argument test coverage.
    azdev cmdcov CLI --level argument

Add linter rules to check every PR
    azdev linter --rule-types command_test_coverage --repo=repo_path --src=src_branch --tgt=target_branch

Report:

image image image

wangzelin007 avatar Dec 12 '21 13:12 wangzelin007

Hey is this currently functional? When I run any azdev cmdcov command (such as azdev cmdcov -h), I get the following exception: ModuleNotFoundError: No module named 'azdev.operations.cmdcov' What command are you using to build azdev? I'm just doing a pip install . in the azdev repo, which worked for me on the dev branch

StrawnSC avatar Jan 03 '22 19:01 StrawnSC

Hey is this currently functional? When I run any azdev cmdcov command (such as azdev cmdcov -h), I get the following exception: ModuleNotFoundError: No module named 'azdev.operations.cmdcov' What command are you using to build azdev? I'm just doing a pip install . in the azdev repo, which worked for me on the dev branch

@StrawnSC, This feature currently is not functional, we will release a new version for it. You can try it by replace the azdev code with this branch.

wangzelin007 avatar Jan 04 '22 00:01 wangzelin007

@wangzelin007, Do we support adding --level for specific modules such as azdev cmdcov storage --level argument?

jsntcy avatar Feb 15 '22 10:02 jsntcy

@wangzelin007, Do we support adding --level for specific modules such as azdev cmdcov storage --level argument?

Yes~

wangzelin007 avatar Mar 30 '22 03:03 wangzelin007

General guideline: Avoid to release a new version for the package when there is any changes.

jsntcy avatar Mar 30 '22 03:03 jsntcy

General guideline: Avoid to release a new version for the package when there is any changes.

Sure, I will double check. Can you recommend a path in azcli repo ?

wangzelin007 avatar Mar 30 '22 03:03 wangzelin007

/azp run

wangzelin007 avatar Feb 13 '23 08:02 wangzelin007

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Feb 13 '23 08:02 azure-pipelines[bot]

Avoid to release a new version for the package when there is any changes.

Move CLI command test coverage config to azure-cli repo:https://github.com/Azure/azure-cli/pull/25441

wangzelin007 avatar Feb 14 '23 02:02 wangzelin007

/azp run

wangzelin007 avatar Feb 15 '23 03:02 wangzelin007

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Feb 15 '23 03:02 azure-pipelines[bot]