duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Failure running tests.


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] Failure running tests.
Date: Tue, 3 Sep 2019 12:52:17 -0500

Scott,

When I run "tox -e py37" on my Mac I have no errors.

Your errors in test_selection are the same as on py36, very weird.

The permission errors causing test_replicate and test_restart are also odd.  Do you have the system locked down more than normal?  I test using just my own creds, not root..

The unicode errors when reporting the permission errors are something that needs to be fixed, but are a distraction at this point.

Try running under tox instead of fink just to eliminate one variable.

I've pasted my run.  Perhaps there is a version issue between our two systems?

...Thanks,
...Ken

ken@dione:~/workspace/duplicity-src8$ tox -e py37
GLOB sdist-make: /Users/ken/workspace/duplicity-src8/setup.py
py37 create: /Users/ken/workspace/duplicity-src8/.tox/py37
py37 installdeps: -rrequirements.txt
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py37 inst: /Users/ken/workspace/duplicity-src8/.tox/.tmp/package/1/duplicity-0.0dev.tar.gz
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py37 installed: alabaster==0.7.12,astroid==2.2.5,atomicwrites==1.3.0,attrs==19.1.0,Babel==2.7.0,certifi==2019.6.16,chardet==3.0.4,coverage==4.5.4,docutils==0.15.2,duplicity==0.0.dev0,fasteners==0.15,fastimport==0.9.2,filelock==3.0.12,future==0.17.1,idna==2.8,imagesize==1.1.0,importlib-metadata==0.20,isort==4.3.21,Jinja2==2.10.1,lazy-object-proxy==1.4.2,MarkupSafe==1.1.1,mccabe==0.6.1,mock==3.0.5,monotonic==1.5,more-itertools==7.2.0,packaging==19.1,pexpect==4.7.0,pluggy==0.12.0,ptyprocess==0.6.0,py==1.8.0,pycodestyle==2.5.0,Pygments==2.4.2,pylint==2.3.1,pyparsing==2.4.2,pytest==5.1.2,pytest-cov==2.7.1,pytest-runner==5.1,pytz==2019.2,requests==2.22.0,six==1.12.0,snowballstemmer==1.9.0,Sphinx==2.2.0,sphinxcontrib-applehelp==1.0.1,sphinxcontrib-devhelp==1.0.1,sphinxcontrib-htmlhelp==1.0.2,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.2,sphinxcontrib-serializinghtml==1.1.3,toml==0.10.0,tox==3.14.0,typed-ast==1.4.0,urllib3==1.25.3,virtualenv==16.7.5,wcwidth==0.1.7,wrapt==1.11.2,zipp==0.6.0
py37 run-test-pre: PYTHONHASHSEED='3996759775'
py37 run-test: commands[0] | python compilec.py
running build
running build_ext
building '_librsync' extension
creating build
creating build/temp.macosx-10.14-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c _librsyncmodule.c -o build/temp.macosx-10.14-x86_64-3.7/_librsyncmodule.o
creating build/lib.macosx-10.14-x86_64-3.7
clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-3.7/_librsyncmodule.o -L/usr/local/lib -lrsync -o build/lib.macosx-10.14-x86_64-3.7/_librsync.cpython-37m-darwin.so
py37 run-test: commands[1] | pytest --cov=duplicity --cov-append --cov-report=
================================================= test session starts ==================================================
platform darwin -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0
cachedir: .tox/py37/.pytest_cache
rootdir: /Users/ken/workspace/duplicity-src8, inifile: tox.ini, testpaths: testing/unit, testing/functional
plugins: cov-2.7.1
collected 428 items                                                                                                    

testing/unit/test_backend.py ............                                                                        [  2%]
testing/unit/test_backend_instance.py ............................................................               [ 16%]
testing/unit/test_collections.py ........                                                                        [ 18%]
testing/unit/test_diffdir.py .......                                                                             [ 20%]
testing/unit/test_dup_temp.py ..                                                                                 [ 20%]
testing/unit/test_dup_time.py ......................                                                             [ 25%]
testing/unit/test_file_naming.py .............                                                                   [ 28%]
testing/unit/test_globmatch.py ...........................                                                       [ 35%]
testing/unit/test_gpg.py ..........                                                                              [ 37%]
testing/unit/test_gpginterface.py ......                                                                         [ 39%]
testing/unit/test_lazy.py ............................                                                           [ 45%]
testing/unit/test_manifest.py .....                                                                              [ 46%]
testing/unit/test_patchdir.py ........                                                                           [ 48%]
testing/unit/test_path.py .....                                                                                  [ 49%]
testing/unit/test_selection.py ............................................................................      [ 67%]
testing/unit/test_statistics.py .......                                                                          [ 69%]
testing/unit/test_tarfile.py .                                                                                   [ 69%]
testing/unit/test_tempdir.py ..                                                                                  [ 69%]
testing/unit/test_util.py .                                                                                      [ 70%]
testing/functional/test_badupload.py .                                                                           [ 70%]
testing/functional/test_cleanup.py ...                                                                           [ 71%]
testing/functional/test_final.py ...........................                                                     [ 77%]
testing/functional/test_log.py .                                                                                 [ 77%]
testing/functional/test_rdiffdir.py .                                                                            [ 77%]
testing/functional/test_replicate.py ...                                                                         [ 78%]
testing/functional/test_restart.py ................................                                              [ 85%]
testing/functional/test_selection.py .......................................ss...........                        [ 98%]
testing/functional/test_verify.py ........                                                                       [100%]

=================================================== warnings summary ===================================================
.tox/py37/lib/python3.7/site-packages/past/types/oldstr.py:5
  /Users/ken/workspace/duplicity-src8/.tox/py37/lib/python3.7/site-packages/past/types/oldstr.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Iterable

.tox/py37/lib/python3.7/site-packages/past/builtins/misc.py:4
  /Users/ken/workspace/duplicity-src8/.tox/py37/lib/python3.7/site-packages/past/builtins/misc.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Mapping

testing/unit/test_globmatch.py:100
  /Users/ken/workspace/duplicity-src8/testing/unit/test_globmatch.py:100: DeprecationWarning: invalid escape sequence \/
    u"\/usr\/[^/]*\/bin\/")

-- Docs: https://docs.pytest.org/en/latest/warnings.html


================================ 426 passed, 2 skipped, 3 warnings in 560.97s (0:09:20) ================================
_______________________________________________________ summary ________________________________________________________
  py37: commands succeeded
  congratulations :)

On Mon, Sep 2, 2019 at 4:54 PM Scott Hannahs <address@hidden> wrote:
Ken,

I am running them under the test phase of “fink”.  I use fink rather than homebrew.

so the test script is the following.  I am not sure if the chmod is still necessary but it used to be.  The build is done while running as an unprivileged user called “fink-bld”. This script should call tox directly and not be an issue.  I am fairly happy that it passed 409 different tests!

TestScript: <<
        #!/bin/sh -ev
        ulimit -n 5120
        chmod 0700 `pwd`/testing/gnupg
        %p/bin/python3.7 setup.py test
<<

I am using the install of python from the 3.7 sources.  I patched duplicity so that every line “#!/bin/env python” was replaced with ‘#!/bin/env python3.7” as I have done in the past for python 2.7.

The python version is 3.7.4.
% python3.7 --version
Python 3.7.4

I heard about the errors in 3.6 and so chose to build under 3.7.  I am running a fairly old OS but python 2.7 is also getting a bit old.

The script above should call tox directly and that is the 3.7 version as far as I can tell.  I can run tox directly if that helps.

% tox --version
3.0.0 imported from /sw/lib/python3.7/site-packages/tox/__init__.py

I wasn’t sure I could attach a file to this list, but I will try with the test log.  There is some fink specific listing as it builds duplicity and then goes straight into the tests.  This file has both he standard and error output redirected to it.  I had some tests fail under python2.7 previously and we never got to the bottom of that.

The OS is Mac OS 10.11.6 and maybe had a flawed installation of unicode?  Or an old unicode missing some newer definitions?  The characters seem to show up in the error output correctly but maybe that is an issue.  However the unicode comparison should be comparing the 4 hex digits of a unicode character and that should work.

Thanks for the help.
-Scott


On Sep 2, 2019, at 5:16 PM, Kenneth Loafman <address@hidden> wrote:

Hi Scott,

How are you running the tests?  We recommend just using "tox" as the test driver.

Are you using python37 from homebrew or macports.  I've tested using the homebrew install under 10.14.

You should not be getting any errors on py27 or py37.  There are 4 known errors on py36.

A bit more detail, e.g. full test logs, would help when reporting.

...Thanks,
...Ken


On Mon, Sep 2, 2019 at 3:58 PM Scott Hannahs via Duplicity-talk <address@hidden> wrote:
I am going to reply to my own message.. :-)  Most of the errors were due to my not reading my own build notes. :-(  I have run the tests again and seem to have several errors due to unicode issues which was the big advantage of moving to duplicity 8.  I am down to 17 errors and 3 warnings:
======== 17 failed, 409 passed, 2 skipped, 3 warnings in 894.00 seconds ========


These two errors have me stumped not being a python or unicode expert.  os.py looks reasonable to me and should return a string or path.
b'  File "/sw/src/fink.build/duplicity-0.8.04-1/duplicity-0.8.04/duplicity/path.py", line 476, in <lambda>'
b'    util.maybe_ignore_errors(lambda: os.chown(other.name, self.stat.st_uid, self.stat.st_gid))'
b"PermissionError: [Errno 1] Operation not permitted: b'testfiles/cache/3f6f90580e457c90e7202bc33cd9e363/duplicity-full-signatures.19700102T034640Z.sigtar.gz'"
b'During handling of the above exception, another exception occurred:'
b'Traceback (most recent call last):'
b'  File "../bin/duplicity", line 157, in <module>'
b'    if u"Forced assertion for testing" in util.uexc(e):'
b'  File "/sw/src/fink.build/duplicity-0.8.04-1/duplicity-0.8.04/duplicity/util.py", line 120, in uexc'
b'    return fsdecode(m)'
b'  File "/sw/lib/python3.7/os.py", line 821, in fsdecode'
b'    filename = fspath(filename)  # Does type-checking of `filename`.'
b'TypeError: expected str, bytes or os.PathLike object, not int'
...return_val: 1

So there is a permission error which may be normal since the testing is done in a non-admin account and cannot chown files.  But then there is a secondary error where fsdecode fails.  It looks like os.py does return the path and not an int but someone thinks it is getting a wrong type.

The other errors are also unicode related.
________________ TestUnicode.test_unicode_paths_square_brackets ________________

self = <testing.functional.test_selection.TestUnicode testMethod=test_unicode_paths_square_brackets>

    def test_unicode_paths_square_brackets(self):
        u""" Test --include and --exclude work with unicode paths with character options in []s and [!]s"""
        p = u"testfiles/select-unicode/"
        self.backup(u"full", u"testfiles/select-unicode",
                    options=[u"--exclude", p + u"прыклад/пример/例/Παράδειγμα/उदाहरण.txt",
                             u"--exclude", p + u"пры[к,и,р]лад/пример/例/Παράδειγμα/דוגמא.txt",
                             u"--exclude", p + u"прыклад/пр[!a,b,c]мер/例/მაგალითი/",
                             u"--include", p + u"прыклад/при[g,м,д]ер/例/",
                             u"--exclude", p + u"прыклад/пример/",
                             u"--include", p + u"прыклад/",
                             u"--include", p + u"օրինակ.txt",
                             u"--exclude", p + u"**"])
        self.restore()
        restore_dir = u"testfiles/restore_out"
        restored = self.directory_tree_to_list_of_lists(restore_dir)
        self.assertEqual(restored, [[u"прыклад", u"օրինակ.txt"],
>                                   [u"пример", u"উদাহরণ"], [u"例"], [u"Παράδειγμα"], [u"ઉદાહરણ.log"]])
E       AssertionError: Lists differ: [['пр[48 chars]'], ['Παράδειγμα'], ['דוגמא.txt', 'उदाहरण.txt', 'ઉદાહરણ.log']] != [['пр[48 chars]'], ['Παράδειγμα'], ['ઉદાહરણ.log']]
E       
E       First differing element 3:
E       ['Παράδειγμα']
E       ['Παράδειγμα']
E       
E         [['прыклад', 'օրինակ.txt'],
E          ['пример', 'উদাহরণ'],
E          ['例'],
E       -  ['Παράδειγμα'],
E       ?       ^^
E       
E       +  ['Παράδειγμα'],
E       ?       ^
E       
E       -  ['דוגמא.txt', 'उदाहरण.txt', 'ઉદાહરણ.log']]
E       +  ['ઉદાહરણ.log']]
The strings that are listed as different (element 3) but I am not quite sure what the issue is.  Unicode should be completely cross platform…  That is the point! :-)

-Scott


On Sep 1, 2019, at 5:49 PM, Scott Hannahs via Duplicity-talk <address@hidden> wrote:

Duplicity wizards,

I think I have successfully build duplicity version 0.8.04 on Mac OS X (python 3.7 and Mac OS X 10.11).  This was upgrading from my previous installation using python 2.7.

However the testing phase seems to fail  a  lot of tests.  The first group I understand since there is no tahoe backend installed.  I can live with that and will get around to adding backend support later.


_______________________________________________
Duplicity-talk mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/duplicity-talk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]