Skip to content

Commit

Permalink
{CI} Fix cmdcov issue: Any name of a parameter has been tested, the p…
Browse files Browse the repository at this point in the history
…arameter should be considered as passing the parameter test coverage. (#417)

* Update linter.py

* update

* Update HISTORY.rst
  • Loading branch information
wangzelin007 authored Aug 9, 2023
1 parent beb183f commit 64f4b0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
0.1.58
++++++
* Fix cmdcov issue(#417): Any name of a parameter has been tested, the parameter should be considered as passing the parameter test coverage.

0.1.57
++++++
* `azdev command-change meta-diff`: Remove duplicated meta-diff code and use azure-cli-diff-tool
Expand Down
2 changes: 1 addition & 1 deletion azdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# -----------------------------------------------------------------------------

__VERSION__ = '0.1.57'
__VERSION__ = '0.1.58'
8 changes: 4 additions & 4 deletions azdev/operations/linter/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _detect_new_command(self, diff_index):
for p, r in v['parameters'].items():
if 'missing_parameter_test_coverage' in r['rule_exclusions']:
exclude_parameters.append((c, p))
elif 'rule_exclusions' in v:
if 'rule_exclusions' in v:
if 'missing_command_test_coverage' in v['rule_exclusions']:
exclude_comands.append(c)
_logger.debug('exclude_parameters: %s', exclude_parameters)
Expand Down Expand Up @@ -340,11 +340,11 @@ def _run_parameter_test_coverage(parameters, all_tested_command):
if command in code and opt in code:
flag = True
break
else:
violations.append(f'Missing parameter test coverage: `{command} {opt}`')
exec_state = False
if flag:
break
else:
violations.append(f'Missing parameter test coverage: `{command} {opt}`')
exec_state = False
if violations:
violations.insert(0, 'Failed.')
violations.extend([
Expand Down

0 comments on commit 64f4b0f

Please sign in to comment.