Katello/katello — pull request #612 by ehelms (2012-09-07 15:25:55+00:00)
Title: Pulp integration tests

This provides a setup of full integration tests targeted at the lib/resources/pulp.rb API bindings. This was done as a pre-cursor to the Pulp V2 migration work and provides verification for our use of Pulp V1 and as a road-map to the generation of bindings for V2.

This requires three new development/test gems:
vcr 2.2.4 - http://rubygems.org/gems/vcr
minitest 3.3 - http://rubygems.org/gems/minitest
webmock 1.8.8 - http://rubygems.org/gems/webmock

Note:
The tests can be run against a set of pre-recorded responses from Pulp or against a live Pulp that has been setup with a Katello installation. Included within the test data is a set of recorded responses against Pulp 1.1.12 and a basic repository for use in tests based off of zoo5.

How to Run:
To run all tests against recorded data:
src/script/pulp_integration_tests

To run all tests against live Pulp:
src/script/pulp_integration_tests --live

To run a particular test:
src/script/pulp_integration_tests

For example, live repository test: src/script/pulp_integration_tests repository --live

Questions:
1) Why not use a Rake task? To avoid the heavy setup cost incurred by Rails and to harness the speed of minitest

2) Why use minitest? Fast, easy to use, and allowed writing true unit tests.

3) Why did some of pulp.rb change? To allow for ease of testing by exposing parameters that are valid for those API calls.

4) Why add the conditional around Compass? To prevent compass compilation when running tests and eating up testing time.