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

Cherry-pick #16883 to 7.x: Use pytest instead of nosetests #20478

Merged
merged 5 commits into from
Aug 12, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 6, 2020

Cherry-pick of PR #16883 to 7.x branch. Original message:

What does this PR do?

Replaces nosetests with pytest.

Why is it important?

Nosetests has been in maintenance mode for years, its last release was done in 2015. When evolving the testing framework for Python tests it would be better to do it based on a maintained test tool. It will stop working with Python 3.9.

For #15891 I am considering adding new features to the testing framework that could include to add some plugin for the test tool, it wouldn't make sense to implement code based on a discontinued tool.

Pytest is a complete and well maintained test tool, it is one of the tools recommended after cease of nose project and it can be used as a direct replacement.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

Author checklist

  • Interrupting tests with compose fails because compose tries to write to stderr and it is closed

Related issues

Nosetests has been in maintenance mode for years, its last release was
released in 2015. Some functionality it uses from Python is going to be
removed in upcoming versions.

Use pytest to replace nosetests as testrunner. Features used from nose
libraries are replaced by features from the Python standard library and
from pytest.

(cherry picked from commit a6e2e24)
@jsoriano jsoriano requested a review from a team as a code owner August 6, 2020 15:59
@jsoriano jsoriano added [zube]: In Review backport Team:Automation Label for the Observability productivity team Team:Platforms Label for the Integrations - Platforms team labels Aug 6, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 6, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 6, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 6, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20478 updated]

  • Start Time: 2020-08-11T08:53:10.275+0000

  • Duration: 80 min 0 sec

Test stats 🧪

Test Results
Failed 0
Passed 17637
Skipped 1836
Total 19473

Steps errors

Expand to view the steps failures

  • Name: Install Go 1.14.4
    • Description: .ci/scripts/install-go.sh

    • Duration: 1 min 32 sec

    • Start Time: 2020-08-11T09:17:39.793+0000

    • log

@jsoriano
Copy link
Member Author

jsoriano commented Aug 8, 2020

jenkins run the tests please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Automation Label for the Observability productivity team Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants