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

Eliminate the Pytest Deprecation Warning in the CI Tests #8143

Closed
Imod7 opened this issue Mar 9, 2021 · 5 comments
Closed

Eliminate the Pytest Deprecation Warning in the CI Tests #8143

Imod7 opened this issue Mar 9, 2021 · 5 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.

Comments

@Imod7
Copy link
Contributor

Imod7 commented Mar 9, 2021

Python version:
Python 3.7

Operating system (windows, osx, ...):
Ubuntu

Issue:
This Issue is part of the effort to close the Issue#7738 hence to reduce the amount of warnings that are raised when running all tests in the CI. From a first investigation, it seems that this warning (PytestDeprecationWarning: direct construction of Function has been deprecated, please use Function.from_parent) for which the current Issue was opened, has 944-948 approx occurrences.

Warning (including full traceback):

2021-03-02T15:48:51.9551109Z .venv/lib/python3.7/site-packages/pytest_asyncio/plugin.py:39: 948 tests with warnings
2021-03-02T15:48:51.9552732Z   /home/runner/work/rasa/rasa/.venv/lib/python3.7/site-packages/pytest_asyncio/plugin.py:39: PytestDeprecationWarning: direct construction of Function has been deprecated, please use Function.from_parent
2021-03-02T15:48:51.9553949Z     item = pytest.Function(name, parent=collector)
2021-03-02T15:48:51.9554329Z 
2021-03-02T15:48:51.9684673Z .venv/lib/python3.7/site-packages/pytest_asyncio/plugin.py:45: 948 tests with warnings
2021-03-02T15:48:51.9691671Z   /home/runner/work/rasa/rasa/.venv/lib/python3.7/site-packages/pytest_asyncio/plugin.py:45: PytestDeprecationWarning: direct construction of Function has been deprecated, please use Function.from_parent
2021-03-02T15:48:51.9695267Z     item = pytest.Function(name, parent=collector)  # To reload keywords.

Possible Solutions:

  • Maybe we need an update for pytest-asyncio.
  • Based on this issue it looks like they deprecated the direct use of pytest.Function()and here is the related merged PR

Command or request that led to error:

  • The warning can be found in the CI tests log file (3_Run Tests (ubuntu-latest, 3.7, test-non-training).txt)
  • Also, the warning can be reproduced when running one of the tests below:
pytest tests/core/test_agent.py::model_server
pytest tests/nlu/test_components.py::test_no_components_with_same_name
pytest tests/nlu/training_data/converters/test_nlg_markdown_to_yaml_converter.py
pytest tests/core/actions/test_forms.py::test_extract_requested_slot_when_mapping_applies

Definition of Done:

  • The PytestDeprecationWarning does not appear anymore.
@Imod7 Imod7 added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. area:rasa-oss 🎡 Anything related to the open source Rasa framework and removed type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Mar 9, 2021
@iurisevero
Copy link
Contributor

Hey there, @ericoBandeira and I would like to work on this issue. Is anyone already working on that?

@Imod7
Copy link
Contributor Author

Imod7 commented Mar 15, 2021

Hello @iurisevero and @ericoBandeira! Thank you for volunteering on this warning issue! 👏🏽 Noone is working on this one currently so please feel free to give it a try. Also, do not hesitate to reach out for help at any moment.

@iurisevero
Copy link
Contributor

iurisevero commented Mar 17, 2021

Hi @Imod7. I was running the tests at my local and the PytestDeprecationWarning is already solved.
I've listed others DeprecationWarning that appeared when I run the make test command and we're thinking about solving them or solving the max that we can... It can be done on this issue or it's better to open another one to do that?

@Imod7
Copy link
Contributor Author

Imod7 commented Mar 18, 2021

Hello @iurisevero! Indeed, we updated pytest with the last release. Before creating any new issues please make sure there is not another one already created. You can check and maybe pick one of those who are linked to this ticket. Otherwise feel free to create your own if none of these warnings is something you would like to work on.

@iurisevero
Copy link
Contributor

I talked to @ericoBandeira, we will start to work on the issue #8211.
Since the problem was solved, I believe that this issue can be closed, right?

@Imod7 Imod7 closed this as completed Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.
Projects
None yet
Development

No branches or pull requests

2 participants