Fix patches for noop tests and use new path to spec

This commit is contained in:
Dmitry Shulyak 2015-11-11 11:35:51 +02:00
parent a0379206e9
commit 975258374b
3 changed files with 12 additions and 6 deletions

View File

@ -80,9 +80,11 @@ class Task(object):
after_naily)
@property
def manifest_name(self):
name = self.data['parameters']['puppet_manifest'].split('/')[-1]
return name.split('.')[0]
def spec_name(self):
splitted = self.data['parameters']['puppet_manifest'].split('/')
directory = splitted[-2]
name = splitted[-1].split('.')[0]
return "{}_{}_spec.rb'".format(directory, name)
@property
def dst_path(self):
@ -122,7 +124,7 @@ class Task(object):
"""
print self.manifest_name
lookup_stack_path = os.path.join(
INPUTS_LOCATION, self.manifest_name+"_spec.rb'")
INPUTS_LOCATION, self.spec_name)
if not os.path.exists(lookup_stack_path):
return {}

View File

@ -4,8 +4,9 @@
# @return [Array<TrueClass,FalseClass,NilClass>] success and empty report array
def self.rspec(spec)
inside_noop_tests_directory do
+ identity = spec.split('/')[-1]
+ ENV["SPEC"] = identity
+ splitted = spec.split('/')
+ dir, name = splitted[-2], splitted[-1]
+ ENV["SPEC"] = "#{dir}_#{name}"
command = "rspec #{RSPEC_OPTIONS} #{spec}"
- command = 'bundle exec ' + command if options[:bundle]
+ command = "bundle exec " + command if options[:bundle]

View File

@ -13,6 +13,9 @@ input:
uid:
type: str!
value:
env:
type: str!
value:
access:
value: null
access_hash: