Skip to content

MQE-1676: Static check for unused arguments in action group. #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 27, 2020
Merged

Conversation

soumyau
Copy link
Contributor

@soumyau soumyau commented Jan 22, 2020

Description

Scans action group files and finds unused arguments.

  1. For merging action groups, checks unused arguments for the every action group xml string to avoid arguments getting flagged for removal of steps.
  2. For extending action groups, checks unused arguments for parent and child action group xml strings.
    Arguments of child action group that are also defined in it's parent but are used only in parent are not reported as unused.

Fixed Issues (if relevant)

  1. magento/magento2-functional-testing-framework#<issue_number>: Issue title
  2. ...

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Jan 22, 2020

Coverage Status

Coverage decreased (-0.06%) to 51.919% when pulling 1c7c6ce on MQE-1676 into c069eca on develop.

Copy link
Contributor Author

@soumyau soumyau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all review comments

@jilu1
Copy link
Contributor

jilu1 commented Jan 24, 2020

In the case of action group merging with removal, the script gives a false result.

File "/Users/jilu/Code/magento5/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml,/Users/jilu/Code/magento5/ee/app/code/Magento/CatalogRuleStaging/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml"
contains action group(s) with unused arguments.
		
	 AssertCatalogRuleInGridActionGroup has unused argument(s): status

…nused arguments

Refactored to read xml content from files directly to avoid flagging arguments due to step removals during merging/extensions.
…nused arguments

added exception catch for incorrect action group definition
…nused arguments

included $$argument.name$$ pattern + fixed unit tests
Copy link
Contributor

@jilu1 jilu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@soumyau soumyau merged commit 53b055d into develop Jan 27, 2020
@soumyau soumyau deleted the MQE-1676 branch April 30, 2020 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants