Prepare noop tests for external fixtures

Backwards compatible change to prepare
the noop tests to consume external fixtures
from the .fixtures.yml file

Partial blueprint deployment-data-dryrun

Change-Id: I4ddb580d1179caa81d0320520bccbe9f6e11c5c1
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2015-12-22 15:32:46 +01:00
parent e4b0a3c53d
commit 065a69babb
4 changed files with 22 additions and 0 deletions

4
tests/noop/.fixtures.yml Normal file
View File

@ -0,0 +1,4 @@
fixtures:
repositories:
#TODO(bogdando) enable once switched to external fixtures
#fuel-noop-fixtures: "git://github.com/openstack/fuel-noop-fixtures.git"

View File

@ -1,3 +1,4 @@
deprecations.log
Gemfile.lock
coverage
spec/fixtures

View File

@ -1,4 +1,5 @@
require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/rake_tasks'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '--deprecation-out deprecations.log --color --tty --format documentation'

View File

@ -265,6 +265,19 @@ module NoopTests
"'#{File.join TEST_LIBRARY_DIR, spec}'"
end
# run the rake spec_prep to get fixtures
# return: success
# @return success
def self.rake_prep
inside_noop_tests_directory do
command_prep = "rake spec_prep"
command_prep = 'bundle exec ' + command_prep if options[:bundle]
debug " RUN: #{command_prep}"
system command_prep
$?.exitstatus == 0
end
end
# run the rspec commands with some options
# return: [ success, report ]
# @param [String] spec Spec file or pattern
@ -533,6 +546,9 @@ module NoopTests
exit 0
end
# ensure fixtures
rake_prep
if options[:missing_specs]
missing_specs = puppet_tasks_without_specs
if missing_specs.any?