-
Notifications
You must be signed in to change notification settings - Fork 13
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
single run feature #99
base: master
Are you sure you want to change the base?
Conversation
896b279
to
8886b5d
Compare
I don't like the logging output; it prints 'SKIPPED' and 'Skipped' for one test case; I'm not sure where it's coming from.
The following marker values are tested, logs attached.
|
GenericProvider tests can be set to run once as a default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fun of single_run
. How about preferred_topology
? Its still not perfect, so suggestion is welcomed. You should also not take the string but the topology marker object instead. It would be also good to allow lists. That is:
# By default, runs only LDAP
@pytest.mark.preferred_topology(KnownTopology.LDAP)
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_exampe(...):
pass
# By default, runs only LDAP and IPA
@pytest.mark.preferred_topology(KnownTopology.LDAP)
@pytest.mark.preferred_topology(KnownTopology.IPA)
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_exampe(...):
pass
# By default, runs only LDAP and IPA
@pytest.mark.preferred_topology([KnownTopology.LDAP, KnownTopology.IPA])
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_exampe(...):
pass
for y in item.iter_markers("topology"): | ||
if len(y.args) > 0 and y.args[0].name == "AnyProvider": | ||
self.single_run_topology = "ldap" | ||
if len(y.args) > 0 and y.args[0].name == "AnyADProvider": | ||
self.single_run_topology = "samba" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is SSSD specific, can't be here. Please, remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
# Single run topology will default to LDAP or Samba. | ||
if self.mh_ignore_single_run: | ||
return | ||
|
||
if len([i for i in item.iter_markers("single_run")]) > 1: | ||
raise ValueError("Too many arguments for @pytest.mark.single_run.") | ||
|
||
i = next(item.iter_markers("single_run"), "") | ||
if not i: | ||
return | ||
|
||
for i in item.iter_markers("single_run"): | ||
if len(i.args) > 0: | ||
self.single_run_topology = i.args[0] | ||
else: | ||
for y in item.iter_markers("topology"): | ||
if len(y.args) > 0 and y.args[0].name == "AnyProvider": | ||
self.single_run_topology = "ldap" | ||
if len(y.args) > 0 and y.args[0].name == "AnyADProvider": | ||
self.single_run_topology = "samba" | ||
|
||
if self.single_run_topology is not self.current_topology: | ||
self.logger.info(f"Single run marker set, skipping {self.current_topology}") | ||
pytest.skip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this into a standalone method.
It should probably rely on data.topology_mark rather then the global field. And maybe place it into |
Linguistically, |
I think "single run" does not describe it at all. Negation would be easier to describe, I think, but harder to use (as the use case is to run 1 instead of 4). The use case is "run these topologies if there is no topology filter". |
No description provided.