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

[ENH] Testing with Tox #4481

Merged
merged 1 commit into from
Mar 11, 2020
Merged

[ENH] Testing with Tox #4481

merged 1 commit into from
Mar 11, 2020

Conversation

JakaKokosar
Copy link
Member

@JakaKokosar JakaKokosar commented Mar 2, 2020

Issue

Fixes #4324

Invoking python setup.py test is now deprecated. Judging by this comment pypa/setuptools#1684 (comment), authors of setuptools have discouraged this for quite some time now.

They suggest that Tox is used as a new "frontend" for running project tests. While this is not strictly necessary for us to do (we can use unittest/pytest directly) it is nice because we can define the steps for building and testing Orange in one place. This means that by invoking tests with Tox we can run them on any CI (or locally) in a python environment that is defined and created by this tool. Also, it seems that using Tox is becoming a trend in all major python projects.

Note that this adds a bit of overhead. It creates new .tox folder that is used to create new test environments. If one would like to bypass Tox entirely you need to use unittest/pytest or invoking setup.py while it lasts :).

Description of changes

New configuration file tox.ini is added.

Some of the steps that are defined and ready to use in this PR:

  • pip install tox
  • running:
    • tox -e py36/py37/py38 will run entire Orange test suit on python 3.6/3.7/3.8 (if it's installed on you machine)
    • tox -e coverage will run tests and output coverage report.
    • tox -e build_doc will build documentation and fail if something is broken.
    • tox -e add-ons will build orange with your changes, install some of the supported add-ons (we can extend this list) and run test discovery in orangecontrib folder.

See #4482 how tox can be used in CI configuration.

Comment on lines 50 to 51
self.assertLessEqual(len(inliers), 136)
self.assertGreaterEqual(len(outliers), 14)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to use assertIn here (like you did below)?

@lanzagar
Copy link
Contributor

lanzagar commented Mar 6, 2020

I have some trouble running this locally, so I would go over it together with you when we get a chance.
(tox -e py38 ended with ERROR: py38: commands failed)

@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

Merging #4481 into master will increase coverage by 0.44%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4481      +/-   ##
==========================================
+ Coverage   83.18%   83.62%   +0.44%     
==========================================
  Files         268      274       +6     
  Lines       53997    58375    +4378     
==========================================
+ Hits        44917    48819    +3902     
- Misses       9080     9556     +476

@JakaKokosar JakaKokosar changed the title [WIP] Testing with Tox Testing with Tox Mar 9, 2020
@JakaKokosar JakaKokosar changed the title Testing with Tox [ENH] Testing with Tox Mar 9, 2020
@lanzagar
Copy link
Contributor

If anyone else wants to take a look please do. Otherwise I am in favor of merging this.
(my problems with some widget tests are unrelated to the changes here and can be investigated separately)

@markotoplak markotoplak merged commit 7e11473 into master Mar 11, 2020
@markotoplak markotoplak deleted the tox branch March 11, 2020 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing: switch to tox
4 participants