/ Komodo

Unit Testing in Komodo 10.2: complete overhaul

If you don't know, Komodo IDE 10.2 got a new look for its Unit Testing feature.
I've decided to tell you about most important changes in it.

New UI

Unit test wizard

First of all, we got a new comfortable UI for creating test plans.

unit test wizard

You can do anything that you were able to do with the old unittest wizard.

More over, you can create file-specific tests by editing the command (just pick the Custom item in the framework list). The "Path" input will be the current working directory for your test plan, so you could use relative paths to your files :)

Unit test pane

You can now sort your passes by 4 categories: Successful, Failed, Error and All.

You can also filter by test suite if the unit test framework supports it (e.g. Python/NodeJS unit test frameworks; thanks to Nathan Rijksen from the Komodo Team for pointing that to me!)

unit test pane

(you can see a tree-like view where Mpociot\... things are test suites).

As you can see, there are 2 new checkboxes:

  • Run on Save will run the whole test once you save a file located in the unittest path (e.g. /path/lib/hello.rb).
  • Show details will show some additional details (e.g. error message) right below the pass item. (in case it's too long, it will be truncated).

stdout and stderr tabs contains the output and errors of the unit test command that Komodo run (in my case: rspec -f RspecTap::Formatter).

New backend

The old unit testing implementation didn't run tests the same way you would when you run them from the command line. This were causing some troubles.

As for now, Komodo runs tests in the same way you run them from your favorite terminal. It's all about parsing them now.

Komodo supports the following formatters:

  • TAP
  • Teamcity
  • pytest
  • go test

Supported frameworks are:

  • RSpec for Ruby
  • PHPUnit for PHP
  • pytest for Python 2 and Python 3
  • prove for Perl
  • Mocha for NodeJS
  • go test for Golang

But you can use custom framework as long as it could format its output to the one of supported formatters. For example, if a Ruby project you maintain uses bacon for unit testing instead of RSpec or Minitest, you could easily create a test plan for it. Just pick "Custom" in the framework chooser, write the command that will create a TAP-formatted output (bacon --tap filename.rb) and you're done.

If you have any questions, you can ask them in the comments section or on the Forums.