res 1.2.20 → 1.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 926f44a6623812888da785a3288d7b9cda2bc689
4
- data.tar.gz: 3cfd845869bb676d5c415b1810053c4b250c5e04
3
+ metadata.gz: aa47591e6555761400892799664608c6d0f9ba64
4
+ data.tar.gz: 08f5b36d7700f282b9cead800f73dd9cfa180ed9
5
5
  SHA512:
6
- metadata.gz: a5a890ac9aa5580ce319b1eda01862d50fc8bb926a32e6f15ad14049ea673c40178f7e9a0204bfc0ecdfb2078b125086306bc2d30f8acf6f3a990eb7fafb7baa
7
- data.tar.gz: 24fe9331b9546f789cf4b2c85119b290c0e1b377ae117458c6b760bcf5820f2a2f5a2c42fbc2d3bad26d0b3ab228ea79546d0c36bbea53153f23f3d4e4412391
6
+ metadata.gz: d9adc025bf775ed2aa7156809b6c76622ae44207cd4c157410032be3762c085167cd1266687b6d79867fedf97ff59cc1b68e1981ec93848c5ac7ad9c8e9ecc6f
7
+ data.tar.gz: b72e8249710b3a40344c15aae8d6729eac09ce9cb7f301564ba2baee653620eee14fd9bc45a06c44994c3a95e1d2fbe27ce5dce23b921edb2e50201e6fc9b9b1
data/README.md CHANGED
@@ -81,8 +81,9 @@ Your config file should be called .test_rail.yaml, and should look like this:
81
81
  project: 'MyProjectName'
82
82
  suite: 'MySuite'
83
83
  run_name: 'RunName' or run_id: '1234'
84
+ plan_name: 'PlanName'
84
85
 
85
- Note: Above parameters can also be set through environment as TESTRAIL_#{PARAMETER} instead of config file.
86
+ Note: Above parameters can also be set through environment as TESTRAIL_#{PARAMETER} instead of config file. `plan_name` is optional.
86
87
 
87
88
  ### Testmine
88
89
 
@@ -10,7 +10,7 @@ module Res
10
10
  attr_accessor :ir, :case_status, :config, :project, :suite
11
11
  def initialize(args)
12
12
  @url = args[:url]
13
- @config = Res::Config.new([:user, :password, :namespace, :project, :suite], :optional => [:run_id, :run_name], :pre_env => 'testrail_')
13
+ @config = Res::Config.new([:user, :password, :namespace, :project, :suite], :optional => [:plan_name, :run_id, :run_name], :pre_env => 'testrail_')
14
14
  config.process(args)
15
15
 
16
16
  @case_status = {}
@@ -53,13 +53,20 @@ module Res
53
53
  sync_tests(ir) if !@synced
54
54
  suite = @project.find_suite(:name => @suite_name)
55
55
 
56
+ plan_name = @config.plan_name || args[:plan_name] || nil
56
57
  run_name = @config.run_name || args[:run_name] || nil
57
58
  run_id = @config.run_id || args[:run_id] || nil
58
-
59
+
59
60
  if !run_name.nil?
60
61
  run_name = @config.run_name
61
62
  @io.puts "> Created new run with name #{run_name}"
62
- run_id = @tr.add_run( :project_id => @project.id, :name => run_name, :description => args[:run_description], :suite_id => suite.id ).id
63
+
64
+ if plan_name
65
+ plan = @project.find_or_create_plan(:name => plan_name, :id => @project.id)
66
+ run_id = @tr.add_run_in_plan(:project_id => @project.id, :plan_id => plan.id, :name => run_name, :description => args[:run_description], :suite_id => suite.id).id
67
+ else
68
+ run_id = @tr.add_run( :project_id => @project.id, :name => run_name, :description => args[:run_description], :suite_id => suite.id ).id
69
+ end
63
70
  @io.puts "> Created new run: #{run_id}"
64
71
 
65
72
  elsif !run_id.nil?
data/lib/res/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Res
2
- VERSION = '1.2.20'
2
+ VERSION = '1.2.21'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: res
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.20
4
+ version: 1.2.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-03-01 00:00:00.000000000 Z
13
+ date: 2017-04-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.4'
35
+ version: 0.4.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.4'
42
+ version: 0.4.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: ox
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +103,6 @@ files:
103
103
  - lib/res/parsers/android_junit.rb
104
104
  - lib/res/parsers/junit.rb
105
105
  - lib/res/parsers/junitcasper.rb
106
- - lib/res/parsers/xcpretty.rb
107
106
  - lib/res/reporters/hive.rb
108
107
  - lib/res/reporters/lion.rb
109
108
  - lib/res/reporters/test_rail.rb
@@ -1,40 +0,0 @@
1
- require 'res/ir'
2
-
3
- module Res
4
- module Parsers
5
- class Xcpretty
6
-
7
- def initialize instrument_output
8
- File.write('./instruments.res',
9
- ::Res::IR.new( type: 'XCPrettyRunner',
10
- started: '',
11
- finished: Time.now,
12
- results: parse(instrument_output)
13
- ).json)
14
- end
15
-
16
- def parse output
17
- result = [
18
- {
19
- type: 'XCPretty',
20
- name: 'XCPretty',
21
- children: Array.new
22
- }
23
- ]
24
-
25
- File.open(output) do |f|
26
- f.each_line do |line|
27
- if line.match('\s*✓ (\S+) ')
28
- result.last[:children] << {
29
- type: 'Xcpretty::Test',
30
- name: Regexp.last_match[0].strip,
31
- status: 'passed'
32
- }
33
- end
34
- end
35
- end
36
- result
37
- end
38
- end
39
- end
40
- end