<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam Christian &#187; test</title>
	<atom:link href="http://adamchristian.com/archives/tag/test/feed" rel="self" type="application/rss+xml" />
	<link>http://adamchristian.com</link>
	<description>Writing about Life, Business and Technology - the way I see it.</description>
	<lastBuildDate>Wed, 09 Jun 2010 08:22:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zero to Continuous Integration with Windmill</title>
		<link>http://adamchristian.com/archives/43</link>
		<comments>http://adamchristian.com/archives/43#comments</comments>
		<pubDate>Fri, 19 Sep 2008 06:29:58 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Slide]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windmill]]></category>
		<category><![CDATA[Windmill-dev]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Continuous]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://adamchristian.com/?p=43</guid>
		<description><![CDATA[Following &#8216;automation&#8217; and &#8216;continuous integration&#8217; in the micro blogging world I have seen a major influx in people being super interested in functionally automating their web apps. I have seen a slew of things about Grid, and Selenium, and people hacking on Watir so I decided to show you from the ground up how incredibly [...]]]></description>
			<content:encoded><![CDATA[<p>Following &#8216;automation&#8217; and &#8216;continuous integration&#8217; in the micro blogging world I have seen a major influx in people being super interested in functionally automating their web apps. I have seen a slew of things about Grid, and Selenium, and people hacking on Watir so I decided to show you from the ground up how incredibly easy it is to get automated test running setup using <a href="http://www.getwindmill.com">Windmill</a> and <a href="http://hudson.gotdns.com/wiki/display/HUDSON/Meet+Hudson#Installation">Hudson</a>. I am not going to walk you through every detail, this is much more high level but I do plan to start a &#8216;continuous integration&#8217; page on getwindmill.com in the near future for those kinds of details.</p>
<p>The first step is to get a couple machines that you want use as slaves and a machine to run Hudson, our setup looks like this:</p>
<p><a href="http://adamchristian.com/wp-content/uploads/2008/09/arch.png"><img class="alignnone size-medium wp-image-44" title="Windmill/Hudson Arch" src="http://adamchristian.com/wp-content/uploads/2008/09/arch.png" alt="" width="291" height="191" /></a></p>
<p>Each of the machines with a different OS has <a href="http://www.getwindmill.com">Windmill</a> installed. To make them slaves you simply bring up the Hudson web page on the machine, and run the launcher.. now it&#8217;s a slave &#8212; crazy easy right?</p>
<p>Now to setup test runs for the machines, in Hudson you click: &#8220;New Job&#8221; on the left hand side and do something like the following:</p>
<p><strong>Tie this job to the slave you want it to run on (we can&#8217;t have IE runs happening on MacOSX):<br />
</strong><span style="color: #0000ee;"><span style="color: #000000;"><img class="alignnone size-full wp-image-55" title="tie_node" src="http://adamchristian.com/wp-content/uploads/2008/09/tie_node.png" alt="" width="500" height="55" /></span></span></p>
<p><strong>Tell this job to run 10 and 30 minutes after the hour:<br />
</strong><a href="http://adamchristian.com/wp-content/uploads/2008/09/build_periodic2.png"><img class="alignnone size-full wp-image-50" title="build_periodic2" src="http://adamchristian.com/wp-content/uploads/2008/09/build_periodic2.png" alt="" width="500" height="69" /></a></p>
<p><strong>The build steps to actually run the tests, the first kills any straggling processes (more details below):<br />
</strong><a href="http://adamchristian.com/wp-content/uploads/2008/09/build_steps1.png"><img class="alignnone size-full wp-image-51" title="build_steps" src="http://adamchristian.com/wp-content/uploads/2008/09/build_steps1.png" alt="" width="353" height="328" /></a></p>
<p>On the Mac for the Safari job, I want to make sure there aren&#8217;t any instances of Safari left hanging, or windmill processes sitting around so we do:<br />
<code>ps -ax | grep windmill | awk '{ print $1 }' | xargs kill  | true<br />
ps -ax | grep Safari | awk '{ print $1 }' | xargs kill | true<br />
</code></p>
<p>Then we want to grab the latest test code from svn and launch the windmill test:<br />
<code>svn up /Users/adam/Documents/main_bt/windmill/<br />
python /usr/local/bin/windmill safari http://www.facebook.com test=/Users/adam/Documents/main_bt/windmill/fb email=username@slide.com password=pass report=true exit<br />
rm /Users/adam/Library/Cookies/Cookies.plist<br />
</code></p>
<p>I am telling windmill to run a test against facebook.com, with the test hierarchy in the windmill/fb directory in Safari, with the provided email and password, then to report it&#8217;s results and exit.</p>
<p>The only thing different on our windows test runs is the way we kill the processes:<br />
Example:<br />
<code>taskkill /F /T /IM windmill.exe<br />
taskkill /F /T /IM firefox.exe<br />
</code></p>
<p>You might be asking how do I use those variables, check it out in my setup module:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> setup_module<span style="color: black;">&#40;</span>module<span style="color: black;">&#41;</span>:
    client = WindmillTestClient<span style="color: black;">&#40;</span>__name__<span style="color: black;">&#41;</span>
    client.<span style="color: #008000;">type</span><span style="color: black;">&#40;</span>text=functest.<span style="color: black;">registry</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'email'</span><span style="color: black;">&#93;</span>, <span style="color: #008000;">id</span>=u<span style="color: #483d8b;">'email'</span><span style="color: black;">&#41;</span>
    client.<span style="color: #008000;">type</span><span style="color: black;">&#40;</span>text=functest.<span style="color: black;">registry</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span>, <span style="color: #008000;">id</span>=u<span style="color: #483d8b;">'pass'</span><span style="color: black;">&#41;</span>
    client.<span style="color: black;">click</span><span style="color: black;">&#40;</span><span style="color: #008000;">id</span>=u<span style="color: #483d8b;">'doquicklogin'</span><span style="color: black;">&#41;</span>
    client.<span style="color: black;">waits</span>.<span style="color: black;">forPageLoad</span><span style="color: black;">&#40;</span>timeout=u<span style="color: #483d8b;">'100000'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>You can also read a great entry about adding reporting to your tests on Mikeal Rogers blog, <a href="http://www.mikealrogers.com/archives/46">here.</a></p>
<p>And that last line removing Cookies.plist makes sure that the next test run starts without any cookies set to cause problems.</p>
<p><strong>Have Hudson keep you updated on Jabber:</strong></p>
<p><a href="http://adamchristian.com/wp-content/uploads/2008/09/jabber1.png"><img class="alignnone size-full wp-image-52" title="jabber1" src="http://adamchristian.com/wp-content/uploads/2008/09/jabber1.png" alt="" width="500" height="97" /></a></p>
<p><strong>Grab the generated XML output so you can view the test results in Hudson:</strong></p>
<p><img class="alignnone size-full wp-image-54" title="publish_junit" src="http://adamchristian.com/wp-content/uploads/2008/09/publish_junit.png" alt="" width="500" height="58" /></p>
<p><strong>Do this for each of the test runs you would like to have, and boom &#8212; continuous integration:</strong></p>
<p><a href="http://adamchristian.com/wp-content/uploads/2008/09/jobs_dash1.png"><img class="alignnone size-medium wp-image-53" title="jobs_dash" src="http://adamchristian.com/wp-content/uploads/2008/09/jobs_dash1-300x148.png" alt="" width="300" height="148" /></a></p>
<p>This is obviously a simple scenario, and you can do way, way more customization.. but this should get you off the ground. Happy testing!</p>
<p><span style="text-decoration: underline;"><br />
</span><br />
 </p>
]]></content:encoded>
			<wfw:commentRss>http://adamchristian.com/archives/43/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
