Recently in ZenTest Category

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.2 / 2008-03-20

  • 4 minor enhancements:

    • Added compatibility with miniunit differences.
    • Added emailnotify, jabbernotify, and rcov autotest plugins.
    • Updated rakefile to include examples automatically in exampledotautotest.
    • multiruby now outputs each command so you can grab it easily.
  • 5 bug fixes:

    • Ensure tests are run after reset.
    • Fixed all test/rails tests to run in any combo.
    • Fixed up growl.rb a bit... still buggy (growlnotify, not growl.rb).
    • Fixes for -f (fast start) and last_mtime in general.
    • Fixes for 1.9 and rubinius
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

From a less than inspired blog post comes an awesome comment:

"Autotest is like a super duper little build monkey who throws poo whenever your tests fail."

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.1 / 2008-01-31

Something I should have emphasized more in my release notes:

  • Added ability to set test execution order, defaults to :random. EVIL!

What does this mean?

It means that if you ignored my post titled "rake passes but autotest fails?", then autotest is gonna get its revenge when you update. No. Really. It is gonna f' your tests up real good. Why? Because it is Good Testing Practice™ for all your tests to be completely standalone. If I could run your individual tests randomly I'd do that as well(*).

I've had a number of filed bugs and hallway conversations where someone states "blah blah ... but when I run it under autotest, it fails" and somehow they've convinced themselves that it is autotest's fault. "HAH!", I say! Not bloody likely. If your tests aren't written in such a way that each and every individual test can be run in isolation or in any combination and order, then you didn't write tests, you wrote bugs. I really can't emphasize that enough so autotest plans to help you exorcize yourself of these bugs.

Really, you should just take the hit right now and deal with it. But what if your PHB is breathing down your neck? You can tell autotest to run your tests in "Ye Olde Fashioned Sorted Mode" with the following (be sure to copy and paste and fill it out:

Autotest.add_hook :initialize do |at|
  at.order = :alpha  #  I am a bad person. [your name], [today's date]
end

and then make yourself a promise that in 1 month's time autotest will be able to run your tests in any order. Now write it down, and sign it, in blood.

*) I did mention that I wrote miniunit, right? *smile*
**) They probably aren't. PHB's usually won't let you use autotest in the first place. Or write tests for that matter. So if you've gotten this far, you're probably in good shape.

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.9.0 / 2008-01-30

  • 15 minor enhancements:

    • Added Wilson's patch to allow unit_diff to work with mspec. Adding rspec next.
    • Minor overhaul for autotest:
    • Added -f flag to start up without testing.
    • Added -q flag to autotest to make it extra quiet. Patch by Aaron Patterson.
    • Added ability to set test execution order, defaults to :random. EVIL!
    • Added completedre and failedresults_re to help subclasses like rspec.
    • Added deprecation warnings for hooks. Deprecated :run.
    • Added find_directories accessor, defaults to ['.']
    • Added sleep accessor, defaults to 1 second.
    • Changed findfiles to order files in the same order as finddirectories.
    • Changed how autodiscover works with $:, added lib to the front.
    • Cleaned out nearly every @ and use accessor methods instead. You should too.
    • Made test_mappings ordered.
    • Removed @files, adding @findorder and @knownfiles.
    • Renamed testsforfile to testfilesfor.
    • testfilesfor now only returns known files.
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

ZenTest Überness

| | Comments (0)

David Chelimsky has a great writeup in his blog about the latest changes to ZenTest and how they affect you and your .autotest file.

One additional thing:

% ln -s ~/Work/git/rubinius ~/.multiruby/install
% multiruby -e 'p 1 + 2'
... blah blah ...
Passed: 1.8.6-p111, 1.8.4, 1.8.5, rubinius, 1.9.0-0, 1.8.2
Failed:

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.8.0 / 2008-01-12

  • 10 minor enhancements:

    • Added basic support for rubinius in multiruby.
    • Changed Dunno! message to only output on -v
    • Added Getting Started with Autotest by Philippe Hanrigou (with permission)
    • Updated exampledotautotest.rb for newer plugins.
    • Cleaned up rdoc.
    • Worked with David Chelimsky to make Autotest more uber for subclasses.
    • Removed exceptions and test_mappings accessors and replaced with add/remove/clear methods. Updating .autotest should be very straightforward.
    • Moved :initialize hook to beginning of run method
    • Changed load/customization order to be:
    • Autotest
    • AutotestSubClass
    • ~/.autotest
    • ./.autotest (yes, both .autotest files).
    • Moved away from using instance variables to encourage subclasses to use accessors.
  • http://www.zenspider.com/ZSS/Products/ZenTest/

  • http://rubyforge.org/projects/zentest/
  • ryand-ruby@zenspider.com

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.7.2 / 2008-01-09

  • 2 minor enhancements:

    • Extended file map for tests to include subdirs correctly.
    • Added debugging output on bad maps if -v set.

3.7.1 / 2007-12-27

Now that 1.9 is out, it is time to talk about multi-version testing using multiruby. multiruby is a lesser known tool in the zentest family. It automatically builds and privately installs multiple versions of ruby and multiplexes commands to all of them, allowing you to run your tests across multiple versions of ruby all at once.

If you read this blog, you probably already have zentest and multiruby is already available to you. If not, sudo gem install zentest and you're good to go. You can try it out now (tho I recommend updating zentest to the latest version for all the candy) and you should see something like this:

% multiruby -e 'p 1+1'
creating /Users/ryan/.multiruby
creating build
creating install
creating versions
  Downloading initial ruby tarballs to ~/.multiruby/versions:
    ruby-1.8.6-p111.tar.gz via HTTP... this might take a while.
    ruby-1.9.0-0.tar.gz via HTTP... this might take a while.
  ...done
  Put other ruby tarballs in ~/.multiruby/versions to use them.
creating /Users/ryan/.multiruby/install/1.8.6-p111
Running command: tar zxf ../versions/ruby-1.8.6-p111.tar.gz
building and installing 1.8.6-p111
Running command: ./configure --prefix /Users/ryan/.multiruby/install/1.8.6-p111 &> log.configure
Running command: nice make -j4 &> log.build
Running command: make install &> log.install
creating /Users/ryan/.multiruby/install/1.9.0-0
Running command: tar zxf ../versions/ruby-1.9.0-0.tar.gz
building and installing 1.9.0-0
Running command: ./configure --prefix /Users/ryan/.multiruby/install/1.9.0-0 &> log.configure
Running command: nice make -j4 &> log.build
Running command: make install &> log.install

VERSION = 1.8.6-p111

2

RESULT = 0

VERSION = 1.9.0-0

2

RESULT = 0

TOTAL RESULT = 0 failures out of 2

Passed: 1.8.6-p111, 1.9.0-0
Failed:

Of course, it only builds when it detects new versions in the versions directory. The next time you run it should be much faster and cleaner:

% multiruby -e 'p 1+1'

VERSION = 1.8.6-p111

2

RESULT = 0

VERSION = 1.9.0-0

2

RESULT = 0

TOTAL RESULT = 0 failures out of 2

Passed: 1.8.6-p111, 1.9.0-0
Failed:

What this really boils down to is this: you now have a command that you can use in place of ruby to test on multiple versions of ruby. Where before you'd type rake and get:

% rake
(in /Users/ryan/Work/p4/zss/src/ZenTest/dev)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w -Ilib:ext:bin:test -e 'require "test/test_autotest.rb"; require "test/test_help.rb"; require "test/test_rails_autotest.rb"; require "test/test_rails_controller_test_case.rb"; require "test/test_rails_helper_test_case.rb"; require "test/test_rails_view_test_case.rb"; require "test/test_unit_diff.rb"; require "test/test_zentest.rb"; require "test/test_zentest_assertions.rb"; require "test/test_zentest_mapping.rb"; require "test/unit"'
Loaded suite -e
Started
......................................................................................................................................
Finished in 0.1947 seconds.

134 tests, 425 assertions, 0 failures, 0 errors

Now you can grab that ruby command and run it with multiruby instead:

% multiruby -w -Ilib:ext:bin:test -e 'require "test/test_autotest.rb"; require "test/test_help.rb"; require "test/test_rails_autotest.rb"; require "test/test_rails_controller_test_case.rb"; require "test/test_rails_helper_test_case.rb"; require "test/test_rails_view_test_case.rb"; require "test/test_unit_diff.rb"; require "test/test_zentest.rb"; require "test/test_zentest_assertions.rb"; require "test/test_zentest_mapping.rb"; require "test/unit"' 

VERSION = 1.8.6-p111

Loaded suite -e
Started
.........................................................................................................
Finished in 0.148562 seconds.

105 tests, 338 assertions, 0 failures, 0 errors

RESULT = 0

VERSION = 1.9.0-0

Loaded suite -e
Started
..................................................................................................................................
Finished in 0.147284 seconds.

130 tests, 407 assertions, 0 failures, 0 errors

RESULT = 0

TOTAL RESULT = 0 failures out of 2

Passed: 1.8.6-p111, 1.9.0-0
Failed:

But wait, there's MORE! As an added bonus, if you're using hoe on your project, you already have a rake multi task that does the running for you, no icky copy and paste!

That is all there is to it (besides fixing 1.9 compatibilities, of course), so get out there and test your code!

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

Changes:

3.7.1 / 2007-12-27

About this Archive

This page is a archive of recent entries in the ZenTest category.

ZenObfuscate is the previous category.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1