Skip to content

Commit 4d34a97

Browse files
committed
Improve info logging
1 parent e8b37ad commit 4d34a97

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

assertthat-bdd.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22
s.name = %q{assertthat-bdd}
3-
s.version = "1.0.1"
4-
s.date = %q{2018-12-07}
3+
s.version = "1.0.2"
4+
s.date = %q{2018-12-09}
55
s.summary = %q{AssertThat bdd integration for Ruby}
66
s.authors = ["Glib Briia"]
77
s.email = 'glib.briia@assertthat.com'

bin/assertthat-bdd-features

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'assertthat-bdd'
33
require 'optparse'
44

5-
VERSION = '1.0.1'
5+
VERSION = '1.0.2'
66

77
options = {}
88
OptionParser.new do |opt|

bin/assertthat-bdd-report

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'assertthat-bdd'
33
require 'optparse'
44

5-
VERSION = '1.0.1'
5+
VERSION = '1.0.2'
66

77
options = {}
88
OptionParser.new do |opt|

lib/assertthat-bdd.rb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSER
1717
if e.response.respond_to?('code') then
1818
case e.response.code
1919
when 401
20-
puts '[ERROR] Unauthorized error (401). Supplied secretKey/accessKey is invalid'
20+
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
2121
when 400
22-
puts '[ERROR] ' + e.response
22+
puts '*** ERROR: ' + e.response
2323
when 500
24-
puts '[ERROR] Jira server error (500)'
24+
puts '*** ERROR: Jira server error (500)'
2525
end
2626
end
2727
else
28-
puts '[ERROR] Failed download features: ' + e.message
28+
puts '*** ERROR: Failed download features: ' + e.message
2929
end
3030
return
3131
end
@@ -39,7 +39,7 @@ def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSER
3939
entry.extract("#{outputFolder}#{entry.name}")
4040
end
4141
end
42-
puts "[INFO] #{features_count} features downloaded"
42+
puts "*** INFO: #{features_count} features downloaded"
4343
File.delete("#{outputFolder}/features.zip")
4444
end
4545
end
@@ -48,7 +48,8 @@ class Report
4848
def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, runName: 'Test run '+Time.now.strftime("%d %b %Y %H:%M:%S"), jsonReportFolder: './reports', jsonReportIncludePattern: '.*.json' )
4949
url = "https://bdd.assertthat.com/rest/api/1/project/" + projectId + "/report"
5050
files = Find.find(jsonReportFolder).grep(/#{jsonReportIncludePattern}/)
51-
puts "[INFO] #{files.count} found matching parretn #{jsonReportIncludePattern}:"
51+
puts "*** INFO: #{files.count} files found matching parretn #{jsonReportIncludePattern}:"
52+
puts "*** INFO: #{files}"
5253
runId = -1
5354
files.each do |f|
5455
request = RestClient::Request.new(
@@ -69,21 +70,21 @@ def self.upload(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTT
6970
if e.response.respond_to?('code') then
7071
case e.response.code
7172
when 401
72-
puts '[ERROR] Unauthorized error (401). Supplied secretKey/accessKey is invalid'
73+
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
7374
when 500
74-
puts '[ERROR] Jira server error (500)'
75+
puts '*** ERROR: Jira server error (500)'
7576
end
7677
end
7778
else
78-
puts '[ERROR] Failed to submit report: ' + e.message
79+
puts "*** ERROR: Failed to submit json #{f}: " + e.message
7980
end
8081
return
8182
end
8283
resposne_json = JSON.parse(response)
8384
if resposne_json['result'] == 'success'
8485
runId = resposne_json['runId']
8586
else
86-
puts '[ERROR] Failed to submit report: ' + resposne_json['message']
87+
puts "*** ERROR: Failed to submit json #{f}: " + resposne_json['message']
8788
end
8889
end
8990
end

0 commit comments

Comments
 (0)