<div>I thought tox is for python source projects.  If so I don&#39;t see how it could help Chris with his current &quot;python as glue&quot; project.</div><div><br></div><div>As far as using python and jenkins as a test framework, I highly recommend it.  I&#39;m using nose with it&#39;s xunit plugin for output that is consumed by jenkins.   But if I was starting a new project today I would have a tough time picking between pytest and nose.  I might even try Robot if I had the time.</div>

<br clear="all">-John Minne<br><br><br><div class="gmail_quote">On Thu, May 10, 2012 at 2:00 PM,  <span dir="ltr">&lt;<a href="mailto:testing-in-python-request@lists.idyll.org" target="_blank">testing-in-python-request@lists.idyll.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send testing-in-python mailing list submissions to<br>
        <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:testing-in-python-request@lists.idyll.org">testing-in-python-request@lists.idyll.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:testing-in-python-owner@lists.idyll.org">testing-in-python-owner@lists.idyll.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of testing-in-python digest...&quot;<br>
<br>Today&#39;s Topics:<br>
<br>
   1. writing a functional test framework using py.test or<br>
      proboscis (Pella,Chris)<br>
   2. Re: writing a functional test framework using py.test or<br>
      proboscis (holger krekel)<br>
   3. Re: writing a functional test framework using py.test or<br>
      proboscis (Pella,Chris)<br>
   4. Re: writing a functional test framework using py.test or<br>
      proboscis (holger krekel)<br>
<br><br>---------- Forwarded message ----------<br>From: &quot;Pella,Chris&quot; &lt;<a href="mailto:Chris.Pella@safenet-inc.com">Chris.Pella@safenet-inc.com</a>&gt;<br>To: &quot;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&quot; &lt;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&gt;<br>

Cc: <br>Date: Thu, 10 May 2012 06:25:22 -0400<br>Subject: [TIP] writing a functional test framework using py.test or proboscis<br>Hi all,<br>
<br>
We are tasked with writing a test framework which integrates tools written in other languages, and are using python as the glue.  Much of this can be done by wrapping the external tools in either pexpect,  or subprocess. Right now there isn&#39;t time to write python bindings for our c or java libraries but that is the preferred way to go in the long run since management wants things happening yesterday (we have virtually no automated testing now).  We are testing systems with a combination of embedded hardware which could be on a local bus or network-attached, with clients that communicate with them either through a library api or various management interfaces, which could be cli-based or have a rest api.<br>


<br>
My issue is that this isn&#39;t the normal scenario for using unittest-type frameworks, since there are many so external dependancies.  I liked the way I could organize the test dependencies in proboscis and got something very clean-looking up in minutes. e.g. the first test loads a new firmware build if available and subsequent tests would either run or not run based on that pre-requisite. However, I couldn&#39;t get any nose plugins to work ( it is built on top of nose) and would like at least have  xunit output  to send to Jenkins at some point, or at least transform into html for reporting.  I would really like to use this tool but I get the feeling I&#39;m going to have to do some poking around to make it generate the output I need and I&#39;m not sure I can succeed since I&#39;m not sure I have the skill-level at this point.<br>


<br>
We are also trying py.test, but I&#39;m having trouble figuring out how to deal with external dependancies in a clean way.  The person who is doing this work is using some global variables to set a condition and then skipping tests based on that, and I&#39;m really not happy with that. I&#39;m wondering if there is somebody who has dealt with more complex scenarios using py.test or some other framework and can offer an example of how they dealt with it.<br>


<br>
Also, does anybody have any experience using Jenkins to drive distributed functional tests in python? Our builds engineers are reluctant to move to Jenkins because they have this Stygian stable of make files, perl scripts, batch files etc... driven by a php front-end to run builds. I have an idea that by adopting Jenkins to drive test automation it may help convince them to adopt it and we could have some integration between builds and tests , which we don&#39;t have now. I doubt we could have Continuous Integration running easily because of the complexity of builds but it would be a step in the right direction.<br>


<br>
Chris<br>
<br>
<br>
The information contained in this electronic mail transmission<br>
may be privileged and confidential, and therefore, protected<br>
from disclosure. If you have received this communication in<br>
error, please notify us immediately by replying to this<br>
message and deleting it from your computer without copying<br>
or disclosing it.<br>
<br>
<br>
<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: holger krekel &lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt;<br>To: &quot;Pella,Chris&quot; &lt;<a href="mailto:Chris.Pella@safenet-inc.com">Chris.Pella@safenet-inc.com</a>&gt;<br>

Cc: &quot;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&quot; &lt;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&gt;<br>Date: Thu, 10 May 2012 15:17:02 +0000<br>

Subject: Re: [TIP] writing a functional test framework using py.test or proboscis<br>Hi Chris,<br>
<br>
On Thu, May 10, 2012 at 06:25 -0400, Pella,Chris wrote:<br>
&gt; We are tasked with writing a test framework which integrates tools written in other languages, and are using python as the glue.  Much of this can be done by wrapping the external tools in either pexpect,  or subprocess. Right now there isn&#39;t time to write python bindings for our c or java libraries but that is the preferred way to go in the long run since management wants things happening yesterday (we have virtually no automated testing now).  We are testing systems with a combination of embedded hardware which could be on a local bus or network-attached, with clients that communicate with them either through a library api or various management interfaces, which could be cli-based or have a rest api.<br>


&gt;<br>
&gt; My issue is that this isn&#39;t the normal scenario for using unittest-type frameworks, since there are many so external dependancies.  I liked the way I could organize the test dependencies in proboscis and got something very clean-looking up in minutes. e.g. the first test loads a new firmware build if available and subsequent tests would either run or not run based on that pre-requisite. However, I couldn&#39;t get any nose plugins to work ( it is built on top of nose) and would like at least have  xunit output  to send to Jenkins at some point, or at least transform into html for reporting.  I would really like to use this tool but I get the feeling I&#39;m going to have to do some poking around to make it generate the output I need and I&#39;m not sure I can succeed since I&#39;m not sure I have the skill-level at this point.<br>


<br>
I don&#39;t use nose much myself but i am sure this can be solved by someone<br>
who does.<br>
<br>
&gt; We are also trying py.test, but I&#39;m having trouble figuring out how to deal with external dependancies in a clean way.  The person who is doing this work is using some global variables to set a condition and then skipping tests based on that, and I&#39;m really not happy with that. I&#39;m wondering if there is somebody who has dealt with more complex scenarios using py.test or some other framework and can offer an example of how they dealt with it.<br>


<br>
You may want to look into using &quot;tox&quot;, see <a href="http://tox.testrun.org" target="_blank">http://tox.testrun.org</a> which<br>
automates the creation of virtual environments, installation of<br>
dependencies and running the actual test command.  There also are some<br>
specific docs on how to set it up with Jenkins, see<br>
<a href="http://tox.testrun.org/latest/example/jenkins.html" target="_blank">http://tox.testrun.org/latest/example/jenkins.html</a><br>
irrespective if you are using nose or pytest.<br>
<br>
With respect to creating whole-testrun fixtures which require controling<br>
and management of other processes/firmware/hardware you might want to<br>
look into pytest&#39;s resource management (funcargs) which can be used<br>
to effectively manage external state, see for example:<br>
<a href="http://pytest.org/latest/example/mysetup.html" target="_blank">http://pytest.org/latest/example/mysetup.html</a><br>
If you use tox you may avoid having to skip/check existence of<br>
dependencies.<br>
<br>
hope this helps,<br>
holger (who maintains both tox and pytest)<br>
<br>
&gt; Also, does anybody have any experience using Jenkins to drive distributed functional tests in python? Our builds engineers are reluctant to move to Jenkins because they have this Stygian stable of make files, perl scripts, batch files etc... driven by a php front-end to run builds. I have an idea that by adopting Jenkins to drive test automation it may help convince them to adopt it and we could have some integration between builds and tests , which we don&#39;t have now. I doubt we could have Continuous Integration running easily because of the complexity of builds but it would be a step in the right direction.<br>


&gt;<br>
&gt; Chris<br>
&gt;<br>
&gt;<br>
&gt; The information contained in this electronic mail transmission<br>
&gt; may be privileged and confidential, and therefore, protected<br>
&gt; from disclosure. If you have received this communication in<br>
&gt; error, please notify us immediately by replying to this<br>
&gt; message and deleting it from your computer without copying<br>
&gt; or disclosing it.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; testing-in-python mailing list<br>
&gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt;<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: &quot;Pella,Chris&quot; &lt;<a href="mailto:Chris.Pella@safenet-inc.com">Chris.Pella@safenet-inc.com</a>&gt;<br>To: holger krekel &lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt;<br>

Cc: &quot;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&quot; &lt;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&gt;<br>Date: Thu, 10 May 2012 12:00:50 -0400<br>

Subject: Re: [TIP] writing a functional test framework using py.test or proboscis<br>Thanks Holger,<br>
I&#39;ll check out if Tox will map to some of our use cases after some re-factoring. It looks promising.<br>
The funcargs mechanism will take some time for me to get my head around since I&#39;ve only done relatively unsophisticated python programming until now.<br>
<br>
<br>
Chris<br>
<br>
-----Original Message-----<br>
From: holger krekel [mailto:<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>]<br>
Sent: Thursday, May 10, 2012 11:17 AM<br>
To: Pella,Chris<br>
Cc: <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
Subject: Re: [TIP] writing a functional test framework using py.test or proboscis<br>
<br>
Hi Chris,<br>
<br>
On Thu, May 10, 2012 at 06:25 -0400, Pella,Chris wrote:<br>
&gt; We are tasked with writing a test framework which integrates tools written in other languages, and are using python as the glue.  Much of this can be done by wrapping the external tools in either pexpect,  or subprocess. Right now there isn&#39;t time to write python bindings for our c or java libraries but that is the preferred way to go in the long run since management wants things happening yesterday (we have virtually no automated testing now).  We are testing systems with a combination of embedded hardware which could be on a local bus or network-attached, with clients that communicate with them either through a library api or various management interfaces, which could be cli-based or have a rest api.<br>


&gt;<br>
&gt; My issue is that this isn&#39;t the normal scenario for using unittest-type frameworks, since there are many so external dependancies.  I liked the way I could organize the test dependencies in proboscis and got something very clean-looking up in minutes. e.g. the first test loads a new firmware build if available and subsequent tests would either run or not run based on that pre-requisite. However, I couldn&#39;t get any nose plugins to work ( it is built on top of nose) and would like at least have  xunit output  to send to Jenkins at some point, or at least transform into html for reporting.  I would really like to use this tool but I get the feeling I&#39;m going to have to do some poking around to make it generate the output I need and I&#39;m not sure I can succeed since I&#39;m not sure I have the skill-level at this point.<br>


<br>
I don&#39;t use nose much myself but i am sure this can be solved by someone<br>
who does.<br>
<br>
&gt; We are also trying py.test, but I&#39;m having trouble figuring out how to deal with external dependancies in a clean way.  The person who is doing this work is using some global variables to set a condition and then skipping tests based on that, and I&#39;m really not happy with that. I&#39;m wondering if there is somebody who has dealt with more complex scenarios using py.test or some other framework and can offer an example of how they dealt with it.<br>


<br>
You may want to look into using &quot;tox&quot;, see <a href="http://tox.testrun.org" target="_blank">http://tox.testrun.org</a> which<br>
automates the creation of virtual environments, installation of<br>
dependencies and running the actual test command.  There also are some<br>
specific docs on how to set it up with Jenkins, see<br>
<a href="http://tox.testrun.org/latest/example/jenkins.html" target="_blank">http://tox.testrun.org/latest/example/jenkins.html</a><br>
irrespective if you are using nose or pytest.<br>
<br>
With respect to creating whole-testrun fixtures which require controling<br>
and management of other processes/firmware/hardware you might want to<br>
look into pytest&#39;s resource management (funcargs) which can be used<br>
to effectively manage external state, see for example:<br>
<a href="http://pytest.org/latest/example/mysetup.html" target="_blank">http://pytest.org/latest/example/mysetup.html</a><br>
If you use tox you may avoid having to skip/check existence of<br>
dependencies.<br>
<br>
hope this helps,<br>
holger (who maintains both tox and pytest)<br>
<br>
&gt; Also, does anybody have any experience using Jenkins to drive distributed functional tests in python? Our builds engineers are reluctant to move to Jenkins because they have this Stygian stable of make files, perl scripts, batch files etc... driven by a php front-end to run builds. I have an idea that by adopting Jenkins to drive test automation it may help convince them to adopt it and we could have some integration between builds and tests , which we don&#39;t have now. I doubt we could have Continuous Integration running easily because of the complexity of builds but it would be a step in the right direction.<br>


&gt;<br>
&gt; Chris<br>
&gt;<br>
&gt;<br>
&gt; The information contained in this electronic mail transmission<br>
&gt; may be privileged and confidential, and therefore, protected<br>
&gt; from disclosure. If you have received this communication in<br>
&gt; error, please notify us immediately by replying to this<br>
&gt; message and deleting it from your computer without copying<br>
&gt; or disclosing it.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; testing-in-python mailing list<br>
&gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt;<br>
The information contained in this electronic mail transmission<br>
may be privileged and confidential, and therefore, protected<br>
from disclosure. If you have received this communication in<br>
error, please notify us immediately by replying to this<br>
message and deleting it from your computer without copying<br>
or disclosing it.<br>
<br>
<br>
<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: holger krekel &lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt;<br>To: &quot;Pella,Chris&quot; &lt;<a href="mailto:Chris.Pella@safenet-inc.com">Chris.Pella@safenet-inc.com</a>&gt;<br>

Cc: &quot;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&quot; &lt;<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>&gt;<br>Date: Thu, 10 May 2012 16:10:15 +0000<br>

Subject: Re: [TIP] writing a functional test framework using py.test or proboscis<br>On Thu, May 10, 2012 at 12:00 -0400, Pella,Chris wrote:<br>
&gt; Thanks Holger,<br>
&gt; I&#39;ll check out if Tox will map to some of our use cases after some re-factoring. It looks promising.<br>
&gt; The funcargs mechanism will take some time for me to get my head around since I&#39;ve only done relatively unsophisticated python programming until now.<br>
<br>
Hum, I&#39;d like to revisit the funcargs documentation to improve and extend it.<br>
Happy to hear any feedback from your perspective and to answer questions<br>
or give examples related to particular use cases.<br>
<br>
best,<br>
holger<br>
<br>
<br>
&gt;<br>
&gt; Chris<br>
&gt;<br>
&gt; -----Original Message-----<br>
&gt; From: holger krekel [mailto:<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>]<br>
&gt; Sent: Thursday, May 10, 2012 11:17 AM<br>
&gt; To: Pella,Chris<br>
&gt; Cc: <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; Subject: Re: [TIP] writing a functional test framework using py.test or proboscis<br>
&gt;<br>
&gt; Hi Chris,<br>
&gt;<br>
&gt; On Thu, May 10, 2012 at 06:25 -0400, Pella,Chris wrote:<br>
&gt; &gt; We are tasked with writing a test framework which integrates tools written in other languages, and are using python as the glue.  Much of this can be done by wrapping the external tools in either pexpect,  or subprocess. Right now there isn&#39;t time to write python bindings for our c or java libraries but that is the preferred way to go in the long run since management wants things happening yesterday (we have virtually no automated testing now).  We are testing systems with a combination of embedded hardware which could be on a local bus or network-attached, with clients that communicate with them either through a library api or various management interfaces, which could be cli-based or have a rest api.<br>


&gt; &gt;<br>
&gt; &gt; My issue is that this isn&#39;t the normal scenario for using unittest-type frameworks, since there are many so external dependancies.  I liked the way I could organize the test dependencies in proboscis and got something very clean-looking up in minutes. e.g. the first test loads a new firmware build if available and subsequent tests would either run or not run based on that pre-requisite. However, I couldn&#39;t get any nose plugins to work ( it is built on top of nose) and would like at least have  xunit output  to send to Jenkins at some point, or at least transform into html for reporting.  I would really like to use this tool but I get the feeling I&#39;m going to have to do some poking around to make it generate the output I need and I&#39;m not sure I can succeed since I&#39;m not sure I have the skill-level at this point.<br>


&gt;<br>
&gt; I don&#39;t use nose much myself but i am sure this can be solved by someone<br>
&gt; who does.<br>
&gt;<br>
&gt; &gt; We are also trying py.test, but I&#39;m having trouble figuring out how to deal with external dependancies in a clean way.  The person who is doing this work is using some global variables to set a condition and then skipping tests based on that, and I&#39;m really not happy with that. I&#39;m wondering if there is somebody who has dealt with more complex scenarios using py.test or some other framework and can offer an example of how they dealt with it.<br>


&gt;<br>
&gt; You may want to look into using &quot;tox&quot;, see <a href="http://tox.testrun.org" target="_blank">http://tox.testrun.org</a> which<br>
&gt; automates the creation of virtual environments, installation of<br>
&gt; dependencies and running the actual test command.  There also are some<br>
&gt; specific docs on how to set it up with Jenkins, see<br>
&gt; <a href="http://tox.testrun.org/latest/example/jenkins.html" target="_blank">http://tox.testrun.org/latest/example/jenkins.html</a><br>
&gt; irrespective if you are using nose or pytest.<br>
&gt;<br>
&gt; With respect to creating whole-testrun fixtures which require controling<br>
&gt; and management of other processes/firmware/hardware you might want to<br>
&gt; look into pytest&#39;s resource management (funcargs) which can be used<br>
&gt; to effectively manage external state, see for example:<br>
&gt; <a href="http://pytest.org/latest/example/mysetup.html" target="_blank">http://pytest.org/latest/example/mysetup.html</a><br>
&gt; If you use tox you may avoid having to skip/check existence of<br>
&gt; dependencies.<br>
&gt;<br>
&gt; hope this helps,<br>
&gt; holger (who maintains both tox and pytest)<br>
&gt;<br>
&gt; &gt; Also, does anybody have any experience using Jenkins to drive distributed functional tests in python? Our builds engineers are reluctant to move to Jenkins because they have this Stygian stable of make files, perl scripts, batch files etc... driven by a php front-end to run builds. I have an idea that by adopting Jenkins to drive test automation it may help convince them to adopt it and we could have some integration between builds and tests , which we don&#39;t have now. I doubt we could have Continuous Integration running easily because of the complexity of builds but it would be a step in the right direction.<br>


&gt; &gt;<br>
&gt; &gt; Chris<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; The information contained in this electronic mail transmission<br>
&gt; &gt; may be privileged and confidential, and therefore, protected<br>
&gt; &gt; from disclosure. If you have received this communication in<br>
&gt; &gt; error, please notify us immediately by replying to this<br>
&gt; &gt; message and deleting it from your computer without copying<br>
&gt; &gt; or disclosing it.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; testing-in-python mailing list<br>
&gt; &gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; &gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt; &gt;<br>
&gt; The information contained in this electronic mail transmission<br>
&gt; may be privileged and confidential, and therefore, protected<br>
&gt; from disclosure. If you have received this communication in<br>
&gt; error, please notify us immediately by replying to this<br>
&gt; message and deleting it from your computer without copying<br>
&gt; or disclosing it.<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
<br></blockquote></div><br>