07 Nov 2011

feedBSD Planet * BSD People

The Julipedia (Blog): Kyua: Weekly status report

Many things have happened this week, but they can all be summarized in one single sentence: &lt;tt&gt;&lt;b&gt;kyua test&lt;/b&gt;&lt;/tt&gt;&lt;b&gt; now records the results of the execution of a test suite into the SQLite database&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;"Why is this important?", you ask. Well, that's a good question. Recording test results opens the gate to many long-awaited features that should be coming soon, such as the ability to inspect the history of a particular test, to query all available data of a test result and/or to generate a dashboard of test results. It's interesting to realize that &lt;i&gt;most of these features are just one SQL query away&lt;/i&gt;. If you install Kyua, you can already run a few tests and then use &lt;tt&gt;kyua db-exec&lt;/tt&gt; to issue arbitrary SQL queries against the database; the schema (see &lt;tt&gt;store/schema.sql&lt;/tt&gt;) might look a bit convoluted, but a bunch of &lt;tt&gt;NATURAL JOIN&lt;/tt&gt;s will yield the desired output.&lt;br /&gt;&lt;br /&gt;The feature requests that have the highest priority at this point are the ability to generate a report of the last tests run both as a text file and as an HTML dashboard, because having these features means we can finally kill the &lt;tt&gt;atf-run&lt;/tt&gt; and &lt;tt&gt;atf-report&lt;/tt&gt; pair. At this point I'm, once again, "stuck" while figuring out how to best organize the code to make all these things possible while still keeping a nice separation across the existing layers (&lt;tt&gt;cli&lt;/tt&gt;, &lt;tt&gt;engine&lt;/tt&gt; and &lt;tt&gt;store&lt;/tt&gt;)... all without introducing much unnecessary complexity. But exciting times lie ahead!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-5051367421950896129?l=blog.julipedia.org' alt='' /&gt;&lt;/div&gt;</content>

07 Nov 2011 3:48pm GMT

31 Oct 2011

feedBSD Planet * BSD People

The Julipedia (Blog): Kyua: Weekly status report

&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Submitted a placeholder implementation of the new persistence layer (&lt;tt&gt;store&lt;/tt&gt; top-level directory). This only supports opening a database and ensuring its metadata is valid. &lt;a href="http://code.google.com/p/kyua/source/detail?r=253"&gt;See r253&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Added a &lt;tt&gt;db-exec&lt;/tt&gt; CLI command to execute arbitrary SQL commands onto the database. This is handy during development and testing, but may also help users to extract information out of the database in those cases where the CLI does not cover their needs just yet. &lt;a href="http://code.google.com/p/kyua/source/detail?r=255"&gt;See r255&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Miscellaneous fixes and improvements to &lt;tt&gt;utils::env&lt;/tt&gt; and &lt;tt&gt;utils::sqlite&lt;/tt&gt;.&lt;/li&gt;&lt;li&gt;Preliminary code to support putting objects (like actions and contexts) into the database. I've been thinking about this for a while and finally came up with a design that completely decouples the persistence needs from the higher-level classes in the &lt;tt&gt;engine&lt;/tt&gt; layer. I haven't submitted the code yet though, as it lacks tests. (Still thinking how to write the loading of objects though.)&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-5304169474623962697?l=blog.julipedia.org' alt='' /&gt;&lt;/div&gt;</content>

31 Oct 2011 2:48pm GMT

24 Oct 2011

feedBSD Planet * BSD People

The Julipedia (Blog): Kyua: Weekly status report

&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Moved all the logic code of the "debug", "list" and "test" commands from the CLI layer to the engine layer.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Up until now, the CLI modules implementing these commands contained all the logic to load Kyuafiles and iterating over them to find matching tests and applying the desired operation to them. This kind of code belongs in "driver" modules (aka controllers) of the engine layer, because there is nothing UI-related in them.&lt;/li&gt;&lt;li&gt;After this refactoring, the code left in the CLI modules is purely presentation-related, and the code in the engine implements all the logic.&lt;/li&gt;&lt;li&gt;The goal of these changes is to be able to hide the interactions with the database in these controllers. The CLI layer has no business in dealing with the database connection (other than allowing the user to specify which database to talk to, of course).&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Implemented a very simple RAII model for SQLite transactions.&lt;/li&gt;&lt;li&gt;Some additions to the utils::sqlite bindings to simplify some common calling patterns (e.g. binding statement parameters by name).&lt;/li&gt;&lt;li&gt;Preliminary prototypes at database initialization. This involves creating new databases and populating them with the initial schema, plus dealing with database metadata to, e.g. detect if we are dealing with the correct schema version.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;The code for this is still too crappy to be submitted, so don't look for it in the repository just yet!&lt;/li&gt;&lt;li&gt;The design document details many things that should be part of the schema (e.g. "sessions"0, but I've decided that I'll start easy with a simplified schema and later build on top of it. Otherwise there will be too many clunky moving parts to deal with while the fundamental ideas are not yet completely clear.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Fixes to let the code build and run again in NetBSD (macppc at least).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I've now been stuck for a few days trying to figure out what the best way to implement the conversion of (new) in-memory objects to database objects is, and how to later recover these objects. E.g. what the correct abstractions are to take test case results and put them in the database, and how to retrieve these results to generate reports later on. I now start to have a clear mental picture on how this should look like, but I have yet to see how it will scale.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-402139290656767976?l=blog.julipedia.org' alt='' /&gt;&lt;/div&gt;</content>

24 Oct 2011 2:48am GMT