geordi 9.5.0 → 9.5.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: ed94a4f4c3730adc498969884b6019bc690f7348404d87681741a368fad3d9d4
4
- data.tar.gz: 71be7102e51bde905e8ce266e024642ddce03007cada78eaff3f56bb1a604391
3
+ metadata.gz: 506036483e1c31f8fab13388d6f92168227df95506f56ce5e28241f9ef867fc1
4
+ data.tar.gz: 85ef8a779e3e699865d0eb3f589fd252dd345771946daaed057e3615fcca1ca5
5
5
  SHA512:
6
- metadata.gz: 829799256546ace81d2e17cb6dcb194aafcb4060cdcb65b337a0d4811967a616fcced13e93337291bde7aa052b6d8b7e08cf07e2984e23a5dd1aa80843014030
7
- data.tar.gz: a88924470f394329db5f1cff666e2df6b3b2004eba892a9623c741aaa1de7e28dc705953c14cd88a83da5893aadd1f68e0152d11cd695c298690b78a77f42143
6
+ metadata.gz: fb8e5d65caf516ff4a4a5da1655ba5cf8001d8d0c875b68908e39e993dfbde7a3cdb4b887318192cb5bf22f5e2555a5d7796061c72fb2cf745c23c87a71c2ade
7
+ data.tar.gz: 9ddb734143d4162be8e6cf053f7b9aa35f7c72c69558caedcdb4ed9021b6c16b1bfd3ee84d6c13ad089b4af154d0bd0a197873355ab0dafaebc26710150f38d4
data/CHANGELOG.md CHANGED
@@ -10,6 +10,13 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
10
10
  ### Breaking changes
11
11
 
12
12
 
13
+ # 9.5.1 - 2023-04-26
14
+
15
+ ### Compatible changes
16
+
17
+ * `cucumber` command: Support the passing of options without "="
18
+
19
+
13
20
  # 9.5.0 2023-03-22
14
21
 
15
22
  ### Compatible changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (9.5.0)
4
+ geordi (9.5.1)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
data/geordi.gemspec CHANGED
@@ -31,8 +31,4 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_runtime_dependency 'thor', '~> 1'
33
33
  # Development dependencies are defined in the Gemfile (therefore no `spec.add_development_dependency` directives)
34
-
35
- spec.post_install_message = <<-ATTENTION
36
- Support for sequential running of integration tests tagged with @solo has been dropped.
37
- ATTENTION
38
34
  end
@@ -52,22 +52,21 @@ def cucumber(*args)
52
52
  invoke_geordi 'chromedriver_update', quiet_if_matching: true
53
53
  end
54
54
 
55
- cmd_opts, files = args.partition { |f| f.start_with? '-' }
56
- cmd_opts << '--format' << 'pretty' << '--backtrace' if options.debug
55
+ arguments = args
56
+ arguments << '--format' << 'pretty' << '--backtrace' if options.debug
57
57
 
58
58
  # Parallel run of all given features + reruns ##############################
59
59
  Interaction.announce 'Running features'
60
- normal_run_successful = Geordi::Cucumber.new.run(files, cmd_opts, verbose: options.verbose)
60
+ normal_run_successful = Geordi::Cucumber.new.run(arguments, verbose: options.verbose)
61
61
 
62
62
  unless normal_run_successful
63
- cmd_opts << '--profile' << 'rerun'
64
-
63
+ arguments << '--profile' << 'rerun'
65
64
  # Reruns
66
65
  (options.rerun + 1).times do |i|
67
66
  Interaction.fail 'Features failed.' if i == options.rerun # All reruns done?
68
67
 
69
68
  Interaction.announce "Rerun ##{i + 1} of #{options.rerun}"
70
- break if Geordi::Cucumber.new.run([], cmd_opts, verbose: options.verbose, parallel: false)
69
+ break if Geordi::Cucumber.new.run(arguments, verbose: options.verbose, parallel: false)
71
70
  end
72
71
  end
73
72
 
@@ -8,11 +8,11 @@ with `db:migrate`.
8
8
  LONGDESC
9
9
 
10
10
  def migrate
11
- invoke_geordi 'bundle_install'
12
- invoke_geordi 'yarn_install'
13
- Interaction.announce 'Migrating'
14
-
15
11
  if File.directory?('db/migrate')
12
+ invoke_geordi 'bundle_install'
13
+ invoke_geordi 'yarn_install'
14
+ Interaction.announce 'Migrating'
15
+
16
16
  if Util.file_containing?('Gemfile', /parallel_tests/)
17
17
  Interaction.note 'Development and parallel test databases'
18
18
  puts
@@ -8,9 +8,14 @@ require File.expand_path('settings', __dir__)
8
8
 
9
9
  module Geordi
10
10
  class Cucumber
11
+ def run(arguments, options = {})
12
+ split_arguments = arguments.map { |arg| arg.split('=') }.flatten
13
+
14
+ self.argv = split_arguments.map do |arg|
15
+ # Ensure arguments containing white space are kept together
16
+ arg.match?(/\S\s\S/) ? %('#{arg}') : arg
17
+ end
11
18
 
12
- def run(files, cucumber_options, options = {})
13
- self.argv = files + cucumber_options.map { |option| option.split('=') }.flatten
14
19
  self.settings = Geordi::Settings.new
15
20
 
16
21
  consolidate_rerun_txt_files
@@ -32,24 +37,30 @@ module Geordi
32
37
  unless argv.include?('--format') || argv.include?('-f')
33
38
  format_args = spinner_available? ? ['--format', 'CucumberSpinner::CuriousProgressBarFormatter'] : ['--format', 'progress']
34
39
  end
40
+ if argv.include?('rerun')
41
+ drop_command_line_features!
42
+ end
35
43
  [ Util.binstub_or_fallback('cucumber'), format_args, escape_shell_args(argv)].flatten.compact.join(' ')
36
44
  end
37
45
 
38
46
  def parallel_execution_command
39
47
  Interaction.note 'Using parallel_tests'
40
- self.argv = argv - command_line_features
48
+ drop_command_line_features!
41
49
 
42
50
  type_arg = Util.gem_version('parallel_tests') > Gem::Version.new('0.7.0') ? 'cucumber' : 'features'
43
51
  features = features_to_run
44
52
  features = find_all_features_recursively('features') if features.empty?
45
-
46
53
  [
47
54
  'bundle exec parallel_test -t ' + type_arg,
48
- %(-o '#{command_line_options.join(' ')}'),
55
+ %(-o "#{command_line_options.join(' ')}"),
49
56
  "-- #{features.join(' ')}",
50
57
  ].compact.join(' ')
51
58
  end
52
59
 
60
+ def drop_command_line_features!
61
+ self.argv = argv - command_line_features
62
+ end
63
+
53
64
  def escape_shell_args(*args)
54
65
  args.flatten.collect do |arg|
55
66
  arg.gsub(/([\\ "])/) { |_match| "\\#{Regexp.last_match(1)}" }
@@ -57,8 +68,10 @@ module Geordi
57
68
  end
58
69
 
59
70
  def show_features_to_run
60
- if command_line_options.include? 'rerun'
71
+ if command_line_options.include?('rerun')
61
72
  Interaction.note 'Rerunning failed scenarios'
73
+ elsif command_line_tag_options.any?
74
+ Interaction.note "Only features matching tag option #{command_line_tag_options.join(',')}"
62
75
  elsif features_to_run.empty?
63
76
  Interaction.note 'All features in features/'
64
77
  else
@@ -111,6 +124,14 @@ module Geordi
111
124
  end
112
125
  end
113
126
 
127
+ def command_line_tag_options
128
+ [].tap do |tag_options|
129
+ command_line_options.each_cons(2) do |option, tags|
130
+ tag_options << tags if option =~ /--tags|-t/
131
+ end
132
+ end
133
+ end
134
+
114
135
  def consolidate_rerun_txt_files
115
136
  parallel_rerun_files = Dir.glob('parallel_rerun*.txt')
116
137
  unless parallel_rerun_files.empty?
@@ -103,7 +103,7 @@ module Geordi
103
103
  invalid_keys = settings.keys - allowed_keys
104
104
  unless invalid_keys.empty?
105
105
  Interaction.warn "Unknown settings in #{file}: #{invalid_keys.join(", ")}"
106
- Interaction.note "Supported settings in #{file} are: #{allowed_keys.join(", ")}"
106
+ puts "Supported settings in #{file} are: #{allowed_keys.join(", ")}"
107
107
  end
108
108
  end
109
109
 
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '9.5.0'.freeze
2
+ VERSION = '9.5.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.5.0
4
+ version: 9.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-22 00:00:00.000000000 Z
11
+ date: 2023-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -101,10 +101,7 @@ metadata:
101
101
  bug_tracker_uri: https://github.com/makandra/geordi/issues
102
102
  changelog_uri: https://github.com/makandra/geordi/blob/master/CHANGELOG.md
103
103
  rubygems_mfa_required: 'true'
104
- post_install_message: 'Support for sequential running of integration tests tagged
105
- with @solo has been dropped.
106
-
107
- '
104
+ post_install_message:
108
105
  rdoc_options: []
109
106
  require_paths:
110
107
  - lib
@@ -119,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
116
  - !ruby/object:Gem::Version
120
117
  version: '0'
121
118
  requirements: []
122
- rubygems_version: 3.1.6
119
+ rubygems_version: 3.2.32
123
120
  signing_key:
124
121
  specification_version: 4
125
122
  summary: Collection of command line tools we use in our daily work with Ruby, Rails