gds-operations/vcloud-tools-tester — pull request #21 by annashipman (2014-08-07 16:06:01+00:00)
Title: [#70162466] Use new core structure

@mattbostock, could you take a look at some strange behaviour here please?

I may be missing something, but when I change the reference in `FixtureParameters` to be instead `Vcloud::Core::ApiInterface`, the unit tests try and log in:

Annas-MacBook-Pro:vcloud-tools-tester annashipman$ bx rake spec
/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby -S rspec spec/vcloud/tools/tester/fixture_parameters_spec.rb spec/vcloud/tools/tester/test_parameters_spec.rb spec/vcloud/tools/tester/test_setup_spec.rb spec/vcloud/tools/tester/user_parameters_spec.rb
FFFF..............

Failures:

1) Vcloud::Tools::Tester::FixtureParameters correct fixture networks exist doesn't provision new networks
Failure/Error: subject { Vcloud::Tools::Tester::FixtureParameters.new(user_params) }
ArgumentError:
Missing required arguments: vcloud_director_username, vcloud_director_password, vcloud_director_host
# /Users/annashipman/projects/govuk/vcloud/vcloud-core/lib/vcloud/core/fog/service_interface.rb:26:in `initialize'
# /Users/annashipman/projects/govuk/vcloud/vcloud-core/lib/vcloud/core/fog/service_interface.rb:183:in `new'
# /Users/annashipman/projects/govuk/vcloud/vcloud-core/lib/vcloud/core/fog/service_interface.rb:183:in `initialize'
# /Users/annashipman/projects/govuk/vcloud/vcloud-core/lib/vcloud/core/api_interface.rb:9:in `new'
# /Users/annashipman/projects/govuk/vcloud/vcloud-core/lib/vcloud/core/api_interface.rb:9:in `initialize'
# ./lib/vcloud/tools/tester/fixture_parameters.rb:8:in `new'
# ./lib/vcloud/tools/tester/fixture_parameters.rb:8:in `initialize'
# ./spec/vcloud/tools/tester/fixture_parameters_spec.rb:5:in `new'
# ./spec/vcloud/tools/tester/fixture_parameters_spec.rb:5:in `block (2 levels) in '
# ./spec/vcloud/tools/tester/fixture_parameters_spec.rb:125:in `block (3 levels) in '

As it is in this PR, it works fine.

I don't understand why it's trying to log in.

I'm also not sure how far to go with removing Fog here, as it's very tied up with FOG_CREDENTIALS and also there's the issue where it's checking whether a returned network is a fog thing. Since this is a utility gem I'm sort of tempted to stop here. But I would like to know why the unit tests are trying to log in. Any thoughts?