assertthat-bdd 1.6.0 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0133f64a8483d8b19879e683995b21d727b1746c039eea9b86c361094129392e
4
- data.tar.gz: dd6c9717e34943908f8b1e80fd1e56e16d2f885bd61cea8fca76c724b6478fdf
3
+ metadata.gz: b36d65ebbb9b241942bf78871959da8f254fa4e1e90f27186693526f09a35e90
4
+ data.tar.gz: 753ec600d188310b6fea5bbc84543489b25ea7aed727e1b7735ffd8df8551775
5
5
  SHA512:
6
- metadata.gz: 2fd2ebf8961955d92c3e3d95d4f05ea988069b49c5de1236eaf5b94f312e35c83869aa48fa6f350b12b8de517688796f04920eb626fde37202363b4f030d735c
7
- data.tar.gz: 7b683aa24951e55061aa65944d2d234c653b2772dfca54b9f591ff5492710f973b1405c81f19cbe33fa75004eb84eb0fe93b4b1d57f8df4b5470547e33b3384c
6
+ metadata.gz: 453a1604b2ccf676ceae5fbe51e93129fa29f13424cfdff9ae1f8c26e2b58ff35e1fc6c6d5547e8adee0c7548a8ff6650e9417f8bbcd8713baa7e5d67376d9c3
7
+ data.tar.gz: 7c8176cf0a4881470a0a04c25cacdee7468a4cbd958e10017ae6f55c299976e8a29b20cea58d2e4aff951c5a5641f1976507a1ba79d7e07d614c6a27d056c9e5
@@ -2,7 +2,7 @@
2
2
  require 'assertthat-bdd'
3
3
  require 'optparse'
4
4
 
5
- VERSION = '1.2.0'
5
+ VERSION = '1.6.2'
6
6
 
7
7
  options = {}
8
8
  OptionParser.new do |opt|
@@ -27,7 +27,7 @@ end.parse!
27
27
 
28
28
  raise OptionParser::MissingArgument, "'projectId' option is not specified" if options[:projectId].nil?
29
29
 
30
- AssertThatBDD::Features.download(options)
30
+ AssertThatBDD::Features.download(**options)
31
31
 
32
32
 
33
33
 
@@ -2,7 +2,7 @@
2
2
  require 'assertthat-bdd'
3
3
  require 'optparse'
4
4
 
5
- VERSION = '1.2.0'
5
+ VERSION = '1.6.2'
6
6
 
7
7
  options = {}
8
8
  OptionParser.new do |opt|
@@ -13,6 +13,7 @@ OptionParser.new do |opt|
13
13
  opt.on('-n','--runName RUN_NAME', 'The name of the run - default \'Test run dd MMM yyyy HH:mm:ss\'') { |o| options[:runName] = o }
14
14
  opt.on('-f','--jsonReportFolder JSON_FOLDER_PATH', 'Json report folder - default ./reports') { |o| options[:mode] = o }
15
15
  opt.on('-i','--jsonReportIncludePattern INCLUDE_REGEX', 'Regex to search for cucumber reports - default .*.json') { |o| options[:jql] = o }
16
+ opt.on('-j','--jql JQL_FILTER', 'Jql issues filter to update with results') { |o| options[:jql] = o }
16
17
  opt.on('-x','--proxy PROXY_URL', 'proxy url to connect to Jira') { |o| options[:proxy] = o }
17
18
  opt.on_tail('-h', '--help', 'Show help') do
18
19
  puts opt
@@ -26,6 +27,6 @@ end.parse!
26
27
 
27
28
  raise OptionParser::MissingArgument, "'projectId' option is not specified" if options[:projectId].nil?
28
29
 
29
- AssertThatBDD::Report.upload(options)
30
+ AssertThatBDD::Report.upload(**options)
30
31
 
31
32
 
@@ -10,8 +10,18 @@ module AssertThatBDD
10
10
  url = ['https://bdd.assertthat.app/rest/api/1/project/', projectId, '/features'].map(&:to_s).join('')
11
11
  url = [jiraServerUrl,"/rest/assertthat/latest/project/",projectId,"/client/features"].map(&:to_s).join('') unless jiraServerUrl.nil?
12
12
  resource = RestClient::Resource.new(url, :user => accessKey, :password => secretKey, :content_type => 'application/zip')
13
- begin
14
13
  resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql, tags: tags}) do |response, request, result|
14
+ case response.code
15
+ when 401
16
+ puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
17
+ return
18
+ when 400
19
+ puts '*** ERROR: ' + e.response
20
+ return
21
+ when 500
22
+ puts '*** ERROR: Jira server error (500)'
23
+ return
24
+ end
15
25
  Dir.mkdir("#{outputFolder}") unless File.exists?("#{outputFolder}")
16
26
  File.open("#{outputFolder}/features.zip", 'wb') {|f| f.write(response) }
17
27
  features_count = 0
@@ -27,31 +37,13 @@ module AssertThatBDD
27
37
  puts "*** INFO: #{features_count} features downloaded"
28
38
  end
29
39
  File.delete("#{outputFolder}/features.zip")
30
- rescue => e
31
-
32
- if e.respond_to?('response') then
33
- if e.response.respond_to?('code') then
34
- case e.response.code
35
- when 401
36
- puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
37
- when 400
38
- puts '*** ERROR: ' + e.response
39
- when 500
40
- puts '*** ERROR: Jira server error (500)'
41
- end
42
- end
43
- else
44
- puts '*** ERROR: Failed download features: ' + e.message
45
- end
46
- return
47
- end
48
40
  end
49
41
  end
50
42
  end
51
43
  end
52
44
 
53
45
  class Report
54
- 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', jiraServerUrl: nil )
46
+ 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', jql: nil ,jiraServerUrl: nil )
55
47
  url = "https://bdd.assertthat.app/rest/api/1/project/" + projectId + "/report"
56
48
  url = jiraServerUrl+"/rest/assertthat/latest/project/"+projectId+"/client/report" unless jiraServerUrl.nil?
57
49
  files = Find.find(jsonReportFolder).grep(/#{jsonReportIncludePattern}/)
@@ -68,7 +60,7 @@ module AssertThatBDD
68
60
  :multipart => true,
69
61
  :file => File.new(f, 'rb')
70
62
  },
71
- :headers => { :params =>{:runName => runName, :runId=> runId}}
63
+ :headers => { :params =>{:runName => runName, :runId=> runId, :jql=> jql}}
72
64
  )
73
65
  begin
74
66
  response = request.execute
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assertthat-bdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glib Briia