Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Fix marker_filters logic #10028

Merged
merged 1 commit into from
Apr 8, 2020
Merged

[1LP][RFR] Fix marker_filters logic #10028

merged 1 commit into from
Apr 8, 2020

Conversation

tpapaioa
Copy link
Contributor

Previously, the filter logic for the tier, requirement, and customer-scenario options was not working as expected. For example, specifying "--tier 1" did not work unless you also included the --requirement filter with a matching requirement. This PR fixes the logic so that each filter is independently applied. Specifically, the fix is to apply the requirement filter only if one or more requirements were actually specified.

Example, before fix:

$ pytest --collect-only --tier 1 cfme/tests/configure/test_zones.py
[...]
collected 11 items / 11 deselected                                                                                                                                      
[...]

$ pytest --collect-only --tier 1 --requirement Configuration cfme/tests/configure/test_zones.py
[...]
collected 11 items / 10 deselected / 1 selected                                                                                                                         
<Package /home/tpapaioa/git/integration_tests/cfme/tests/configure>
  <Module test_zones.py>
    <Function test_zone_crud>
[...]

After fix:

$ miq-runtest --collect-only --tier 1 cfme/tests/configure/test_zones.py
[...]
collected 11 items / 10 deselected / 1 selected                                                                                                                         
<Package /home/tpapaioa/git/integration_tests/cfme/tests/configure>
  <Module test_zones.py>
    <Function test_zone_crud>
[...]

$ pytest --collect-only --tier 1 --requirement Configuration cfme/tests/configure/test_zones.py
[...]
collected 11 items / 10 deselected / 1 selected                                                                                                                         
<Package /home/tpapaioa/git/integration_tests/cfme/tests/configure>
  <Module test_zones.py>
    <Function test_zone_crud>
[...]

{{ pytest: -v --collect-only --tier 1 cfme/tests/configure/test_zones.py }}

@tpapaioa tpapaioa changed the title [WIPTEST] Fix marker_filters logic [RFR] Fix marker_filters logic Mar 31, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a comment

Choose a reason for hiding this comment

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

Nice PR!

@john-dupuy john-dupuy changed the title [RFR] Fix marker_filters logic [1LP][RFR] Fix marker_filters logic Apr 2, 2020
Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

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

Great find @tpapaioa, nice work!

@mshriver mshriver merged commit af71297 into ManageIQ:master Apr 8, 2020
@tpapaioa tpapaioa deleted the fix_marker_filter branch April 8, 2020 12:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants