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

Multiple enhancements to scripts/fixture_cli.py #13243

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

JacobCallahan
Copy link
Member

The changes included in this commit are:

  • Run fixtures in separate tests so failing fixtures don't block others
  • Add the ability to run fixtures that are indirectly parametrized
  • Add an option to switch to verbose mode, showing test execution and results. This should help with debugging and generally seeing what' happening
  • Add an option to run the fixtures in multiple xdist workers

@JacobCallahan JacobCallahan added enhancement An addition to the robottelo framework CherryPick PR needs CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Dec 1, 2023
@JacobCallahan JacobCallahan requested review from jyejare and a team December 1, 2023 21:56
@JacobCallahan JacobCallahan requested a review from a team as a code owner December 1, 2023 21:56
@JacobCallahan
Copy link
Member Author

JacobCallahan commented Dec 1, 2023

Given this command:
python scripts/fixture_cli.py module_host setting_update:login_text module_domain --verbose -n 2

This test_DELETEME.py file is created:

import pytest

def test_run_module_host(module_host):
    assert True

@pytest.mark.parametrize('setting_update', ['login_text'], indirect=True)
def test_run_setting_update(setting_update):
    assert True

def test_run_module_domain(module_domain):
    assert True

With the following result:

======================================================================= test session starts =======================================================================
platform linux -- Python 3.12.0, pytest-7.4.3, pluggy-1.3.0 -- /home/jake/Programming/robottelo/venvrobottelo/bin/python
Mandatory Requirements Mismatch: pytest-order==1.1.0 deepdiff==6.7.1
Optional Requirements Mismatch: flake8==6.1.0 pytest-cov==4.1.0 sphinx==7.2.6 redis==5.0.1 sphinx-autoapi==3.0.0 manage==0.1.15 pre-commit==3.5.0
To update mismatched requirements, run the pytest command with '--upgrade-required-reqs' OR '--upgrade-all-reqs' option.
cachedir: .pytest_cache
shared_function enabled - OFF - scope:  - storage: file
rootdir: /home/jake/Programming/robottelo
configfile: pyproject.toml
plugins: xdist-3.3.1, services-2.2.1, mock-3.12.0, ibutsu-2.2.4, reportportal-5.3.0
2 workers [3 items]     
scheduling tests via LoadScheduling

test_DELETEME.py::test_run_module_host 
test_DELETEME.py::test_run_setting_update[login_text] 
[gw0] [ 33%] PASSED test_DELETEME.py::test_run_setting_update[login_text]
[gw1] [ 66%] PASSED test_DELETEME.py::test_run_module_host 
test_DELETEME.py::test_run_module_domain 
[gw1] [100%] PASSED test_DELETEME.py::test_run_module_domain 

======================================================================== warnings summary =========================================================================
...
=========================================================== 3 passed, 38 warnings in 1042.98s (0:17:22) ===========================================================

Note that since I didn't specify in the config that this should all run on a single satellite, an additional one was checked out.

The changes included in this commit are:
- Run fixtures in separate tests so failing fixtures don't block others
- Add the ability to run fixtures that are indirectly parametrized
- Add an option to switch to verbose mode, showing test execution and
  results. This should help with debugging and generally seeing what'
  happening
- Add an option to run the fixtures in multiple xdist workers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches enhancement An addition to the robottelo framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants