Skip to content

Commit

Permalink
Storage skip: change in storage skipping (els-pnw#2)
Browse files Browse the repository at this point in the history
In testing ovirt 4.2 we change approach how to generate tests for particular
storage types. Now we are using parametrize of fixture called storage, but
problem is that this fixture is parametrized after pytest_runtest_setup.
Pytest put all parametrized values of test to item._genid which is e.g.
string "nfs-foo-bar" in case you parametrized that test with nfs, foo,
bar.

This change is backward compatibility because I it's just looking for used
fixture storage and if it's there it's using new approach otherwise using old
approach.
  • Loading branch information
petr-balogh authored and lukas-bednar committed Mar 18, 2019
1 parent fc89146 commit ce32a8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pytest_marker_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ def _should_skip_due_to_storage(self, item, storages):
if not storages:
return True

return item.parent.obj.storage in storages
if "storage" in item.fixturenames:
for storage in storages:
if storage in item._genid:
return True
return False
else:
return item.parent.obj.storage in storages

def _should_skip_due_to_ppc(self, item, is_ppc):
return is_ppc is None or is_ppc is True
Expand Down

0 comments on commit ce32a8d

Please sign in to comment.