parallel_report_portal 2.0.1 → 2.1.1

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: 4e7791266b8182c87f0456af3f5a473d9757290a0d7c753753db088413aec9d5
4
- data.tar.gz: c96a4e60af404fc80d9fa8427b2cc6dd1080871f1cdc9873c3834d0c7f3b59f2
3
+ metadata.gz: 10a0ede4e1da6f5fc4788775483996e7ecf4a21009b06bfbbec5b49593c623bc
4
+ data.tar.gz: 8a0f3966ac4134f96e4a18e42e4b779943425d5d7cf9947dfc6afa10ee376859
5
5
  SHA512:
6
- metadata.gz: a2ce25379d17872648ce74db6b68f12d4e799d0c18b2eccf03d49a0ee8b14a9ecd7d30f02652667598687f26afa03d2c138ceb2988ac461ce223465019d2f91c
7
- data.tar.gz: 91ad9f32747f427aefc47d29f751efd422fb300836fe054b6bb5e7965ffa430b272eb928d6661b490efecba2b3916262f57c81477a1fb9a5685936148c595af9
6
+ metadata.gz: 380772393a3450a86df43444caa69e09b93d5b9b88a66ea658adc0baac40b064fe74e299cdec0dbf99c299a295c2d550914040ae87a65d82458c801e9f94ca2d
7
+ data.tar.gz: 5950fe72eb47bf2c195621d94faac14cfbb7a17b73aeae16f02a952b01a475f86e6a0901a8113ad7f00dd9d5081f5b162fd51266424cf5b7d6070b65162d3a5c
@@ -0,0 +1,28 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on: [push]
11
+
12
+ jobs:
13
+ test:
14
+
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ ruby-version: ['2.6', '2.7', '3.0']
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+ - name: Set up Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby-version }}
26
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
27
+ - name: Run tests
28
+ run: bundle exec rake
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This gem is a Ruby-Cucumber formatter which sends the test output to [Report Portal](https://reportportal.io).
4
4
 
5
- This formatter supports plain 'ol Cucumber tests and those wrapped with [parallel_tests](https://rubygems.org/gems/parallel_tests).
5
+ This formatter supports plain 'ol Cucumber tests and those wrapped with [parallel_tests](https://rubygems.org/gems/parallel_tests).
6
6
 
7
7
  It also supports Cucumber 3.x and 4+ (Cucumber implementations using cucumber-messages).
8
8
 
@@ -30,20 +30,30 @@ The formatter supports configuration via a config file or via environment variab
30
30
 
31
31
  #### Configuration file
32
32
 
33
- It will search for a file called `report_portal.yml` or `REPORT_PORTAL.YML` in `./config` and `./`. It expects this file to contain the standard Report Portal configuration options -- see the Report Portal documentation.
33
+ It will search for a file called `report_portal.yml` or `REPORT_PORTAL.YML` in `./config` and `./`. It expects this file to contain the standard Report Portal configuration options -- see the Report Portal documentation. Optionally, the config file keys may match those accepted through environment variables -- they may contain 'rp*' and 'RP*'.
34
+
35
+ #### Configurable Timeouts
36
+
37
+ When running in parallel you might encounter some connection timeouts and these have been made configurable. You can configure the Report Portal yaml file with these attributes and set your own custom timeout values.
38
+
39
+ ```yaml
40
+ idle_timeout: 100
41
+ open_timeout: 60
42
+ read_timeout: 60
43
+ ```
34
44
 
35
45
  #### Environment variables
36
46
 
37
47
  It will search for the following environment variables which may be in upper or lowercase (the official client defers to lower case, this is available here for compatibility).
38
48
 
39
- * `RP_UUID` - the user's UUID for this Report Portal instance which must be created in advance
40
- * `RP_ENDPOINT` - the endpoint for this Report Portal instance
41
- * `RP_PROJECT` - the Report Portal project name which must be created in advance and this user added as a member
42
- * `RP_LAUNCH` - the name of this 'launch'
43
- * `RP_DEBUG` - *optional* if set to the string value `true` it will instruct Report Portal to add the output of these tests to the debug tab
44
- * `RP_DESCRIPTION` - *optional* a textual description of the launch
45
- * `RP_TAGS` - *optional* a string of comma separated tags
46
- * `RP_ATTRIBUTES` - *optional* a string of comma separated attributes
49
+ - `RP_UUID` - the user's UUID for this Report Portal instance which must be created in advance
50
+ - `RP_ENDPOINT` - the endpoint for this Report Portal instance
51
+ - `RP_PROJECT` - the Report Portal project name which must be created in advance and this user added as a member
52
+ - `RP_LAUNCH` - the name of this 'launch'
53
+ - `RP_DEBUG` - _optional_ if set to the string value `true` it will instruct Report Portal to add the output of these tests to the debug tab
54
+ - `RP_DESCRIPTION` - _optional_ a textual description of the launch
55
+ - `RP_TAGS` - _optional_ a string of comma separated tags
56
+ - `RP_ATTRIBUTES` - _optional_ a string of comma separated attributes
47
57
 
48
58
  ### With cucumber
49
59
 
@@ -61,9 +71,7 @@ cucumber -f ParallelReportPortal::Cucumber::Formatter --out /dev/null -f progres
61
71
 
62
72
  ```
63
73
  parallel_cucumber -- -f ParallelReportPortal::Cucumber::Formatter -- features/
64
- ```
65
-
66
-
74
+ ```
67
75
 
68
76
  ## Development
69
77
 
@@ -22,7 +22,7 @@ module ParallelReportPortal
22
22
  # RP_TAGS:: A set of tags to pass to Report Portal for this launch. If these are set via an environment variable, provide a comma-separated string of tags
23
23
  # RP_ATTRIBUTES:: A set of attribute tags to pass to Report Portal for this launch. If these are set via an environment variable, provide a comma-separated string of attributes
24
24
  class Configuration
25
- ATTRIBUTES = [:uuid, :endpoint, :project, :launch, :debug, :description, :tags, :attributes]
25
+ ATTRIBUTES = [:uuid, :endpoint, :project, :launch, :debug, :description, :tags, :attributes, :open_timeout, :idle_timeout, :read_timeout]
26
26
 
27
27
  # @return [String] the Report Portal user UUID
28
28
  attr_accessor :uuid
@@ -45,10 +45,16 @@ module ParallelReportPortal
45
45
  # @return [Array<String>] an array of attributes to attach to this launch
46
46
  # (Report Portal 5)
47
47
  attr_reader :attributes
48
-
48
+ # @return [Integer] the number of seconds for the open connection to timeout
49
+ attr_accessor :open_timeout
50
+ # @return [Integer] the number of seconds for the open and idle connection to timeout
51
+ attr_accessor :idle_timeout
52
+ # @return [Integer] the number of seconds for the read connection to timeout
53
+ attr_accessor :read_timeout
54
+
49
55
 
50
56
  # Create an instance of Configuration.
51
- #
57
+ #
52
58
  # The initializer will first attempt to load a configuration files called
53
59
  # +report_portal.yml+ (case insensitive) in the both the +config+ and current
54
60
  # working directory (the former takes precidence). It will then apply
@@ -64,18 +70,18 @@ module ParallelReportPortal
64
70
  # Sets the tags for the launch. If an array is provided, the array is used,
65
71
  # if a string is provided, the string is broken into components by splitting
66
72
  # on a comma.
67
- #
73
+ #
68
74
  # e.g.
69
75
  # configuration.tags="one,two, three"
70
76
  # #=> ["one", "two", "three"]
71
- #
77
+ #
72
78
  # param [String | Array<String>] taglist a list of tags to set
73
79
  def tags=(taglist)
74
80
  if taglist.is_a?(String)
75
81
  @tags = taglist.split(',').map(&:strip)
76
82
  elsif taglist.is_a?(Array)
77
83
  @tags = taglist
78
- else
84
+ else
79
85
  @tags = []
80
86
  end
81
87
  tags
@@ -84,7 +90,7 @@ module ParallelReportPortal
84
90
 
85
91
  # Enables the debug flag which is sent to Report Portal. If this flag is set
86
92
  # Report Portal will include this launch in its 'debug' tab.
87
- #
93
+ #
88
94
  # param [Boolean | String] value if the value is a Boolean, it will take that value
89
95
  # if it is a String, it will set values of 'true' to +true+, else all values will be false.
90
96
  def debug=(value)
@@ -95,21 +101,27 @@ module ParallelReportPortal
95
101
  end
96
102
  end
97
103
 
104
+ # Simple method to obtain an attribute from this class or set default value
105
+ # param [symbol] a symbol version of the attribute
106
+ def fetch(key, default_value)
107
+ self.send(key).nil? ? default_value : self.send(key)
108
+ end
109
+
98
110
  # Sets the attributes for the launch. If an array is provided, the array is used,
99
111
  # if a string is provided, the string is broken into components by splitting
100
112
  # on a comma.
101
- #
113
+ #
102
114
  # e.g.
103
115
  # configuration.tags="one,two, three"
104
116
  # #=> ["one", "two", "three"]
105
- #
117
+ #
106
118
  # param [String | Array<String>] taglist a list of tags to set
107
119
  def attributes=(attrlist)
108
120
  if attrlist.is_a?(String)
109
121
  @attributes = attrlist.split(',').map(&:strip)
110
122
  elsif attrlist.is_a?(Array)
111
123
  @attributes = attrlist
112
- else
124
+ else
113
125
  @attributes = []
114
126
  end
115
127
  attributes
@@ -129,10 +141,18 @@ module ParallelReportPortal
129
141
  .then { |fn| fn ? File.read(fn) : '' }
130
142
  .then { |ys| YAML.safe_load(ys, symbolize_names: true) }
131
143
  .then do |yaml|
144
+ if yaml
145
+ yaml.transform_keys! { |key| key.downcase }
132
146
  ATTRIBUTES.each do |attr|
133
- send(:"#{attr}=", yaml[attr]) if yaml&.fetch(attr, nil)
147
+ yaml_key = if yaml.has_key?("rp_#{attr}".to_sym)
148
+ "rp_#{attr}".to_sym
149
+ else
150
+ attr
151
+ end
152
+ send(:"#{attr}=", yaml[yaml_key]) if yaml.fetch(yaml_key, nil)
134
153
  end
135
154
  end
155
+ end
136
156
  end
137
157
  end
138
158
  end
@@ -175,7 +175,12 @@ module ParallelReportPortal
175
175
 
176
176
  def lookup_test_case(test_case)
177
177
  if using_cucumber_messages?
178
- @ast_lookup.scenario_source(test_case).scenario
178
+ sc = @ast_lookup.scenario_source(test_case)
179
+ if sc.respond_to?(:scenario)
180
+ @ast_lookup.scenario_source(test_case).scenario
181
+ else
182
+ @ast_lookup.scenario_source(test_case).scenario_outline
183
+ end
179
184
  else
180
185
  test_case
181
186
  end
@@ -39,7 +39,9 @@ module ParallelReportPortal
39
39
  }
40
40
  ) do |f|
41
41
  f.adapter :net_http_persistent, pool_size: 5 do |http|
42
- http.idle_timeout = 100
42
+ http.idle_timeout = ParallelReportPortal.configuration.fetch(:idle_timeout, 100)
43
+ http.open_timeout = ParallelReportPortal.configuration.fetch(:open_timeout, 60)
44
+ http.read_timeout = ParallelReportPortal.configuration.fetch(:read_timeout, 60)
43
45
  end
44
46
  end
45
47
  end
@@ -60,7 +62,9 @@ module ParallelReportPortal
60
62
  conn.request :url_encoded
61
63
  conn.adapter :net_http_persistent, pool_size: 5 do |http|
62
64
  # yields Net::HTTP::Persistent
63
- http.idle_timeout = 100
65
+ http.idle_timeout = ParallelReportPortal.configuration.fetch(:idle_timeout, 100)
66
+ http.open_timeout = ParallelReportPortal.configuration.fetch(:open_timeout, 60)
67
+ http.read_timeout = ParallelReportPortal.configuration.fetch(:read_timeout, 60)
64
68
  end
65
69
  end
66
70
  end
@@ -162,7 +166,7 @@ module ParallelReportPortal
162
166
  name: "#{keyword}: #{test_case.name}",
163
167
  type: 'STEP',
164
168
  launch_id: launch_id,
165
- description: test_case.location.to_s,
169
+ description: test_case.description,
166
170
  attributes: test_case.tags.map(&:name)
167
171
  }.to_json
168
172
  end
@@ -1,3 +1,3 @@
1
1
  module ParallelReportPortal
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_report_portal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-05-11 00:00:00.000000000 Z
12
+ date: 2022-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal
@@ -187,12 +187,11 @@ executables: []
187
187
  extensions: []
188
188
  extra_rdoc_files: []
189
189
  files:
190
- - ".drone.yml"
190
+ - ".github/workflows/tests.yml"
191
191
  - ".gitignore"
192
192
  - ".rspec"
193
193
  - Appraisals
194
194
  - Gemfile
195
- - Gemfile.lock
196
195
  - LICENSE.txt
197
196
  - ParallelReportPortal.drawio
198
197
  - README.md
@@ -235,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
234
  - !ruby/object:Gem::Version
236
235
  version: '0'
237
236
  requirements: []
238
- rubygems_version: 3.1.4
237
+ rubygems_version: 3.2.3
239
238
  signing_key:
240
239
  specification_version: 4
241
240
  summary: Run Cucumber Tests in parallel and with Cucumber 3 and 4+
data/.drone.yml DELETED
@@ -1,21 +0,0 @@
1
- kind: pipeline
2
- name: default
3
-
4
- platform:
5
- os: linux
6
- arch: amd64
7
-
8
- steps:
9
- - name: Build & Publish
10
- pull: if-not-exists
11
- image: 714782054810.dkr.ecr.eu-west-2.amazonaws.com/base-images/qe-ruby:2.7.0
12
- commands:
13
- - apk add --update git --update alpine-sdk --no-cache
14
- - gem install bundler
15
- - bundle
16
- - gem install nexus
17
- - gem build parallel_report_portal.gemspec
18
- - gem nexus --url https://nexus.tooling.dvla.gov.uk/repository/gem-private/ parallel_report_portal*gem
19
- when:
20
- branch:
21
- - master
data/Gemfile.lock DELETED
@@ -1,148 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- parallel_report_portal (2.0.1)
5
- cucumber (>= 3.2)
6
- faraday (~> 1.0)
7
- net-http-persistent (~> 4.0)
8
- parallel_tests (>= 2.29.1)
9
- rubytree (~> 1.0)
10
-
11
- GEM
12
- remote: https://rubygems.org/
13
- specs:
14
- activesupport (6.1.3.2)
15
- concurrent-ruby (~> 1.0, >= 1.0.2)
16
- i18n (>= 1.6, < 2)
17
- minitest (>= 5.1)
18
- tzinfo (~> 2.0)
19
- zeitwerk (~> 2.3)
20
- addressable (2.7.0)
21
- public_suffix (>= 2.0.2, < 5.0)
22
- appraisal (2.4.0)
23
- bundler
24
- rake
25
- thor (>= 0.14.0)
26
- builder (3.2.4)
27
- bump (0.10.0)
28
- coderay (1.1.3)
29
- concurrent-ruby (1.1.8)
30
- connection_pool (2.2.5)
31
- crack (0.4.5)
32
- rexml
33
- cucumber (6.0.0)
34
- builder (~> 3.2, >= 3.2.4)
35
- cucumber-core (~> 9.0, >= 9.0.0)
36
- cucumber-create-meta (~> 4.0, >= 4.0.0)
37
- cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
38
- cucumber-gherkin (~> 18.1, >= 18.1.0)
39
- cucumber-html-formatter (~> 13.0, >= 13.0.0)
40
- cucumber-messages (~> 15.0, >= 15.0.0)
41
- cucumber-wire (~> 5.0, >= 5.0.0)
42
- diff-lcs (~> 1.4, >= 1.4.4)
43
- mime-types (~> 3.3, >= 3.3.1)
44
- multi_test (~> 0.1, >= 0.1.2)
45
- sys-uname (~> 1.2, >= 1.2.2)
46
- cucumber-core (9.0.0)
47
- cucumber-gherkin (~> 18.1, >= 18.1.0)
48
- cucumber-messages (~> 15.0, >= 15.0.0)
49
- cucumber-tag-expressions (~> 3.0, >= 3.0.1)
50
- cucumber-create-meta (4.0.0)
51
- cucumber-messages (~> 15.0, >= 15.0.0)
52
- sys-uname (~> 1.2, >= 1.2.2)
53
- cucumber-cucumber-expressions (12.1.1)
54
- cucumber-gherkin (18.1.1)
55
- cucumber-messages (~> 15.0, >= 15.0.0)
56
- cucumber-html-formatter (13.0.0)
57
- cucumber-messages (~> 15.0, >= 15.0.0)
58
- cucumber-messages (15.0.0)
59
- protobuf-cucumber (~> 3.10, >= 3.10.8)
60
- cucumber-tag-expressions (3.0.1)
61
- cucumber-wire (5.0.0)
62
- cucumber-core (~> 9.0, >= 9.0.0)
63
- cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
64
- cucumber-messages (~> 15.0, >= 15.0.0)
65
- diff-lcs (1.4.4)
66
- faraday (1.4.1)
67
- faraday-excon (~> 1.1)
68
- faraday-net_http (~> 1.0)
69
- faraday-net_http_persistent (~> 1.1)
70
- multipart-post (>= 1.2, < 3)
71
- ruby2_keywords (>= 0.0.4)
72
- faraday-excon (1.1.0)
73
- faraday-net_http (1.0.1)
74
- faraday-net_http_persistent (1.1.0)
75
- ffi (1.15.0)
76
- hashdiff (1.0.1)
77
- i18n (1.8.10)
78
- concurrent-ruby (~> 1.0)
79
- json (2.5.1)
80
- method_source (1.0.0)
81
- middleware (0.1.0)
82
- mime-types (3.3.1)
83
- mime-types-data (~> 3.2015)
84
- mime-types-data (3.2021.0225)
85
- minitest (5.14.4)
86
- multi_test (0.1.2)
87
- multipart-post (2.1.1)
88
- net-http-persistent (4.0.1)
89
- connection_pool (~> 2.2)
90
- parallel (1.20.1)
91
- parallel_tests (3.7.0)
92
- parallel
93
- protobuf-cucumber (3.10.8)
94
- activesupport (>= 3.2)
95
- middleware
96
- thor
97
- thread_safe
98
- pry (0.14.1)
99
- coderay (~> 1.1)
100
- method_source (~> 1.0)
101
- public_suffix (4.0.6)
102
- rake (10.5.0)
103
- rexml (3.2.5)
104
- rspec (3.10.0)
105
- rspec-core (~> 3.10.0)
106
- rspec-expectations (~> 3.10.0)
107
- rspec-mocks (~> 3.10.0)
108
- rspec-core (3.10.1)
109
- rspec-support (~> 3.10.0)
110
- rspec-expectations (3.10.1)
111
- diff-lcs (>= 1.2.0, < 2.0)
112
- rspec-support (~> 3.10.0)
113
- rspec-mocks (3.10.2)
114
- diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.10.0)
116
- rspec-support (3.10.2)
117
- ruby2_keywords (0.0.4)
118
- rubytree (1.0.0)
119
- json (~> 2.1)
120
- structured_warnings (~> 0.3)
121
- structured_warnings (0.4.0)
122
- sys-uname (1.2.2)
123
- ffi (~> 1.1)
124
- thor (1.1.0)
125
- thread_safe (0.3.6)
126
- tzinfo (2.0.4)
127
- concurrent-ruby (~> 1.0)
128
- webmock (3.12.2)
129
- addressable (>= 2.3.6)
130
- crack (>= 0.3.2)
131
- hashdiff (>= 0.4.0, < 2.0.0)
132
- zeitwerk (2.4.2)
133
-
134
- PLATFORMS
135
- ruby
136
-
137
- DEPENDENCIES
138
- appraisal (~> 2.4)
139
- bump (~> 0.8)
140
- bundler (~> 2.0)
141
- parallel_report_portal!
142
- pry (~> 0.12)
143
- rake (~> 10.0)
144
- rspec (~> 3.0)
145
- webmock (~> 3.12)
146
-
147
- BUNDLED WITH
148
- 2.1.4