swiftrail 0.1.6 → 0.1.7

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: 24b9beb85d5c05e2b80e40dc6e5cfcc29c7d24571162d5003fb69f8bbb681937
4
- data.tar.gz: 717bd96b5e4a2fd1b26e7d8a8e4c47da06aa297cd4fb41bef39826531cfe0189
3
+ metadata.gz: 51234aa58e9dc759d1c9077869dd5fcddc3d3bb1a2a1dd6d8a473cd34b04059c
4
+ data.tar.gz: 35cae68f64877c428d2d8e186e266f9a0e7f7e0cbf0b9eebaa68001c09992f8f
5
5
  SHA512:
6
- metadata.gz: ca865e1bd7b0174b409bdbecd6d285e201fd38e0c7ca63444842dacf169be5477fe66df85db5dcb67adba7e3d2060df8fef546619f02e5ad8c426db6fedba52f
7
- data.tar.gz: 2a58d682fd847f8335a051998054198916d4e2694d3e9d66ce38097eb8703fb557ab1857aa1186802a41ff5203093f31e55f51b984f99c87538abf8dcd936202
6
+ metadata.gz: 7857a8b24416b06c7ce38d10fcbf0779df08246b04b64a5a0a4fa502c2d2aa7a9315e390b52d7cc62394c518d63a19cc0e1b454f185ce77597ecd45472ff9e08
7
+ data.tar.gz: 0eb016bd6a57e0a23cbac1c5a9e5830fad3e3e6d43dc1f8d398758c78d93ebdb71677ad565fe6fa8e1f4e3cd82ca774165dce46df88c001a21715804b7b19beb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- swiftrail (0.1.5)
4
+ swiftrail (0.1.6)
5
5
  nokogiri (~> 1.10)
6
6
  thor (~> 0.20)
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  diff-lcs (1.3)
12
12
  mini_portile2 (2.4.0)
13
- nokogiri (1.10.2)
13
+ nokogiri (1.10.3)
14
14
  mini_portile2 (~> 2.4.0)
15
15
  rake (10.5.0)
16
16
  rspec (3.8.0)
@@ -19,7 +19,7 @@ GEM
19
19
  rspec-mocks (~> 3.8.0)
20
20
  rspec-core (3.8.0)
21
21
  rspec-support (~> 3.8.0)
22
- rspec-expectations (3.8.2)
22
+ rspec-expectations (3.8.3)
23
23
  diff-lcs (>= 1.2.0, < 2.0)
24
24
  rspec-support (~> 3.8.0)
25
25
  rspec-mocks (3.8.0)
data/lib/swiftrail/cli.rb CHANGED
@@ -22,8 +22,9 @@ module Swiftrail
22
22
  desc 'report', 'Reports success/failure to test rail, based on the results of your tests'
23
23
  method_option :test_reports, type: :string, aliases: '-reports', default: defaults['reports'], desc: 'Regex to match your junit report files.'
24
24
  method_option :strict, type: :boolean, aliases: '-strict', default: defaults['reports'], desc: 'Fail if there you are trying to report missing test case id'
25
+ method_option :dry_run, type: :boolean, default: defaults['dry_run'], desc: 'During dry run, results will be printed out instead of sent to test rail'
25
26
  def report
26
- if swiftrail_reporter.report_results(options[:run_id])
27
+ if swiftrail_reporter.report_results(options[:run_id], options[:dry_run])
27
28
  puts 'Successfully reported the results'
28
29
  else
29
30
  puts 'There was an issue while reporting the results'
@@ -22,7 +22,8 @@ module Swiftrail
22
22
  test_classes: '',
23
23
  test_rail_username: '',
24
24
  test_rail_password: '',
25
- test_rail_url: ''
25
+ test_rail_url: '',
26
+ dry_run: false,
26
27
  }
27
28
  end
28
29
 
@@ -1,18 +1,16 @@
1
1
  module Swiftrail
2
2
  module Testrail
3
3
  module Api
4
- TestRailTest = Struct.new(:case_id, :id, :title, :automated) do
4
+ TestRailTest = Struct.new(:case_id, :id, :title) do
5
5
  def self.from_json(json)
6
- automated = json['custom_automated'] == 3 || json['custom_automated'] == 4
7
- TestRailTest.new(json['case_id'], json['id'], json['title'], automated)
6
+ TestRailTest.new(json['case_id'], json['id'], json['title'])
8
7
  end
9
8
 
10
9
  def to_json(*_args)
11
10
  {
12
11
  id: id,
13
12
  case_id: case_id,
14
- title: title,
15
- automated: automated
13
+ title: title
16
14
  }
17
15
  end
18
16
  end
@@ -15,8 +15,13 @@ module Swiftrail
15
15
  @strict = strict
16
16
  end
17
17
 
18
- def report_results(run_id)
19
- test_rail_client(run_id).publish_results(purge(assembler(swift_test_parser.parse, junit_parser.parse).assemble, run_id))
18
+ def report_results(run_id, dry_run)
19
+ unless dry_run
20
+ test_rail_client(run_id).publish_results(purge(assembler(swift_test_parser.parse, junit_parser.parse).assemble, run_id))
21
+ else
22
+ STDOUT::puts("RUN_ID = #{run_id}")
23
+ STDOUT::puts(purge(assembler(swift_test_parser.parse, junit_parser.parse).assemble, run_id).map(&:to_json))
24
+ end
20
25
  end
21
26
 
22
27
  private
@@ -1,3 +1,3 @@
1
1
  module Swiftrail
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swiftrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slavko Krucaj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-02 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri