quarantine 2.2.0 → 2.2.1

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
  SHA256:
3
- metadata.gz: c846ed3cf614eecefab5610bfb5d693444099fe90b6b429e4c697c16a014e21b
4
- data.tar.gz: 5d17a24b4735f4c34af2d0902c0e3a7199750ce592694b5f9fe375928ada9d03
3
+ metadata.gz: 31ffed67bd1774918fd52c8bfe309398d43b8c218175f2a414725382df680ee7
4
+ data.tar.gz: aca3eab589422f555224ce2638e979aff7f6fc2f17d4b33ac91e2f0177d4fb9b
5
5
  SHA512:
6
- metadata.gz: cb20ce19d6581b4836486176a080a6204a66f93d609e2b76a5d7bb91886b97e07466026fe45d0d7d4c16b8d2f072212a4ff982f42c40a55d68f42413276a92c4
7
- data.tar.gz: bc093985a12b77f636d577b3fed3ab783f5fe206350a759a796097eee93976f42cb2fa199101a853f81d729aa109cce612f6deb4ba75748779281086e2591bca
6
+ metadata.gz: '0894a8c2561b741d3f9466d28e8424cde69ece0b7f228d700b485f748eb26531bd81ac549493a91641010ceb6b34eb1d7abbaf49475f4874d6f67db297d522ec'
7
+ data.tar.gz: 281ba613e8806b8d3f1e4318a65492435d971e0e89138cb87c44de2c7709a983672930e00cdfddb46bf245da4aa2e52804b2cf47d908fe9f0dd62eae3e7ac5fd
@@ -43,9 +43,8 @@ class Quarantine
43
43
  items.each do |item|
44
44
  cells = headers.map do |header|
45
45
  match = header.match(/^(extra_)?(.+)/)
46
- extra, name = match[1..]
47
- puts "header: #{header}, extra: #{extra}, name: #{name}"
48
- value = extra ? item['extra_attributes'][name.to_sym] : item[name]
46
+ extra, name = match[1..2]
47
+ value = extra ? item['extra_attributes'][name] : item[name]
49
48
  value.to_s
50
49
  end
51
50
  row_idx = indexes[item['id']]
@@ -109,12 +108,12 @@ class Quarantine
109
108
  rows.map do |row|
110
109
  hash_row = Hash[headers.zip(row)]
111
110
  # TODO: use Google Sheets developer metadata to store type information
112
- unless hash_row['id'].empty?
113
- extra_values, base_values = hash_row.partition{|k, v| k.start_with?('extra_')}
114
- base_hash = Hash[base_values]
115
- base_hash['extra_attributes'] = Hash[extra_values]
116
- base_hash
117
- end
111
+ next nil if hash_row['id'].empty?
112
+
113
+ extra_values, base_values = hash_row.partition { |k, _v| k.start_with?('extra_') }
114
+ base_hash = Hash[base_values]
115
+ base_hash['extra_attributes'] = Hash[extra_values]
116
+ base_hash
118
117
  end.compact
119
118
  end
120
119
  end
@@ -88,15 +88,15 @@ class Quarantine
88
88
  end
89
89
  end
90
90
  # The example failed, but it's not the final retry yet, so return nil.
91
- return nil
91
+ return nil # rubocop:disable Style/RedundantReturn
92
92
  elsif metadata[:retry_attempts] > 0
93
93
  # The example passed this time, but failed one or more times before - the definition of a flaky test.
94
- return [:quarantined, false]
94
+ return [:quarantined, false] # rubocop:disable Style/RedundantReturn
95
95
  elsif previously_quarantined
96
96
  # The example passed the first time, but it's already marked quarantined, so keep it that way.
97
- return [:quarantined, true]
97
+ return [:quarantined, true] # rubocop:disable Style/RedundantReturn
98
98
  else
99
- return [:passing, true]
99
+ return [:passing, true] # rubocop:disable Style/RedundantReturn
100
100
  end
101
101
  end
102
102
 
@@ -1,3 +1,3 @@
1
1
  class Quarantine
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quarantine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flexport Engineering, Eric Zhu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-17 00:00:00.000000000 Z
11
+ date: 2021-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec