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

Subversion test failing in Mac OS #7968

Closed
deveshks opened this issue Apr 3, 2020 · 1 comment · Fixed by #7969
Closed

Subversion test failing in Mac OS #7968

deveshks opened this issue Apr 3, 2020 · 1 comment · Fixed by #7969
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@deveshks
Copy link
Contributor

deveshks commented Apr 3, 2020

Environment

  • pip version: 20.1.dev0
  • Python version: 3.8.2
  • OS: Mac OSX Catalina 10.15.4

I have installed pip from the source tree using pip install . in a virtualenv

Description

The test case test_subversion__call_vcs_version listed at https://github.com/pypa/pip/blob/master/tests/unit/test_vcs.py#L430 fails with an assertion error

Expected behavior

The test should pass.

How to Reproduce

Run tox -e py tests/unit/test_vcs.py::test_subversion__call_vcs_version -s to run the specific test in question.

Output

The failure output is as follows

$ tox -e py tests/unit/test_vcs.py::test_subversion__call_vcs_version -s
GLOB sdist-make: /Users/devesh/pip/setup.py
py inst-nodeps: /Users/devesh/pip/.tox/.tmp/package/1/pip-20.1.dev0.zip
py installed: WARNING: Could not generate requirement for distribution -ip 20.1.dev0 (/Users/devesh/pip/.tox/py/lib/python3.8/site-packages): Parse error at "'-ip==20.'": Expected W:(abcd...),apipkg==1.5,atomicwrites==1.3.0,attrs==19.3.0,cffi==1.14.0,coverage==5.0.4,cryptography==2.8,csv23==0.2,execnet==1.7.1,freezegun==0.3.15,mock==4.0.2,more-itertools==8.2.0,pip==20.1.dev0,pluggy==0.13.1,pretend==1.0.9,py==1.8.1,pycparser==2.20,pytest==3.8.2,pytest-cov==2.8.1,pytest-forked==1.1.3,pytest-rerunfailures==6.0,pytest-timeout==1.3.4,pytest-xdist==1.27.0,python-dateutil==2.8.1,PyYAML==5.3.1,scripttest==1.3,setuptools==46.1.3,six==1.14.0,virtualenv==16.7.10,Werkzeug==0.16.0,wheel==0.34.2
py run-test-pre: PYTHONHASHSEED='2829047682'
py run-test-pre: commands[0] | python -c 'import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)' /Users/devesh/pip/tests/data/common_wheels
py run-test-pre: commands[1] | python /Users/devesh/pip/tools/tox_pip.py wheel -w /Users/devesh/pip/tests/data/common_wheels -r /Users/devesh/pip/tools/requirements/tests-common_wheels.txt
Collecting setuptools>=40.8.0
  Using cached setuptools-46.1.3-py3-none-any.whl (582 kB)
  Saved ./tests/data/common_wheels/setuptools-46.1.3-py3-none-any.whl
Collecting wheel
  Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
  Saved ./tests/data/common_wheels/wheel-0.34.2-py2.py3-none-any.whl
Skipping setuptools, due to already being wheel.
Skipping wheel, due to already being wheel.
py run-test: commands[0] | pytest --timeout 300 tests/unit/test_vcs.py::test_subversion__call_vcs_version
======================================================== test session starts ========================================================
platform darwin -- Python 3.8.2, pytest-3.8.2, py-1.8.1, pluggy-0.13.1
rootdir: /Users/devesh/pip, inifile: setup.cfg
plugins: timeout-1.3.4, rerunfailures-6.0, forked-1.1.3, cov-2.8.1, xdist-1.27.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 1 item                                                                                                                    

tests/unit/test_vcs.py F                                                                                                      [100%]

============================================================= FAILURES ==============================================================
_________________________________________________ test_subversion__call_vcs_version _________________________________________________

    @need_svn
    def test_subversion__call_vcs_version():
        """
        Test Subversion.call_vcs_version() against local ``svn``.
        """
        version = Subversion().call_vcs_version()
        # All Subversion releases since 1.0.0 have used three parts.
>       assert len(version) == 3
E       assert 0 == 3
E        +  where 0 = len(())

tests/unit/test_vcs.py:436: AssertionError
====================================================== short test summary info ======================================================
FAIL tests/unit/test_vcs.py::test_subversion__call_vcs_version
===================================================== 1 failed in 0.29 seconds ======================================================
ERROR: InvocationError for command /Users/devesh/pip/.tox/py/bin/pytest --timeout 300 tests/unit/test_vcs.py::test_subversion__call_vcs_version (exited with code 1)

The error is because in https://github.com/pypa/pip/blob/master/src/pip/_internal/vcs/subversion.py#L204, we always assume that the version string, svn, version will be present in the first line, but that might not always be the case.

$ svn --version 
Warning: Failed to set locale category LC_NUMERIC to en_IN.
Warning: Failed to set locale category LC_TIME to en_IN.
Warning: Failed to set locale category LC_COLLATE to en_IN.
Warning: Failed to set locale category LC_MONETARY to en_IN.
Warning: Failed to set locale category LC_MESSAGES to en_IN.
svn, version 1.13.0 (r1867053)
   compiled Feb 19 2020, 02:08:03 on x86_64-apple-darwin19.3.0

Copyright (C) 2019 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.9 (compiled with 1.3.9)
  - handles 'http' scheme
  - handles 'https' scheme

The following authentication credential caches are available:

* Mac OS X Keychain
@deveshks
Copy link
Contributor Author

In order to move this self-created issue forward, I have created the PR #7969 and applied the requested changes to the same. Would appreciate reviews about the implementation to move the PR ahead and close this issue.

@pradyunsg pradyunsg changed the title Subversion test failing in MAC OSX Subversion test failing in Mac OS May 12, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 24, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jun 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
1 participant