Skip to content
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

Possibility to filter tests that create capsule and satellite hosts #14474

Closed
wants to merge 1 commit into from

Conversation

dosas
Copy link
Collaborator

@dosas dosas commented Mar 21, 2024

No description provided.

that create capsule and satellite hosts
@dosas dosas requested review from a team as code owners March 21, 2024 11:27
@@ -32,6 +32,10 @@ def pytest_collection_modifyitems(session, items, config):
for item in items:
if any("manifest" in f for f in getattr(item, "fixturenames", ())):
item.add_marker("manifester")
if any("satellite_host" in f for f in getattr(item, "fixturenames", ())):
Copy link
Member

Choose a reason for hiding this comment

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

Can I ask the reason behind this PR implementation? Asking because there are many ways satellite/capsule is being created in tests.

This wont be able to collect all those tests, it would only collect that has satellite_host.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. In my test environment I do not have ansible tower available. So I have to filter every test that creates a satellite or capusle host via broker: https://github.com/SatelliteQE/robottelo/blob/master/pytest_fixtures/core/sat_cap_factory.py

Copy link
Member

Choose a reason for hiding this comment

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

@dosas We had similar implementation that would add a marker to the tests using fixtures from sat_cap_factory: https://github.com/SatelliteQE/robottelo/blob/master/pytest_plugins/factory_collection.py#L20

So you can simply uncollect them using -m not factory_instance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jyejare Thanks! I think this is exactly what I need. I will check and close the MR.

@lhellebr
Copy link
Contributor

I suppose you are going to close this. If you still require review, let us know.

@dosas dosas closed this Mar 26, 2024
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