<?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>Ted's Mozilla Blog &#187; tests</title>
	<atom:link href="http://blog.mozilla.com/ted/category/tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/ted</link>
	<description>If this were a diary it would have a unicorn on the cover, because unicorns are awesome.</description>
	<lastBuildDate>Mon, 05 Oct 2009 20:52:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Crash stacks on unit tests and Talos</title>
		<link>http://blog.mozilla.com/ted/2009/03/12/crash-stacks-on-unit-tests-and-talos/</link>
		<comments>http://blog.mozilla.com/ted/2009/03/12/crash-stacks-on-unit-tests-and-talos/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 00:33:52 +0000</pubDate>
		<dc:creator>tmielczarek</dc:creator>
				<category><![CDATA[tests]]></category>
		<category><![CDATA[tinderbox]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/ted/?p=26</guid>
		<description><![CDATA[For a long time when our unit tests or Talos performance tests encountered a crash, the result was nothing but frustration. If you were lucky, you could tell that it crashed, but you had no idea where. Poor Blake spent weeks tracing down a crash from his speculative-parsing patch that only seemed to occur on [...]]]></description>
			<content:encoded><![CDATA[<p>For a long time when our <a href="https://developer.mozilla.org/en/Mozilla_automated_testing">unit tests</a> or <a href="http://weblogs.mozillazine.org/qa/archives/2007/05/beware_of_talos.html">Talos</a> performance tests encountered a crash, the result was nothing but frustration. If you were lucky, you could tell that it crashed, but you had no idea where. Poor <a title="Does he have a blog? This was the first hit on Google, good enough." href="http://twitter.com/mrbkap">Blake</a> spent weeks tracing down <a title=" Bug 474537 -  Understand the speculative parsing crash" href="https://bugzilla.mozilla.org/show_bug.cgi?id=474537">a crash</a> from his <a title=" Bug 364315 -  Speculatively load referenced files while &quot;real&quot; parsing is blocked on a &lt;script src=&gt; load " href="https://bugzilla.mozilla.org/show_bug.cgi?id=364315">speculative-parsing patch</a> that only seemed to occur on Talos. Up until recently I figured the only way to make this happen was going to involve a fair amount of work that only I was going to be able to do. A few weeks ago it was determined that this was becoming a significant impact on development, as patches would get checked in, cause a crash and be backed out, leaving the developer with nothing to go on.</p>
<p><a href="http://benjamin.smedbergs.us/blog/">Benjamin Smedberg</a> has been hard at work making it possible to get stacks in this situation, using the same <a href="http://code.google.com/p/google-breakpad/">Breakpad</a> utilities we use on our <a href="http://crash-stats.mozilla.com/">Socorro server</a>, but locally on the machine running the tests. Practically all of the pieces were in place this afternoon when #developers cornered <a href="http://alice.nodelman.net/blog/">Alice</a> and closed the tree while she landed the final patch to make Talos produce stack traces. <a href="http://weblogs.mozillazine.org/bz/">Boris</a> then <a href="http://hg.mozilla.org/mozilla-central/rev/4d9bc12c4d3c">committed a test crash</a>, and as a result we were able to see crash stacks in Mochitest (<a title="It's a tinderbox log, so only click if you *really* want to see" href="http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1236887430.1236888099.13857.gz&amp;fulltext=1#err3">OS X</a>, <a title="another huge tinderbox log" href="http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1236887430.1236892748.27212.gz&amp;fulltext=1#err3">Linux</a>) as well as Talos (<a title="ok, this tinderbox log is a bit shorter" href="http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1236887449.1236888958.18830.gz">OS X</a>, <a title="another tinderbox log" href="http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1236887504.1236890166.22554.gz">Linux</a>).</p>
<p>Thanks to Benjamin for doing most of the heavy lifting here, and for<br />
Alice for taking the Talos part across the finish line. The Talos work<br />
was mostly in <a title=" Bug 480577 -  Make Talos dump crash stacks after crashes" href="https://bugzilla.mozilla.org/show_bug.cgi?id=480577">bug 480577</a>, and the unit test work was <a title=" Bug 481732 -  Have unit tests (automation.py ones) dump stacks on crashes" href="https://bugzilla.mozilla.org/show_bug.cgi?id=481732">bug 481732</a>. Note<br />
that currently this only works in Mochitest (all 4 varieties), it will<br />
work in Reftest/Crashtest after <a title=" Bug 479225 -  run reftest/crashtest with &quot;make {reftest,crashtest}&quot; and mochitest with &quot;make mochitest-{plain,chrome,browser-chrome,a11y}&quot;" href="https://bugzilla.mozilla.org/show_bug.cgi?id=479225">bug 479225</a> is fixed (which should be soon).</p>
<p>(Cross posted in <a href="http://groups.google.com/group/mozilla.dev.tree-management/browse_thread/thread/14532c910c0f6a04#">dev.tree-management</a>, but posting here for a wider audience.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/ted/2009/03/12/crash-stacks-on-unit-tests-and-talos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command-line screenshot tool for Windows</title>
		<link>http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/</link>
		<comments>http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 14:16:07 +0000</pubDate>
		<dc:creator>tmielczarek</dc:creator>
				<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/ted/?p=18</guid>
		<description><![CDATA[I was reminded of bug 414049 yesterday, a bug I filed about getting screenshots from our unit test machines after every run so we could see if there was obviously something wrong with the machine (like error dialogs covering the screen). Linux and OS X tend to have built-in tools to grab screenshots (as mentioned [...]]]></description>
			<content:encoded><![CDATA[<p>I was reminded of <a title=" Bug 414049 -  unit test boxes should upload a screen shot after testing" href="https://bugzilla.mozilla.org/show_bug.cgi?id=414049">bug 414049</a> yesterday, a bug I filed about getting screenshots from our unit test machines after every run so we could see if there was obviously something wrong with the machine (like error dialogs covering the screen). Linux and OS X tend to have built-in tools to grab screenshots (as mentioned in the bug), but Windows does not. I searched around for a free tool to do the job, but all I could find was shareware. It&#8217;s possible there&#8217;s a free tool out there that I just couldn&#8217;t find, but I figured I would just write one. After a bit of poking around on MSDN, I wrote <a href="https://bug414049.bugzilla.mozilla.org/attachment.cgi?id=360710">screenshot.cpp</a>. It&#8217;s only about 70 lines of C++, hard to believe people pay money for stuff like that. I&#8217;ve placed it under a BSD license, since it&#8217;s useful code and I couldn&#8217;t find a simple self-contained example like this anywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>more tests, kthx</title>
		<link>http://blog.mozilla.com/ted/2009/01/16/more-tests-kthx/</link>
		<comments>http://blog.mozilla.com/ted/2009/01/16/more-tests-kthx/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 20:44:29 +0000</pubDate>
		<dc:creator>tmielczarek</dc:creator>
				<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/ted/?p=14</guid>
		<description><![CDATA[Josh recently landed a test plugin, with the intent of finally getting some test coverage of our plugin-handling code via mochitests. This is awesome, as plugins are an area of code where we&#8217;ve caused lots of regressions in the past, and until then had zero automated test coverage. After it landed, I took a peek [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://boomswaggerboom.wordpress.com/">Josh</a> recently landed a <a href="http://mxr.mozilla.org/mozilla-central/source/modules/plugin/test/testplugin/">test plugin</a>, with the intent of finally getting some test coverage of our plugin-handling code via mochitests. This is awesome, as plugins are an area of code where we&#8217;ve caused lots of regressions in the past, and until then had zero automated test coverage. After it landed, I took a peek at the code and noticed that it would be pretty easy to extend it to make it usable in our layout tests (reftest) as well. I just landed some patches to add this functionality, so we can now test that our layout of plugins doesn&#8217;t regress. If you&#8217;d like to write some reftests yourself using this, you can check out the <a href="http://mxr.mozilla.org/mozilla-central/source/modules/plugin/test/reftest/">basic tests</a> I added along with the patch. (Note: it&#8217;s mac-only at the moment, but there&#8217;s <a title="Bug 469831 - need gtk2 drawing code for test plugin" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469831">gtk2 code</a> ready to land any minute now, and a <a title=" Bug 469830 -  need Windows drawing code for test plugin" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469830">win32 implementation</a> should be forthcoming.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/ted/2009/01/16/more-tests-kthx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL in Mochitest</title>
		<link>http://blog.mozilla.com/ted/2008/09/22/ssl-in-mochitest/</link>
		<comments>http://blog.mozilla.com/ted/2008/09/22/ssl-in-mochitest/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:47:00 +0000</pubDate>
		<dc:creator>tmielczarek</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/ted/?p=12</guid>
		<description><![CDATA[Without a lot of fanfare, a patch landed recently that enables the use of SSL with the test HTTP server we use in our Mochitest test harness.
About five months ago, I read an article about how Fedora wanted to standardize on NSS as the cryptography solution for their distro in order to be able to [...]]]></description>
			<content:encoded><![CDATA[<p>Without a lot of fanfare, <a title=" Bug 428009 -  hook up ssltunnel to mochitest" href="https://bugzilla.mozilla.org/show_bug.cgi?id=428009">a patch landed</a> recently that enables the use of SSL with the test HTTP server we use in our <a href="http://developer.mozilla.org/en/Mochitest">Mochitest test harness</a>.</p>
<p>About five months ago, I read <a href="http://fedoraproject.org/wiki/FedoraCryptoConsolidation">an article</a> about how Fedora wanted to standardize on NSS as the cryptography solution for their distro in order to be able to leverage a common certificate database, among other things. The article went into detail on how they wrote<a href="http://fedoraproject.org/wiki/Nss_compat_ossl"> an OpenSSL wrapper around NSS</a> so they could easily port applications that only supported OpenSSL to use NSS instead. As a concrete example, they showed a ported version of stunnel using NSS. This gave me pause, as one of the things we were lacking in our Mochitest harness was SSL support and stunnel would do exactly what we needed in this case. Considering we already build and ship NSS with every copy of Firefox, and it was clearly possible to implement the functionality we needed using NSS, I set out to figure out how to implement a bare-bones version of stunnel from scratch. After a bit of poking through the online <a title="NSPR API Reference" href="http://developer.mozilla.org/en/NSPR_API_Reference">NSPR</a> and <a title="NSS reference" href="http://developer.mozilla.org/En/NSS_reference">NSS</a> documentation, <a title="Bug 426867 - ssl proxy for mochitest " href="https://bugzilla.mozilla.org/show_bug.cgi?id=426867">I had a proof of concept application</a> which I called &#8220;ssltunnel.&#8221; After some insightful review comments from NSS developers I committed it to CVS.</p>
<p>Unfortunately, that wasn&#8217;t the end. We still needed to hook this program up to the test harness, and I just didn&#8217;t have the motivation to do so. I filed <a title="Bug 428009 - hook up ssltunnel to mochitest" href="https://bugzilla.mozilla.org/show_bug.cgi?id=428009">the bug</a>, and hoped someone else would do the work. (as I often do!) Thankfully, that someone appeared in the person of Honza Bambas, whom I can only describe as a &#8220;programming rockstar.&#8221; He not only integrated ssltunnel into Mochitest, but he rewrote large sections of it to make it work robustly and made it work as an HTTP proxy while he was at it. After some reviews, and a couple of landings and backouts due to unrelated test failures, and some time spent languishing in bugzilla, we finally made his patch stick.</p>
<p><img title="Screenshot of Firefox showing an SSL connection to example.com, with the security info panel open" src="http://people.mozilla.com/~tmielczarek/mochitest-ssl.png" alt="" /></p>
<p>Of course, now that we have this capability, we need tests to use it! Honza has written <a title="Mochitest - SSL and https enabled tests" href="http://developer.mozilla.org/en/Mochitest#SSL_and_https_enabled_tests">some great documentation</a> on what is currently available via Mochitest, and how to add custom servers and certificates other things you might want. If you get motivated to write some tests and hit a rough spot, feel free as always to track me down on IRC and ask me about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/ted/2008/09/22/ssl-in-mochitest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MochiTest Maker</title>
		<link>http://blog.mozilla.com/ted/2008/04/18/mochitest-maker/</link>
		<comments>http://blog.mozilla.com/ted/2008/04/18/mochitest-maker/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 18:40:58 +0000</pubDate>
		<dc:creator>tmielczarek</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/ted/2008/04/18/mochitest-maker/</guid>
		<description><![CDATA[Just something I threw together this morning: MochiTest Maker. It&#8217;s a pure HTML+JavaScript environment for writing MochiTests. It&#8217;s not as full-featured as the real MochiTest, as you can&#8217;t set HTTP headers or include external files, but it should serve for a lot of simple web content tests.
Ideally at some point I&#8217;d like to add a [...]]]></description>
			<content:encoded><![CDATA[<p>Just something I threw together this morning: <a href="http://ted.mielczarek.org/code/mozilla/mochitest-maker/">MochiTest Maker</a>. It&#8217;s a pure HTML+JavaScript environment for writing <a href="http://developer.mozilla.org/en/docs/Mochitest">MochiTests</a>. It&#8217;s not as full-featured as the real MochiTest, as you can&#8217;t set HTTP headers or include external files, but it should serve for a lot of simple web content tests.</p>
<p>Ideally at some point I&#8217;d like to add a CGI backend to this so you could specify a directory, and have it generate a patch against current CVS to include your test in that directory. That would lower the bar even further for getting new tests into the tree. Another cool addition would be to integrate this with my <a href="http://ted.mielczarek.org/code/mozilla/regression-search.html">regression search buildbot</a> (currently offline), so that you could write a mochitest and then with one click submit it to find out when something regressed. That shouldn&#8217;t be hard to do, but my buildbot needs to find a more permanent home first.</p>
<p>I think there&#8217;s still a lot more we can (and must) do to lower the bar for writing tests. We need all the tests we can get!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/ted/2008/04/18/mochitest-maker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
