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

Tests failing on Ubuntu 20.04 (focal) with python 3.8.2 #550

Closed
nicolashainaux opened this issue Aug 28, 2020 · 7 comments
Closed

Tests failing on Ubuntu 20.04 (focal) with python 3.8.2 #550

nicolashainaux opened this issue Aug 28, 2020 · 7 comments
Assignees

Comments

@nicolashainaux
Copy link

I'm trying to package pyfakefs for Ubuntu focal and the build on launchpad fails. I have reproduced the same error on a Virtual Box Ubuntu: a bunch of python3 related packages were already installed for another package (debhelper, dh-python, python3-all, python3-setuptools, tox, python3-pytest, python3-pytest-cov), so I just git cloned the repo (but I also tested with the latest release) and in master branch, ran pytest-3.

I've pasted the results here.

You can check the build log, that contains the same tests errors here (quite at bottom of the page).

Environment

nico@xubuntu2004:~/dev/pyfakefs-4.1.0$ python -c "import platform; print(platform.platform())"
Linux-5.4.0-42-generic-x86_64-with-glibc2.29
nico@xubuntu2004:~/dev/pyfakefs-4.1.0$ python -c "import sys; print('Python', sys.version)"
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0]
nico@xubuntu2004:~/dev/pyfakefs-4.1.0$ python -c "from pyfakefs.fake_filesystem import __version__; print('pyfakefs', __version__)"
pyfakefs 4.1.0
nico@xubuntu2004:~/dev/pyfakefs-4.1.0$
@mrbean-bremen
Copy link
Member

mrbean-bremen commented Aug 29, 2020

Sorry, seem to have missed this issue... All failing tests don't find the fs fixture provided by pyfakefs -- pyfakefs seems not to be installed properly. Can you please show how you are invoking the tests?

I see that you are collectiing and running the tests using pytest. Some of the tests (the ones using the fs fixture) need pyfakefs to be installed -- in the CI tests we do a pip install . before running the tests.
I'm not familiar with the packaging infrastructure, is there a place where we can add this so it will be run before the tests are executed?

@mrbean-bremen
Copy link
Member

Actually, this can probably be done in the tests - I will have a look at this.

@mrbean-bremen mrbean-bremen self-assigned this Aug 29, 2020
mrbean-bremen added a commit that referenced this issue Aug 29, 2020
- import fs in conftest.py used in tests
- remove tests for deprecated function
- see #550
@mrbean-bremen
Copy link
Member

@nicolashainaux - this shall be fixed in master, can you test this with master? If it works, I will probably make a new release.

@nicolashainaux
Copy link
Author

Hello,

Sorry for the delay, I wasn't expecting such a quick answer and was pretty busy too. Thank you for this very quick answer!!

So, I've tested on the virtual machine, I get much better results:

$ pytest-3
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.8.2, pytest-4.6.9, py-1.8.1, pluggy-0.13.0
rootdir: /home/nico/dev/pyfakefs
plugins: cov-2.8.1
collected 1955 items                                                                                                                                                                                                                         

pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py s                                                                                                                                                                             [  0%]
pyfakefs/pytest_tests/pytest_fixture_param_test.py x..                                                                                                                                                                                 [  0%]
pyfakefs/pytest_tests/pytest_fixture_test.py x..                                                                                                                                                                                       [  0%]
pyfakefs/pytest_tests/pytest_plugin_test.py ...                                                                                                                                                                                        [  0%]
pyfakefs/tests/dynamic_patch_test.py .....                                                                                                                                                                                             [  0%]
pyfakefs/tests/example_test.py .......s                                                                                                                                                                                                [  1%]
pyfakefs/tests/fake_filesystem_glob_test.py .........                                                                                                                                                                                  [  1%]
pyfakefs/tests/fake_filesystem_shutil_test.py ...............s...sssssssssssssssssssss...........sssssssssss                                                                                                                           [  4%]
pyfakefs/tests/fake_filesystem_test.py .........................................................................................................................................................................s..................... [ 14%]
......................................................                                                                                                                                                                                 [ 17%]
pyfakefs/tests/fake_filesystem_unittest_test.py .....................x.....x..................                                                                                                                                         [ 19%]
pyfakefs/tests/fake_filesystem_vs_real_test.py ...........................                                                                                                                                                             [ 21%]
pyfakefs/tests/fake_open_test.py .......................................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss........ssssssss..........ssssssssss.......sssssss..... [ 31%]
sssss.....sss..ss.....sssss..................ssssssssssssssssss                                                                                                                                                                        [ 34%]
pyfakefs/tests/fake_os_test.py ....................................................................................................................................................................................................... [ 44%]
............................................................................ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 56%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...................................................................................ssssssssssssssssssssssssss [ 68%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssss...................s...................................s......sssssssssssssssssssssssssssssssssssssssssssssssss..........ssssssssss......................................ssss [ 79%]
ssssssssss............ssssssssssssss............ssssssssssssss............ssssssssssssss.......sss                                                                                                                                     [ 84%]
pyfakefs/tests/fake_pathlib_test.py ....s.ssssssssssssss.s......ssssssss...........s.sss...sssssssssssssssssss...s..................ssssssssssssssssssssss.....................................sssssssssssssssssssssssssssssssssssss.. [ 94%]
...                                                                                                                                                                                                                                    [ 94%]
pyfakefs/tests/fake_stat_time_test.py .......sssssss........ssssssss.......sssssss........ssssssss.....sssss......ssssss                                                                                                               [ 99%]
pyfakefs/tests/fake_tempfile_test.py ........                                                                                                                                                                                          [ 99%]
pyfakefs/tests/mox3_stubout_test.py .........                                                                                                                                                                                          [100%]

============================================================================================ 1160 passed, 791 skipped, 4 xfailed in 21.71 seconds ============================================================================================
nico@xubuntu2004:~/dev/pyfakefs $

The tests end in green, so I guess this is OK. I don't know what "xfailed" are about, though.
I'm sending this to launchpad to check it works there too. I'll tell soon.

@mrbean-bremen
Copy link
Member

xfailed are tests that are expected to fail. If that works, you probably would need a new release, correct?

@nicolashainaux
Copy link
Author

nicolashainaux commented Sep 2, 2020

Hello, this seems to work fine. I could upload to launchpad and the build succeeded there, so I could add the PPA to my virtual machine and sudo apt install python3-pyfakefs correctly.

I needed to package pyfakefs for Ubuntu to be able to build another package that relies on pyfakefs for the tests. To get it quickly working, I've created a PPA. So, as it is, I do not need a new official release. Well, if anyone would like to use it, it would be more practical to match an official version, but technically this is not required at all. Currently, it shows up as 4.1.0-0ubuntu2, what means "version 4.1.0 that does not originate from a debian package, but contains the necessary modifications to be released for Ubuntu (2d version)".

Actually, I will need to test if my package does work fine with my tests for the other project. It should 😄 If it doesn't, I'll reopen this issue or open a new one, depending on the problem, but I think it won't be necessary.

If the package can make its way to the official repositories, then probably a new release would be necessary. But getting to the official repositories is a longer process. Also, I think it cannot be available for the current Ubuntu version, it can only be available for the next one, in the best case. That would be actually very good and the best solution for me. Maybe I'll try to initiate it. The fact that it could be built for a PPA is (in my opinion) already a good thing: it means that the minimal work to package it is already done and OK.

Many thanks for your help and quick answers!!

@mrbean-bremen
Copy link
Member

Ok, thank you - in this case we will wait with a release until some more changes accumulate. Having pyfakefs in some Ubuntu release would be nice - thanks for considering this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants