neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

feat(Beaker): Support distro variant configuration #168

Closed Tiboris closed 2 years ago

Tiboris commented 2 years ago

Before this patch the distro variant could not be configured and was hardcoded in the source code of the mrack project. With this patch we support the old way and also a new way of specifying the distro variants in the provisioning-config.

Updated the example provisioning-config.yaml file with latest beaker feature examples.

Signed-off-by: Tibor Dudlák tdudlak@redhat.com

pvoborni commented 2 years ago

WDYT about having a unit test for this transformation?

Tiboris commented 2 years ago

I have

miskopo commented 2 years ago

The added tests are skipped as seen here

('/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/_pytest/python.py', 182, 'Skipped: async def function and no async plugin installed (see warnings)')

Based on the warnings, asyncio plugin is missing. I don't see pytest-asyncio listed in the requirements.txt, which may be the core of a problem

Tiboris commented 2 years ago

@miskopo we have the test-requirements file for the testing requirements with the pytest-asyncio>=0.14.0 pinned.

miskopo commented 2 years ago

In that case, either add --asyncio-mode=auto to the pytest invocation, which will use asyncio on all async functions, or, use --asyncio-mode=strict and add decorator @pytest.mark.asyncio to test on line 82

Tiboris commented 2 years ago

I seee....

SKIPPED [3] ../../../../../opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/_pytest/python.py:182: async def function and no async plugin installed (see warnings)

in https://dev.azure.com/neoave/mrack/_build/results?buildId=582&view=logs&j=27008f10-b491-547d-a654-20cfee07d03e&t=73113a39-43fd-502e-b4fb-b68667aceda6

So skips are not treated as failures in our pipelines.

Tiboris commented 2 years ago

@miskopo I have added @pytest.mark.asyncio to the test

Tiboris commented 2 years ago

There were still warning: ##[warning]The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file. So i added another commit

Tiboris commented 2 years ago

@miskopo even with latest commit there is still

=============================== warnings summary ===============================
../../../../../opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191
  /opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

any tips how to get rid of it?

miskopo commented 2 years ago

yes, you can get rid of it by stating in pytest.ini

[pytest]
asyncio_mode = strict
Tiboris commented 2 years ago

I have re-pushed with the pytest.ini change.

miskopo commented 2 years ago

I've checked the run results available here and everything seems to be in order. Therefore you have my ACK for the test part.