intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 44 forks source link

Add github action to run pytest #180

Closed pawpiatko closed 8 months ago

pawpiatko commented 9 months ago

Add running python tests as github action

mtkaczyk commented 9 months ago

Please mark current tests in exercise_slot.py with:

@pytest.mark.skipif(<smart condition so skip test execution>, reason="This test requires real hardware")

We don't need to execute them if there is no hardware. That is the clue I found but I don't have good check command- I give it to you.

BTW. if you are here, please fix type in conftest.py:

LOGGER.info(f'[CONFIG] slot filters: {config.getoption("rs--slot-filte")}')

LOGGER.info(f'[CONFIG] slot filters: {config.getoption("rs--slot-filters")}')
pawpiatko commented 9 months ago

Please mark current tests in exercise_slot.py with:

@pytest.mark.skipif(<smart condition so skip test execution>, reason="This test requires real hardware")

We don't need to execute them if there is no hardware. That is the clue I found but I don't have good check command- I give it to you.

BTW. if you are here, please fix type in conftest.py:

LOGGER.info(f'[CONFIG] slot filters: {config.getoption("rs--slot-filte")}')

LOGGER.info(f'[CONFIG] slot filters: {config.getoption("rs--slot-filters")}')

I've added skipping tests when there is not any slot found.

Proposition to change typo in conftest.py is deprecated (mentioned typos are available in repo)