puppet/autotest
Jeff McCune 5117e12d24 (maint) Ensure every file has a trailing newlines
Without this patch some files exist in the tree that don't have trailing
newlines.  This is annoying because perl -pli.bak -e will automatically
add a newline to every file it modifies in place.  The files that
actually have modifications by the global search and replace need to be
separated from the files that only have newlines added.

This patch simply adds newlines to everything if they don't exist on the
last line.

Yes, the PNG's are perfectly fine with a trailing newline as well.
2012-04-23 15:24:34 -07:00
..
images (maint) Ensure every file has a trailing newlines 2012-04-23 15:24:34 -07:00
README.markdown Fixing #3988 - adding support for watchr 2010-02-17 06:50:53 -08:00
discover.rb Code smell: Two space indentation 2010-07-09 18:12:17 -07:00
puppet_rspec.rb Code smell: Two space indentation 2010-07-09 18:12:17 -07:00
rspec.rb Code smell: Two space indentation 2010-07-09 18:12:17 -07:00

README.markdown

Continuous Testing

This directory contains configurations for continuous testing, using either autotest (part of the ZenTest gem) or watchr (in the watchr gem). The purpose of these tools is to automatically run the appropriate test when a file is changed or, if appropriate, all tests. In general, they do a straightforward mapping from a given code file to its unit and/or integration test.

It is highly recommended that you have one of these running at all times during development, as they provide immediate and continuous feedback as to your development process. There are some general usability downsides as you have to track the running process, but those downsides are easily worth it.

How to use

To use autotest, install ZenTest and run it with no arguments from the root of the puppet repository:

$ autotest

It is currently only configured to run specs.

To use watchr, run it with the watchr file specified as its argument:

$ watchr autotest/watcher.rb

Both will use growl if installed on a Mac, but watchr assumes the presence of growl and will likely fail without it. Autotest is a bit more mature and should be resilient to either.

The primary reason to use to use watchr over autotest is that it uses filesystem events to detect changes (theoretically portably although only tested on OS X), thus eliminating the need for polling for changes across all files being monitored.

Gotchas

Autotest will start out by running all tests; if you don't want that, stick a syntax error in one of the tests to force a failure, then fix it and go on your merry way.

Watchr, on the other hand, will default to only running the files you change.