[opensuse-packaging] Question about a self test
All, I'm packaging a python program that has an included self test. If I manually build, install, test on my workstation, the test runs to completion. If I try it online at OBS, I get a failure. What do I need to have in the specfile for it to run? The specfile code is: === %build export CFLAGS="%{optflags}" python setup.py build cd test python test_pyrit.py === I also tried to call the self test at the end of the install stanza. Same results. The log shows: === + cd test + python test_pyrit.py Traceback (most recent call last): File "test_pyrit.py", line 41, in <module> import cpyrit.config ImportError: No module named cpyrit.config error: Bad exit status from /var/tmp/rpm-tmp.3DeLZI (%build) === Thanks Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, Most of the stuff for unity also has those pesky tests that require a real runtime environment to build. I would disable it for packaging, that's what I did for Unity. NM On Wed, Apr 20, 2011 at 7:03 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
All,
I'm packaging a python program that has an included self test.
If I manually build, install, test on my workstation, the test runs to completion.
If I try it online at OBS, I get a failure. What do I need to have in the specfile for it to run?
The specfile code is: === %build export CFLAGS="%{optflags}" python setup.py build cd test python test_pyrit.py ===
I also tried to call the self test at the end of the install stanza. Same results.
The log shows: === + cd test + python test_pyrit.py Traceback (most recent call last): File "test_pyrit.py", line 41, in <module> import cpyrit.config ImportError: No module named cpyrit.config error: Bad exit status from /var/tmp/rpm-tmp.3DeLZI (%build) ===
Thanks Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
-- Nelson Marques /* As cicatrizes lembram-nos de onde estivemos, mas não ditam para onde vamos */ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
That's what I've done, but if someone has a fix, I'll try it out. On Wed, Apr 20, 2011 at 3:06 PM, Nelson Marques <nmo.marques@gmail.com> wrote:
Hi,
Most of the stuff for unity also has those pesky tests that require a real runtime environment to build. I would disable it for packaging, that's what I did for Unity.
NM
On Wed, Apr 20, 2011 at 7:03 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
All,
I'm packaging a python program that has an included self test.
If I manually build, install, test on my workstation, the test runs to completion.
If I try it online at OBS, I get a failure. What do I need to have in the specfile for it to run?
The specfile code is: === %build export CFLAGS="%{optflags}" python setup.py build cd test python test_pyrit.py ===
I also tried to call the self test at the end of the install stanza. Same results.
The log shows: === + cd test + python test_pyrit.py Traceback (most recent call last): File "test_pyrit.py", line 41, in <module> import cpyrit.config ImportError: No module named cpyrit.config error: Bad exit status from /var/tmp/rpm-tmp.3DeLZI (%build) ===
Thanks Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
-- Nelson Marques
/* As cicatrizes lembram-nos de onde estivemos, mas não ditam para onde vamos */
-- Greg Freemyer Head of EDD Tape Extraction and Processing team Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer CNN/TruTV Aired Forensic Imaging Demo - http://insession.blogs.cnn.com/2010/03/23/how-computer-evidence-gets-retriev... The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi Greg, Nelson,
On Wed, Apr 20, 2011 at 7:03 PM, Greg Freemyer wrote:
I'm packaging a python program that has an included self test.
If I manually build, install, test on my workstation, the test runs to completion.
If I try it online at OBS, I get a failure. What do I need to have in the specfile for it to run?
The specfile code is: === %build export CFLAGS="%{optflags}" python setup.py build cd test python test_pyrit.py ===
I also tried to call the self test at the end of the install stanza. Same results.
The log shows: === + cd test + python test_pyrit.py Traceback (most recent call last): File "test_pyrit.py", line 41, in <module> import cpyrit.config ImportError: No module named cpyrit.config error: Bad exit status from /var/tmp/rpm-tmp.3DeLZI (%build)
When running a test suite as part the the build, you need to add all the run-time package dependencies as build-time package dependencies as well. I.e. BuildRequires should include all of Requires (or at least every item which is covered by the test suite.) I don't know a thing about python, so I can't help in your specific case. But you could build without the test suite, install the package, check from which package cpyrit.config is drawn, add it to your BuildRequires, enable the test suite and try again. And repeat until the build succeeds with the test suite enabled.
On Wed, Apr 20, 2011 at 3:06 PM, Nelson Marques wrote:
Most of the stuff for unity also has those pesky tests that require a real runtime environment to build. I would disable it for packaging, that's what I did for Unity.
I wouldn't recommend disabling the test suites. These are a very nice opportunity to spot bugs before they hit the users. Quilt has a test suite, and I do run it at the end of the build to make sure everything will work fine later. -- Jean Delvare Suse L3 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
Greg Freemyer
-
Jean Delvare
-
Nelson Marques