Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561038 - dev-python/pbr-1.8.0 (and 1.[76].0) fail tests with missing directory "git"
Summary: dev-python/pbr-1.8.0 (and 1.[76].0) fail tests with missing directory "git"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 555570
  Show dependency tree
 
Reported: 2015-09-21 14:50 UTC by Tobias Klausmann (RETIRED)
Modified: 2015-09-22 15:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-python/pbr-1.8.0 build/test log (dev-python:pbr-1.8.0:20150921-144637.log,82.73 KB, text/plain)
2015-09-21 14:50 UTC, Tobias Klausmann (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Klausmann (RETIRED) gentoo-dev 2015-09-21 14:50:12 UTC
Created attachment 412456 [details]
dev-python/pbr-1.8.0 build/test log

Example error:

FAIL: pbr.tests.test_packaging.TestVersions.test_capitalized_headers_partial(preversioned)
tags: worker-2
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:''
  pythonlogging:'pbr'
  stderr
  stdout

Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pbr-1.8.0/work/pbr-1.8.0-python3_4/pbr/tests/test_packaging.py", line 274, in setUp
    self.repo = self.useFixture(TestRepo(self.package_dir))
  File "/usr/lib/python3.4/site-packages/testtools/testcase.py", line 679, in useFixture
    reraise(*exc_info)
  File "/usr/lib/python3.4/site-packages/testtools/_compat3x.py", line 16, in reraise
    raise exc_obj.with_traceback(exc_tb)
  File "/usr/lib/python3.4/site-packages/testtools/testcase.py", line 666, in useFixture
    fixture.setUp()
  File "/var/tmp/portage/dev-python/pbr-1.8.0/work/pbr-1.8.0-python3_4/pbr/tests/test_packaging.py", line 73, in setUp
    base._run_cmd(['git', 'init', '.'], self._basedir)
  File "/var/tmp/portage/dev-python/pbr-1.8.0/work/pbr-1.8.0-python3_4/pbr/tests/base.py", line 202, in _run_cmd
    stderr=subprocess.PIPE, cwd=cwd)
  File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
Comment 1 Alex Brandt (RETIRED) gentoo-dev 2015-09-21 15:18:50 UTC
Looks like this needs the normal test function from openstack packages that invokes testrepository directly after removing the cached results.

See dev-python/os-client-config for example.

Snippet:

```
    rm -rf .testrepository || die "couldn't remove '.testrepository' under ${EPTYHON}"

    testr init || die "testr init failed under ${EPYTHON}"
    testr run || die "testr run failed under ${EPYTHON}"
```

Not sure if this will solve this issue but will bring testing in line with the rest of openstack.
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2015-09-22 02:43:37 UTC
from the tox.ini

commands =
  python setup.py testr --testr-args='{posargs}'

This is what I used as the basis to replace the above snippet with
    esetup.py testr 
in this and another package's ebuild. By calling or running module testr, it is to my understanding functionally equivalent.  
The use of the rm -rf .testrepository can be made redundant by use of DISTUTILS_IN_SOURCE_BUILD=1 which I have already been over.

Then:

dev-python/pbr $ PYTHON_TARGETS="python2_7 python3_3 python3_4" ebuild pbr-1.8.0.ebuild clean test
 yield 
PASSED (id=0, skips=10)
 * python3_3: running distutils-r1_run_phase _clean_egg_info
 * python3_4: running distutils-r1_run_phase _clean_egg_info
 * python2_7: running distutils-r1_run_phase _clean_egg_info
>>> Completed testing dev-python/pbr-1.8.0

ditto pbr-1.7.0.ebuild.

with
$ PYTHON_TARGETS="pypy" ebuild pbr-1.7.0.ebuild clean test

/usr/bin/pypy setup.py testr
running testr

FAIL: pbr.tests.test_wsgi.TestWsgiScripts.test_wsgi_script_install
tags: worker-2

error: [Errno 13] Permission denied: '/usr/bin/pbr_test_cmd'
(might need root status)

error: testr failed (1)
Ran 136 tests in 29.229s
FAILED (id=0, failures=1, skips=10)

Won't even bother with pypy3.
So im my amd64 system cannot replicate. No idea what or where the missing  directory "git".
Given the state of interest in pypy, I'd simply sed out this test when run under pypy. However, this bug was filed for failing under py2.7 3.4
Comment 3 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-09-22 06:31:26 UTC
the tests require git to be installed, as mentioned here we don't need it for actual running but we do for testing.

https://bugs.launchpad.net/pbr/+bug/1326682
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-09-22 06:35:30 UTC
fixed in place
Comment 5 Tobias Klausmann (RETIRED) gentoo-dev 2015-09-22 07:47:21 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #4)
> fixed in place

You only touched 1.8.0, AFAICT, so we shall ignore 1.7.0 and 1.6.0 for the blocked bug?
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-09-22 15:00:12 UTC
yes