I want trac standlaone to enter debug mode when a failure is detected (in
the server) while running the functional test suite .
initially I tried to do this
{{{#!sh
$ python -m pdb trac/tests/functional/__init__.py
}}}
That obviously did not work as expected because the debugger entered debug
mode in the context of twill calls (performed to access the server) .
Then I patched trac/tests/functional/testenv.py like this
{{{#!sh
hg dif trac/tests/functional/testenv.py
diff -r df67d671a129 trac/tests/functional/testenv.py
--- a/trac/tests/functional/testenv.py Sun Apr 13 20:22:06 2014 +0000
+++ b/trac/tests/functional/testenv.py Tue Apr 15 16:10:42 2014 -0400
@@ -261,6 +261,7 @@
options += os.environ['TRAC_TEST_TRACD_OPTIONS'].split()
args.append(os.path.join(self.trac_src, 'trac', 'web',
'standalone.py'))
+ print args + options + [self.tracdir]
server = Popen(args + options + [self.tracdir],
stdout=self.logfile, stderr=self.logfile,
close_fds=close_fds,
}}}
... and finally I tried this
{{{#!sh
$ export FIGLEAF="/path/to/python -m pdb"
$ python trac/tests/functional/__init__.py
}}}
... and the value printed was
['/path/to/venv/bin/python', '-m', 'pdb',
'/path/to/trac//trac/web/standalone.py', '--port=8427', '-s',
'--hostname=127.0.0.1',
'--basic-auth=trac,/path/to/trac//testenv/htpasswd,',
'/path/to/trac//testenv/trac']
... which is kind of what I expected but ... the whole test suite never ran
at all i.e. I got this message
{{{
Exception: Timed out waiting for server to start.
}}}
Then I tried adding a .pdbrc file in ~/.pdbrc and ./.pdbrc with contents
{{{
c
}}}
... but w=that did not work either .
Why did I try this last approach ? Because of this :
{{{#!sh
/path/to/venv/bin/python -m pdb /path/to/trac//trac/web/standalone.py
--port=8427 -s --hostname=127.0.0.1
--basic-auth=trac,/path/to/trac//testenv/htpasswd,
/path/to/trac//testenv/trac
> /path/to/trac//trac/web/standalone.py(22)<module>()
-> import pkg_resources
(Pdb)
}}}
Therefore I ask ... is there any way of wrapping Trac standalone server
execution using pdb ?
--
Regards,
Olemis - @olemislc
Apache(tm) Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.