I've updated the patch to address your comment
(https://issues.apache.org/jira/browse/DTACLOUD-15). The driver should be
complete and ready to be committed.
Now I'm turning my attention to tests. I'm running into issues when running
either test set:
1) When I run "rake test" within the server directory, I get no output. After
inspecting server/Rakefile, I changed the test FileList.new(...) to
"t.test_files = FileList.new('tests/**/**/*_test.rb')" to pull in the "mock"
directory. This triggers common.rb to execute, but I then receive a LoadError
for "spec." I can't find this gem installed locally or remotely. I'm trying
to install it via "sudo gem install spec."
2) When I run "API_DRIVER={ec2, mock} rake cucumber" within top level tests,
the rake aborts from not being able to load "rack/test"
Only ec2, mock, and rhevm are supported for cucumber tests, and only mock is
supported for the unit tests. Have these tests been updated recently and we
know they should run? Of course I'm new to ruby, so I could be making a
trivial mistake.
Thanks
Eric W.
On Feb 2, 2011, at 7:54 PM, David Lutterkort wrote:
> On Wed, 2011-02-02 at 15:30 -0500, Eric Woods wrote:
>> Unfortunately I'm not able to provide a test account for IBM's cloud,
>> so we'll have to "fake it" for test cases.
>
> Too bad - we'll figure something else out.
>
>> Is writing/running tests documented anywhere?
>
> There's two levels of testing that are relevant here:
> 1. unit tests in server/tests that you run with 'rake tests' from
> the server directory[1]
> 2. blackbox cucumber tests in the toplevel tests/ directory. They
> are run with 'API_DRIVER=xyz rake cucumber' where API_DRIVER
> selects for which driver to run tests; currently, we have tests
> for the mock, ec2 and rhevm drivers. These tests can either run
> directly against an actual cloud or off of canned data captured
> from a 'real' test run - how to capture data is a bit of a black
> art, and Michal needs to document that
>
> The underlying test frameworks though (Test::Unit and Cucumber) are
> standard Ruby test frameworks.
>
>> The issue is not all hardware profiles are valid for all images. For
>> each image, a list of valid HWP configurations are provided. This
>> mandates that I check the corresponding image to determine a valid
>> "default." I noticed that images() is called when a create request is
>> issued, so I stored the image there rather than performing an
>> additional lookup later.
>
> Aah .. it all makes sense now; I hadn't noticed that. Just to be on the
> safe side then, just check that the cached image is really what we want,
> i.e. on line 81 etc. instead of
>
> if @last_image.nil?
> @last_image = sbc_client.list_images(image_id).map[0]
> end
> write
> if @last_image.nil? || @last_image.id != image_id
> @last_image = sbc_client.list_images(image_id).map[0]
> end
>
> And maybe add a comment in images why it's ok to cache an image in
> @last_image.
>
>> http://incubator.apache.org/deltacloud/framework.html. Near the
>> bottom where reboot_instance() and stop_instance() are documented.
>
> Aah .. cool; fixed that.
>
> David
>
> [1] and yes, the coverage of these tests is embarrassing
>
>