<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Grails Testing Alias to Rerun Failed Tests</title>
	<atom:link href="http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/</link>
	<description>Groovy, Grails and OS X tips and tricks</description>
	<lastBuildDate>Sat, 31 Jul 2010 11:43:17 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2077</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Fri, 13 Nov 2009 03:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2077</guid>
		<description>@Bryan, yep, test-app by default uses the test environment, but you can override it using the technique you mentioned (I do this in some apps to connect to a different datasource).</description>
		<content:encoded><![CDATA[<p>@Bryan, yep, test-app by default uses the test environment, but you can override it using the technique you mentioned (I do this in some apps to connect to a different datasource).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Doyle</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2076</link>
		<dc:creator>Brian Doyle</dc:creator>
		<pubDate>Thu, 12 Nov 2009 22:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2076</guid>
		<description>Sorry about my previous comment.  It looks like the test-app command does that for you automatically.</description>
		<content:encoded><![CDATA[<p>Sorry about my previous comment.  It looks like the test-app command does that for you automatically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Doyle</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2075</link>
		<dc:creator>Brian Doyle</dc:creator>
		<pubDate>Thu, 12 Nov 2009 22:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2075</guid>
		<description>I&#039;m new to Groovy and Grails so this is probably a dumb question, but wouldn&#039;t you want to set your env in your grailsTest function to:  -Dgrails.env=test 
Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m new to Groovy and Grails so this is probably a dumb question, but wouldn&#8217;t you want to set your env in your grailsTest function to:  -Dgrails.env=test<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2068</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Wed, 04 Nov 2009 14:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2068</guid>
		<description>Whoops, I didn&#039;t know about that, thanks Mike.  They must have added that fairly recently.  

I just gave it a try and the behavior is a little different.  It will only run failed tests, and it&#039;s not smart about bailing out if there aren&#039;t any failed test, so it still bootstraps the full environment and says everything was successful, even though no tests were actually run.

Some people might like that behavior better, but I like being able to run &quot;gtaf&quot; whether or not I have any tests that failed.

I can see why some might want the alternate behavior, so that it only runs tests if they are failed.  If so, the grailsFailedTests function could be modified to this:

&lt;pre lang=&quot;groovy&quot;&gt;
function grailsFailedTests() {
	grailsTest $1 $2 -rerun
}
&lt;/pre&gt;

Thanks for the pointer Mike!</description>
		<content:encoded><![CDATA[<p>Whoops, I didn&#8217;t know about that, thanks Mike.  They must have added that fairly recently.  </p>
<p>I just gave it a try and the behavior is a little different.  It will only run failed tests, and it&#8217;s not smart about bailing out if there aren&#8217;t any failed test, so it still bootstraps the full environment and says everything was successful, even though no tests were actually run.</p>
<p>Some people might like that behavior better, but I like being able to run &#8220;gtaf&#8221; whether or not I have any tests that failed.</p>
<p>I can see why some might want the alternate behavior, so that it only runs tests if they are failed.  If so, the grailsFailedTests function could be modified to this:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;">function grailsFailedTests<span style="color: #669966;">&#40;</span><span style="color: #669966;">&#41;</span> <span style="color: #669966;">&#123;</span>
	grailsTest $<span style="color: #cc66cc;">1</span> $<span style="color: #cc66cc;">2</span> <span style="color: #669966;">-</span>rerun
<span style="color: #669966;">&#125;</span></pre></div></div>

<p>Thanks for the pointer Mike!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2067</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 04 Nov 2009 13:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2067</guid>
		<description>The Grails test-app script also has a built in flag to re-run failed tests.  I haven&#039;t used it much, but you might be able to simplify your logic a little bit to find failed tests using:

grails test-app -rerun

See http://grails.org/doc/latest/ref/Command%20Line/test-app.html</description>
		<content:encoded><![CDATA[<p>The Grails test-app script also has a built in flag to re-run failed tests.  I haven&#8217;t used it much, but you might be able to simplify your logic a little bit to find failed tests using:</p>
<p>grails test-app -rerun</p>
<p>See <a href="http://grails.org/doc/latest/ref/Command%20Line/test-app.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/grails.org/doc/latest/ref/Command_20Line/test-app.html?referer=');">http://grails.org/doc/latest/ref/Command%20Line/test-app.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2064</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Wed, 04 Nov 2009 05:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2064</guid>
		<description>@Robert - Thanks! That makes sense, so people using bash would just need to change this:

&lt;pre lang=&quot;bash&quot;&gt;
function grailsTestAppFailed() { grailsFailedTests grails &quot;&quot; }
&lt;/pre&gt;

to this:

&lt;pre lang=&quot;bash&quot;&gt;
function grailsTestAppFailed() {
    grailsFailedTests grails &quot;&quot;
}
&lt;/pre&gt;

Yet another reason that I like zsh better :).</description>
		<content:encoded><![CDATA[<p>@Robert &#8211; Thanks! That makes sense, so people using bash would just need to change this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> grailsTestAppFailed<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> grailsFailedTests grails <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>to this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> grailsTestAppFailed<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    grailsFailedTests grails <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Yet another reason that I like zsh better :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Fischer</title>
		<link>http://naleid.com/blog/2009/11/03/grails-testing-alias-to-rerun-failed-tests/comment-page-1/#comment-2063</link>
		<dc:creator>Robert Fischer</dc:creator>
		<pubDate>Wed, 04 Nov 2009 03:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=99#comment-2063</guid>
		<description>bash requires the open bracket of a function declaration to be the last element on the line.  Otherwise, you&#039;ll get confusing messages about unexpected end-of-file.</description>
		<content:encoded><![CDATA[<p>bash requires the open bracket of a function declaration to be the last element on the line.  Otherwise, you&#8217;ll get confusing messages about unexpected end-of-file.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
