diff options
Diffstat (limited to 'qa/qa/resource/base.rb')
-rw-r--r-- | qa/qa/resource/base.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qa/qa/resource/base.rb b/qa/qa/resource/base.rb index 26a2a668cc1..640d2a8f06e 100644 --- a/qa/qa/resource/base.rb +++ b/qa/qa/resource/base.rb @@ -80,11 +80,25 @@ module QA Support::FabricationTracker.start_fabrication result = yield.tap do fabrication_time = Time.now - start + resource_identifier = begin + if resource.respond_to?(:username) && resource.username + "with username '#{resource.username}'" + elsif resource.respond_to?(:full_path) && resource.full_path + "with full_path '#{resource.full_path}'" + elsif resource.respond_to?(:name) && resource.name + "with name '#{resource.name}'" + elsif resource.respond_to?(:id) && resource.id + "with id '#{resource.id}'" + end + rescue QA::Resource::Base::NoValueError + nil + end Support::FabricationTracker.save_fabrication(:"#{method}_fabrication", fabrication_time) Runtime::Logger.debug do msg = ["==#{'=' * parents.size}>"] msg << "Built a #{name}" + msg << resource_identifier if resource_identifier msg << "as a dependency of #{parents.last}" if parents.any? msg << "via #{method}" msg << "in #{fabrication_time} seconds" |