Katello/katello — pull request #1384 by komidore64 (2013-01-11 16:20:01+00:00)
Title: adding thumbslug to headpin's ping function and tests, etc

This commit contains changes to Ping to include Thumbslug in the ping
list. At this time, Thumbslug requires cert authentication for its
ping function to work correctly, so headpin looks for an SSL error
to know whether Thumblug is running or not.

Also contained are spec tests for the Ping model and Ping controller.
All outpoing HTTP requests are stubbed with WebMock, and all OAuth
requests are stubbed at their respective Resource objects.

Included in this commit a new rake take for running
the parallel test with a little more control. It allows for one to run
katello- and headpin-only tests using parallel_test.

for tests, run:

rake ptest:spec
# these run with 4 cores, by default
# tests for headpin vs katello are determined by the 'app_mode' in
# config/katello.yml

You can also specify a regular expression to single out particular spec
files

run:

rake ptest:spec['ping'] # spec files with 'ping'
rake ptest:spec['user|organization'] # runs 'user' and 'organization' spec files
# runs with one core when you specify a search string though you can
# override it

rake "ptest:spec['user|organization', 36]" # run the spec tests on 36 cores. woah!

The way that rspec differentiates between katello and headpin tests is
by placing tags on the test blocks.

To specify a test to run for katello only, add a `:katello => true` tag

describe "set of katello tests", :katello => true do ... end
context "set of katello test", :katello => true do ... end
it "runs a test for katello only", :katello => true do ... end

or `:headpin => true` for headpin-only tests

describe "set of headpin tests", :headpin => true do ... end
context "set of headpin test", :headpin => true do ... end
it "runs a test for headpin only", :headpin => true do ... end

For tests that you want to run on both sides, simply do not
add a tag.