I might have asked this before, but can't seem to find it. I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me? -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com
On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote:
I might have asked this before, but can't seem to find it.
I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me?
You mean your product unit tests? I've never been able to do this in practice. "./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks. The --dir option helps, but unfortunately you can only give it once (or rather, only the last one given matters). -- Paul Winkler http://www.slinkp.com
On Thu, Nov 17, 2005 at 12:42:47PM -0500, Paul Winkler wrote: | On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote: | > I might have asked this before, but can't seem to find it. | > | > I'm looking for a way to run all tests in $INSTANCE_HOME using the | > test.py script, but can't seem to get the majik combination of | > parameters together. Would anyone hint me? | | You mean your product unit tests? | I've never been able to do this in practice. | | "./bin/zopectl test" is supposed to do the job. | But in practice, so many third-party product tests either have | broken dependencies or pollute the test environment somehow | that something always breaks. | | The --dir option helps, but unfortunately you can only give it | once (or rather, only the last one given matters). Unfortunately, './bin/zopectl test' doesn't run on Windows. But I will give --dir a try. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com
Sidnei da Silva wrote:
Unfortunately, './bin/zopectl test' doesn't run on Windows. But I will give --dir a try.
I use the following in a batch script to run tests in exactly the same way as zopectl test: set ZOPE_HOME=C:\Zope\2.7.7 set PYTHON=%ZOPE_HOME%\bin\python.exe set INSTANCE_HOME=C:\Zope\MyInstance cls %PYTHON% %_HOME%\bin\test.py --config-file %INSTANCE_HOME%\etc\zope.conf --libdir=%INSTANCE_HOME%\Products --keepbytecode %1 %2 %3 %4 %5 %6 ...so I just type, for example: bin\runtests -vv MyProduct cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Fri, Nov 18, 2005 at 07:41:13AM +0000, Chris Withers wrote: | Sidnei da Silva wrote: | > | >Unfortunately, './bin/zopectl test' doesn't run on Windows. But I will | >give --dir a try. | | I use the following in a batch script to run tests in exactly the same | way as zopectl test: | | set ZOPE_HOME=C:\Zope\2.7.7 | set PYTHON=%ZOPE_HOME%\bin\python.exe | set INSTANCE_HOME=C:\Zope\MyInstance | cls | %PYTHON% %_HOME%\bin\test.py --config-file %INSTANCE_HOME%\etc\zope.conf | --libdir=%INSTANCE_HOME%\Products --keepbytecode %1 %2 %3 %4 %5 %6 | | ...so I just type, for example: | | | bin\runtests -vv MyProduct Thanks for the hint! -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com
Paul Winkler wrote:
On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote:
I might have asked this before, but can't seem to find it.
I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me?
"./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks.
bin/zopectl test Products/MyProduct ...has worked fine for me for many months now... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Withers wrote:
Paul Winkler wrote:
On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote:
I might have asked this before, but can't seem to find it.
I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me?
"./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks.
bin/zopectl test Products/MyProduct
...has worked fine for me for many months now...
Hmm, that should be a dotted name, rather than a path: $ bin/zopectl test Products.MyProduct Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.: $ bin/zopectl test OneProduct|AnotherProduct Run with --help to get docs on the command-line syntax: $ bin/zopectl test --help That pattern breaks on the Zope trunk, where you have to pass the module pattern as an option rather than an argument: $ bin/zopectl test -m MyProduct Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDfdp8+gerLs4ltQ4RAmteAKDDshzV3dYjbOHNKc1yl548oD3gpQCgx0lQ 79usMoLmPQQKiiedrrFJvxo= =fkW0 -----END PGP SIGNATURE-----
On Fri, Nov 18, 2005 at 08:43:24AM -0500, Tres Seaver wrote:
Chris Withers wrote:
Paul Winkler wrote:
"./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks.
bin/zopectl test Products/MyProduct
...has worked fine for me for many months now...
Hmm, that should be a dotted name, rather than a path:
$ bin/zopectl test Products.MyProduct
Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.:
$ bin/zopectl test OneProduct|AnotherProduct
Thanks for the hints, guys. The latter form seems to need quoting, at least under bash, to avoid the shell treating it as a pipe. So it would be $ bin/zopectl test "OneProduct|AnotherProduct" Anyway, my point is, you often can't just run everything because stuff breaks. And even with the "Foo|Bar" pattern, stuff still sometimes breaks, due to test environment pollution or other nastiness. The current worst offender I have installed is ZWiki 0.47 which kills the entire test run if it's installed, no matter what you give for the regex. I have no idea how it does that and yet manages to run just fine when you start Zope. Minor annoyances come from products like AdvancedQuery 0.6 whose tests depend on other packages that the product itself does not depend on, but at least it doesn't affect the rest of the test run. Example: pw@kermit NavCodeInstanceHome $ ./bin/zopectl test Products.BTreeFolder2 /usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module DeprecationWarning) Running tests via: /usr/bin/python /home/pw/Zope-2.7.7-final/bin/test.py -v --config-file /home/pw/NavCodeInstanceHome/etc/zope.conf --libdir Products Products.BTreeFolder2 Running unit tests at level 1 Running unit tests from /home/pw/NavCodeInstanceHome/Products Parsing /home/pw/NavCodeInstanceHome/etc/zope.conf /usr/lib/python2.4/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module DeprecationWarning) Traceback (most recent call last): File "/home/pw/Zope-2.7.7-final/bin/test.py", line 918, in ? process_args() File "/home/pw/Zope-2.7.7-final/bin/test.py", line 908, in process_args bad = main(module_filter, test_filter, libdir) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 677, in main files = find_tests(module_filter) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 478, in find_tests walk_with_symlinks(pathinit.testdir, finder.visit, rx) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 628, in walk_with_symlinks walk_with_symlinks(name, visit, arg) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 628, in walk_with_symlinks walk_with_symlinks(name, visit, arg) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 622, in walk_with_symlinks visit(arg, path, names) File "/home/pw/Zope-2.7.7-final/bin/test.py", line 458, in visit __import__(pkg) File "/home/pw/NavCodeInstanceHome/Products/ZWiki/__init__.py", line 12, in ? import ZWikiPage, ZWikiWeb, Permissions, Defaults, OutlineSupport File "/home/pw/NavCodeInstanceHome/Products/ZWiki/ZWikiPage.py", line 87, in ? DEFAULT_PAGETYPE = PAGETYPES[0] IndexError: list index out of range -- Paul Winkler http://www.slinkp.com
On Fri, 2005-11-18 at 08:43 -0500, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Chris Withers wrote:
Paul Winkler wrote:
On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote:
I might have asked this before, but can't seem to find it.
I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me?
"./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks.
bin/zopectl test Products/MyProduct
...has worked fine for me for many months now...
Hmm, that should be a dotted name, rather than a path:
$ bin/zopectl test Products.MyProduct
Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.:
$ bin/zopectl test OneProduct|AnotherProduct
Run with --help to get docs on the command-line syntax:
$ bin/zopectl test --help
That pattern breaks on the Zope trunk, where you have to pass the module pattern as an option rather than an argument:
$ bin/zopectl test -m MyProduct
You can still pass a module pattern and a test pattern as positional arguments. This is for backward compatibility. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Fulton wrote:
On Fri, 2005-11-18 at 08:43 -0500, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Chris Withers wrote:
Paul Winkler wrote:
On Thu, Nov 17, 2005 at 02:33:10PM -0200, Sidnei da Silva wrote:
I might have asked this before, but can't seem to find it.
I'm looking for a way to run all tests in $INSTANCE_HOME using the test.py script, but can't seem to get the majik combination of parameters together. Would anyone hint me?
"./bin/zopectl test" is supposed to do the job. But in practice, so many third-party product tests either have broken dependencies or pollute the test environment somehow that something always breaks.
bin/zopectl test Products/MyProduct
...has worked fine for me for many months now...
Hmm, that should be a dotted name, rather than a path:
$ bin/zopectl test Products.MyProduct
Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.:
$ bin/zopectl test OneProduct|AnotherProduct
Run with --help to get docs on the command-line syntax:
$ bin/zopectl test --help
That pattern breaks on the Zope trunk, where you have to pass the module pattern as an option rather than an argument:
$ bin/zopectl test -m MyProduct
You can still pass a module pattern and a test pattern as positional arguments. This is for backward compatibility.
It's broken, then: $ ../bin/python2.4 test.py -v -m PythonScripts Running tests at level 1 Running unit tests: Running: ............................. Ran 29 tests with 0 failures and 0 errors in 0.426 seconds. versus: $ ../bin/python2.4 test.py -v PythonScripts Running tests at level 1 Running unit tests: Running: .................................................. .................................................. (snip) ......................... Ran 4175 tests with 0 failures and 0 errors in 147.654 seconds. While we're at it, what is the rationale for the "50 column indented" output (in "dots" mode) for the new testrunner, versus the "80 column flush" output which is standard in Python / Java CLI test runners? Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDg18u+gerLs4ltQ4RAhrGAJ0QZ+oIRnUaO7TPUF8JYuLfQc4jHQCgk2lY KaZMTRVAEPQamq5rHwrImLE= =ygIU -----END PGP SIGNATURE-----
Tres Seaver wrote:
bin/zopectl test Products/MyProduct
...has worked fine for me for many months now...
Hmm, that should be a dotted name, rather than a path:
$ bin/zopectl test Products.MyProduct
Because the first argument is interpreted as a regex, using search, you can leave the 'Product.' bit off, as well as supplying more complicated specifications, e.g.:
$ bin/zopectl test OneProduct|AnotherProduct
Hmmm, well, I fiddles a fair amount, and Products/MyProduct works for me, and I seem to remember other stuff not workings... oh well, running out of goats and chickens ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (5)
-
Chris Withers -
Jim Fulton -
Paul Winkler -
Sidnei da Silva -
Tres Seaver