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

[infra] Enforce core_dump_and_config_check run order #16453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,9 @@ def pfc_pause_delay_test_params(request):

_frontend_hosts_per_hwsku_per_module = {}
_hosts_per_hwsku_per_module = {}


@pytest.hookimpl(wrapper=True)
def pytest_generate_tests(metafunc): # noqa E302
# The topology always has atleast 1 dut
dut_fixture_name = None
Expand Down Expand Up @@ -1786,6 +1789,26 @@ def format_portautoneg_test_id(param):
else:
metafunc.parametrize('vlan_name', ['no_vlan'], scope='module')

# HACK: ensure fixture core_dump_and_config_check runs before any
# other module level fixtures in setup to collect configurations
# without modification from test fixtures.
for fixturedef in metafunc._arg2fixturedefs.values():
fixturedef = fixturedef[0]
if fixturedef.argname == "core_dump_and_config_check":
metafunc.fixturenames.remove(fixturedef.argname)
metafunc.fixturenames.insert(0, fixturedef.argname)

yield

# HACK: ensure fixture core_dump_and_config_check runs after any
# other module level fixtures in teardown, so other fixtures could
# restore the configruation before running core_dump_and_config_check.
for fixturedef in metafunc._arg2fixturedefs.values():
fixturedef = fixturedef[0]
if fixturedef.argname == "core_dump_and_config_check":
metafunc.fixturenames.remove(fixturedef.argname)
metafunc.fixturenames.append(fixturedef.argname)


def get_autoneg_tests_data():
folder = 'metadata'
Expand Down
Loading