Test Error on building 1.0.6 as an RPM on CentOS 7

30 views
Skip to first unread message

Ryan Skadberg

unread,
Jun 8, 2015, 3:15:13 PM6/8/15
to trac-...@googlegroups.com
I'm trying to build an RPM for 1.0.6.post2 and get this error on the test portion:

======================================================================

FAIL: test_error_with_lazy_translation (trac.db.tests.sqlite_test.DatabaseFileTestCase)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/root/rpmbuild/BUILD/Trac-1.0.6.post2/trac/db/tests/sqlite_test.py", line 95, in test_error_with_lazy_translation

    self.fail('ConfigurationError not raised')

AssertionError: ConfigurationError not raised


======================================================================

FAIL: test_no_permissions (trac.db.tests.sqlite_test.DatabaseFileTestCase)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/root/rpmbuild/BUILD/Trac-1.0.6.post2/trac/db/tests/sqlite_test.py", line 77, in test_no_permissions

    self.fail('ConfigurationError not raised')

AssertionError: ConfigurationError not raised


----------------------------------------------------------------------

Ran 1725 tests in 136.370s


FAILED (failures=2)

SKIP: functional tests (Twill not installed)


-----------------


I can build 1.0.4 without issue, so it seems that something changed between 1.0.4 and 1.0.6.post2.  Anyone have any thoughts?


Thanks!

Skadz


Ryan Ollos

unread,
Jun 8, 2015, 3:34:02 PM6/8/15
to trac-...@googlegroups.com
Those test cases were added in 1.0.6. I'm unsure of why they are failing in your case though.

Could you please try the following equivalent manual test case and let us know your result?
- Create an environment "trac-admin env initenv"
- Delete the trac.db file "rm env/db/trac.db"
- Start tracd: "tracd -s -p 8000 env"

Which version of Python are you running?

- Ryan 

Jun Omae

unread,
Jun 8, 2015, 11:07:06 PM6/8/15
to trac-...@googlegroups.com
On Tue, Jun 9, 2015 at 4:33 AM, Ryan Ollos <rjo...@gmail.com> wrote:
> On Mon, Jun 8, 2015 at 11:06 AM, Ryan Skadberg <sk...@skadz.com> wrote:
>> I can build 1.0.4 without issue, so it seems that something changed
>> between 1.0.4 and 1.0.6.post2. Anyone have any thoughts?


Thanks for the reporting.

Reproduced on CentOS 6 and 7. I just confirmed that all tests pass on
Ubuntu 12.04.
I'll investigate it.


[root@5ed23e541490 /]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@5ed23e541490 /]# virtualenv /tmp/tracvenv
New python executable in /tmp/tracvenv/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
[root@5ed23e541490 /]# /tmp/tracvenv/bin/python -V
Python 2.7.5
[root@5ed23e541490 /]# /tmp/tracvenv/bin/pip install Genshi==0.6
Downloading/unpacking Genshi==0.6
Downloading Genshi-0.6.tar.gz (433kB): 433kB downloaded
Running setup.py egg_info for package Genshi

warning: no previously-included files found matching 'doc/2000ft.graffle'
warning: no previously-included files matching '*' found under
directory 'doc/logo.lineform'
Installing collected packages: Genshi
Running setup.py install for Genshi

warning: no previously-included files found matching 'doc/2000ft.graffle'
warning: no previously-included files matching '*' found under
directory 'doc/logo.lineform'
Successfully installed Genshi
Cleaning up...
[root@5ed23e541490 /]# cd /tmp
[root@5ed23e541490 tmp]# tar xzf Trac-1.0.6.post2.tar.gz
[root@5ed23e541490 tmp]# cd Trac-1.0.6.post2
[root@5ed23e541490 Trac-1.0.6.post2]# /tmp/tracvenv/bin/python
setup.py test -s trac.db.tests.sqlite_test.suite
running test
running egg_info
writing requirements to Trac.egg-info/requires.txt
writing Trac.egg-info/PKG-INFO
writing top-level names to Trac.egg-info/top_level.txt
writing dependency_links to Trac.egg-info/dependency_links.txt
writing entry points to Trac.egg-info/entry_points.txt
reading manifest file 'Trac.egg-info/SOURCES.txt'
writing manifest file 'Trac.egg-info/SOURCES.txt'
running build_ext
SKIP: fine-grained permission tests (ConfigObj not installed)
test_error_with_lazy_translation
(trac.db.tests.sqlite_test.DatabaseFileTestCase) ... FAIL
test_missing_tracdb (trac.db.tests.sqlite_test.DatabaseFileTestCase) ... ok
test_no_permissions (trac.db.tests.sqlite_test.DatabaseFileTestCase) ... FAIL

======================================================================
FAIL: test_error_with_lazy_translation
(trac.db.tests.sqlite_test.DatabaseFileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/Trac-1.0.6.post2/trac/db/tests/sqlite_test.py", line 95,
in test_error_with_lazy_translation
self.fail('ConfigurationError not raised')
AssertionError: ConfigurationError not raised

======================================================================
FAIL: test_no_permissions (trac.db.tests.sqlite_test.DatabaseFileTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/Trac-1.0.6.post2/trac/db/tests/sqlite_test.py", line 77,
in test_no_permissions
self.fail('ConfigurationError not raised')
AssertionError: ConfigurationError not raised

----------------------------------------------------------------------
Ran 3 tests in 10.061s

FAILED (failures=2)

--
Jun Omae <jun...@gmail.com> (大前 潤)

Jun Omae

unread,
Jun 9, 2015, 3:44:04 AM6/9/15
to trac-...@googlegroups.com
On Tue, Jun 9, 2015 at 12:07 PM, Jun Omae <jun...@gmail.com> wrote:
> Reproduced on CentOS 6 and 7. I just confirmed that all tests pass on
> Ubuntu 12.04.
> I'll investigate it.

Reproduced on Ubuntu 12.04. The test failing when it run by root user
(or using fakeroot utility).

$ fakeroot /tmp/tracvenv/bin/python setup.py test -s
trac.db.tests.sqlite_test.suite
...
Ran 3 tests in 0.223s

FAILED (failures=2)


The following patch would fix the issue. I'll apply this to 1.0-stable later.

diff --git a/trac/db/tests/sqlite_test.py b/trac/db/tests/sqlite_test.py
index c1ccefd..d1fb3ea 100644
--- a/trac/db/tests/sqlite_test.py
+++ b/trac/db/tests/sqlite_test.py
@@ -78,9 +78,12 @@ class DatabaseFileTestCase(unittest.TestCase):
except ConfigurationError, e:
self.assertIn('requires read _and_ write permissions', unicode(e))

+ if os.name == 'posix' and os.getuid() == 0:
+ del test_no_permissions # For root, os.access() always returns True
+
def test_error_with_lazy_translation(self):
self._create_env()
- os.chmod(self.db_path, 0444)
+ os.remove(self.db_path)
env = Environment(self.env_path)
chrome = Chrome(env)
dispatcher = RequestDispatcher(env)
@@ -94,7 +97,9 @@ class DatabaseFileTestCase(unittest.TestCase):
self._db_query(env)
self.fail('ConfigurationError not raised')
except ConfigurationError, e:
- self.assertIn('requires read _and_ write permissions', unicode(e))
+ message = unicode(e)
+ self.assertIn('Database "', message)
+ self.assertIn('" not found.', message)
finally:
translation.deactivate()

Ryan Skadberg

unread,
Jun 9, 2015, 10:45:18 AM6/9/15
to trac-...@googlegroups.com
Thanks Jun!  This got me all fixed up.

Skadz

Greg Earle

unread,
Jul 8, 2015, 6:26:08 PM7/8/15
to trac-...@googlegroups.com
I hate to dredge-up a month-old thread, but I had the same problem.

I found a "trac-1.0.6-1.post2.1.sdl7.noarch.rpm" for something called
"PIUAS/Springdale Linux 7", a CentOS-like RHEL clone from Princeton.

Trying to rebuild their RPM on RHEL 7.1 from their SRPM (dated
"27-May-2015 09:08 3.5M"):

http://springdale.math.ias.edu/data/puias/unsupported/7.1/SRPMS/trac-1.0.6-1.post2.1.sdl7.src.rpm

I hit the same exact 'AssertionError: ConfigurationError not raised' errors
in .../trac/db/tests/sqlite_test.py that Ryan Skadberg did.

I first thought, if the fix is to alter .../trac/db/tests/sqlite_test.py
like Jun's patch does, then how were Springdale Linux able to get their RPM
to build, given that it has the same unpatched version of sqlite_test.py?

It turned out it works fine if I run "rpmbuild" as "mockbuild" rather than
as "root". So maybe Jun's patch isn't really necessary - just a

self.fail('Do not build me as root, turkey')

might be sufficient :-)

- Greg

Reply all
Reply to author
Forward
0 new messages