<?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>Toru Maesaka &#187; tests</title>
	<atom:link href="http://torum.net/tag/tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://torum.net</link>
	<description>Hackaholic and a Web Addict based in Tokyo</description>
	<lastBuildDate>Fri, 27 Aug 2010 15:13:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Storage Engine Tests in Drizzle. Organized!</title>
		<link>http://torum.net/2009/12/storage-engine-tests-in-drizzle-organized/</link>
		<comments>http://torum.net/2009/12/storage-engine-tests-in-drizzle-organized/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 15:33:45 +0000</pubDate>
		<dc:creator>Toru Maesaka</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://torum.net/?p=2316</guid>
		<description><![CDATA[Good news to storage engine developers. In Drizzle, you can now place your engine specific test files (.test and .result) in your engine&#8217;s directory. Here&#8217;s an example in BlitzDB: First, let&#8217;s look inside BlitzDB&#8217;s directory. $ ls -l blitzdb/ Total 60 -rw-r--r-- 1 maesaka maesaka 649 2009-12-13 20:51 AUTHORS -rw-r--r-- 1 maesaka maesaka 5878 2009-12-13 [...]]]></description>
			<content:encoded><![CDATA[<p>Good news to storage engine developers. In Drizzle, you can now place your engine specific test files (.test and .result) in your engine&#8217;s directory. Here&#8217;s an example in BlitzDB:</p>
<p>First, let&#8217;s look inside BlitzDB&#8217;s directory.</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ ls -l blitzdb/
Total 60
-rw-r--r-- 1 maesaka maesaka   649 2009-12-13 20:51 AUTHORS
-rw-r--r-- 1 maesaka maesaka  5878 2009-12-13 20:51 blitzdata.cc
-rw-r--r-- 1 maesaka maesaka  3347 2009-12-13 20:51 blitzlock.cc
-rw-r--r-- 1 maesaka maesaka 18146 2009-12-13 20:51 ha_blitz.cc
-rw-r--r-- 1 maesaka maesaka  8360 2009-12-13 20:51 ha_blitz.h
-rw-r--r-- 1 maesaka maesaka   289 2009-12-13 20:51 plugin.ac
-rw-r--r-- 1 maesaka maesaka   261 2009-12-13 23:51 plugin.ini
drwxr-xr-x 4 maesaka maesaka  4096 2009-12-13 23:51 tests</pre></div></div>

<p>Notice the final line? that&#8217;s where the tests are kept. So, let&#8217;s look inside it.</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ ls -l blitzdb/tests/
Total 8
drwxr-xr-x 2 maesaka maesaka 4096 2009-12-13 23:51 r
drwxr-xr-x 2 maesaka maesaka 4096 2009-12-13 23:51 t</pre></div></div>

<p>As you can see, there are two directories. By now, storage engine developers would have caught on to what&#8217;s going on. The r/ directory is where the .result files are kept and t/ is where the .test files are kept. This is exactly the same layout as what we&#8217;re used to working on (&#8220;src/tests/t/&#8221; and &#8220;src/tests/r/&#8221;).</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ ls -l blitzdb/tests/t/
Total 8
-rw-r--r-- 1 maesaka maesaka   21 2009-12-13 23:51 blitzdb-master.opt
-rw-r--r-- 1 maesaka maesaka 1964 2009-12-13 23:51 blitzdb.test</pre></div></div>

<p>The .opt file is used to make sure that the server is started with your storage engine enabled. You simply write the startup option inside the .opt file. Here&#8217;s what mine looks like at the moment (there&#8217;s only a single line in it).</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ less blitzdb/tests/t/blitzdb-master.opt
--plugin_add=blitzdb
blitzdb/tests/t/blitzdb-master.opt (END)</pre></div></div>

<p>Next step is actually running it. You simply specify your engine name with the &#45;&#45;suite option to dtr and you&#8217;re done! Unfortunately the symlink permission for dtr seems broken on my repository so I&#8217;ll directly call test-run.pl in this example.</p>

<div class="wp_syntax"><div class="code"><pre class="null" style="font-family:monospace;">$ ./test-run.pl --suite=blitzdb
Logging: ./test-run.pl --suite=blitzdb
MySQL Version 2009.12.1245
Use of uninitialized value in scalar assignment at ./test-run.pl line 1416.
Using MTR_BUILD_THREAD      = -69.4
Using MASTER_MYPORT         = 9306
Using MASTER_MYPORT1        = 9307
Using SLAVE_MYPORT          = 9308
Using SLAVE_MYPORT1         = 9309
Using SLAVE_MYPORT2         = 9310
Using MC_PORT               = 9316
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
=======================================================
DEFAULT STORAGE ENGINE: innodb
TEST                           RESULT         TIME (ms)
-------------------------------------------------------
&nbsp;
blitzdb.blitzdb                [ pass ]             63
-------------------------------------------------------
Stopping All Servers
All 1 tests were successful.
The servers were restarted 1 times
Spent 0.063 of 2 seconds executing testcases</pre></div></div>

<p>That&#8217;s it! I really like this change since it makes sense for engine-specific tests to belong inside the storage engine&#8217;s directory. It makes conceptual sense and it&#8217;s a good step towards differentiating the database kernel and the storage engine, which <a href="http://inaugust.com/">Monty Taylor</a> is actively hacking on. Hopefully he&#8217;ll blog more about these changes soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://torum.net/2009/12/storage-engine-tests-in-drizzle-organized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
