geordi 9.5.0 → 9.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/geordi.gemspec +0 -4
- data/lib/geordi/COMMAND_TEMPLATE +5 -0
- data/lib/geordi/cli.rb +1 -0
- data/lib/geordi/commands/branch.rb +5 -0
- data/lib/geordi/commands/capistrano.rb +1 -1
- data/lib/geordi/commands/clean.rb +4 -0
- data/lib/geordi/commands/commit.rb +4 -0
- data/lib/geordi/commands/console.rb +5 -0
- data/lib/geordi/commands/cucumber.rb +12 -6
- data/lib/geordi/commands/delete_dumps.rb +5 -0
- data/lib/geordi/commands/deploy.rb +5 -0
- data/lib/geordi/commands/drop_databases.rb +4 -0
- data/lib/geordi/commands/dump.rb +7 -0
- data/lib/geordi/commands/migrate.rb +4 -4
- data/lib/geordi/commands/rake.rb +4 -0
- data/lib/geordi/commands/remove_executable_flags.rb +4 -0
- data/lib/geordi/commands/rspec.rb +4 -0
- data/lib/geordi/commands/server.rb +4 -0
- data/lib/geordi/commands/setup.rb +4 -0
- data/lib/geordi/commands/shell.rb +4 -0
- data/lib/geordi/commands/tests.rb +4 -0
- data/lib/geordi/commands/update.rb +5 -0
- data/lib/geordi/cucumber.rb +27 -6
- data/lib/geordi/hint.rb +48 -0
- data/lib/geordi/settings.rb +6 -2
- data/lib/geordi/version.rb +1 -1
- metadata +5 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c01ad424ea8f33ca03229ba4d0355201bba562ee1de253f0135838b8e4163c3
|
4
|
+
data.tar.gz: 8d011dfa82297202b05c8620a95e828ba96dcb797fcef6dc60d514e881601cd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f691c5367a2f41937703e18dda5be92f69a4bac77cb31f5c89429156576126675f1c4dd00b84d3eecb1dda328c45fd81eb92cf36c9fd2b8d5689b9c37587ff
|
7
|
+
data.tar.gz: d25a7208ab06766bda59c11d0d1c4a331ee17b8ac2f60d9de82f608759b942c3d067db7d7984929a90ba43775b7772f0b424771489b9f440e711033c955dc9c1
|
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
data/README.md
CHANGED
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
|
data/lib/geordi/COMMAND_TEMPLATE
CHANGED
@@ -26,6 +26,11 @@ def example
|
|
26
26
|
Interaction.fail 'Option missing' unless options.opt?
|
27
27
|
|
28
28
|
Interaction.success 'Done.'
|
29
|
+
Hint.did_you_know [
|
30
|
+
:update, # recommendation of another command
|
31
|
+
[:cucumber, :containing], # recommendation of another option
|
32
|
+
'Geordi can automatically update chromedriver before Cucumber tests. See `geordi help chromedriver-update`.', # prose
|
33
|
+
]
|
29
34
|
end
|
30
35
|
|
31
36
|
# Command mappings, usually not needed
|
data/lib/geordi/cli.rb
CHANGED
@@ -15,6 +15,11 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
15
15
|
def console(target = 'development', *_args)
|
16
16
|
require 'geordi/remote'
|
17
17
|
|
18
|
+
Hint.did_you_know [
|
19
|
+
:shelll,
|
20
|
+
[:console, :select_server],
|
21
|
+
]
|
22
|
+
|
18
23
|
if target == 'development'
|
19
24
|
invoke_geordi 'bundle_install'
|
20
25
|
invoke_geordi 'yarn_install'
|
@@ -52,27 +52,33 @@ def cucumber(*args)
|
|
52
52
|
invoke_geordi 'chromedriver_update', quiet_if_matching: true
|
53
53
|
end
|
54
54
|
|
55
|
-
|
56
|
-
|
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(
|
60
|
+
normal_run_successful = Geordi::Cucumber.new.run(arguments, verbose: options.verbose)
|
61
61
|
|
62
62
|
unless normal_run_successful
|
63
|
-
|
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(
|
69
|
+
break if Geordi::Cucumber.new.run(arguments, verbose: options.verbose, parallel: false)
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
74
73
|
Interaction.success 'Features green.'
|
75
74
|
|
75
|
+
Hint.did_you_know [
|
76
|
+
:rspec,
|
77
|
+
[:cucumber, :modified],
|
78
|
+
[:cucumber, :containing],
|
79
|
+
[:cucumber, :debug],
|
80
|
+
'Geordi can automatically update chromedriver before Cucumber tests. See `geordi help chromedriver-update`.'
|
81
|
+
]
|
76
82
|
else
|
77
83
|
Interaction.note 'Cucumber not employed.'
|
78
84
|
end
|
@@ -108,6 +108,11 @@ def deploy(target_stage = nil)
|
|
108
108
|
Util.run!(capistrano_call, show_cmd: true)
|
109
109
|
|
110
110
|
Interaction.success 'Deployment complete.'
|
111
|
+
|
112
|
+
Hint.did_you_know [
|
113
|
+
:capistrano,
|
114
|
+
:security_update
|
115
|
+
]
|
111
116
|
else
|
112
117
|
Util.run!("git checkout #{source_branch}")
|
113
118
|
Interaction.fail 'Deployment cancelled.'
|
data/lib/geordi/commands/dump.rb
CHANGED
@@ -68,4 +68,11 @@ def dump(target = nil, *_args)
|
|
68
68
|
Interaction.success "Your #{loader.config['database']} database has now the data of #{target}#{database_label}."
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
Hint.did_you_know [
|
73
|
+
:delete_dumps,
|
74
|
+
:drop_databases,
|
75
|
+
:migrate,
|
76
|
+
'Geordi can load a dump directly into the local database if passed a Capistrano stage and the option -l. See `geordi help dump`.'
|
77
|
+
]
|
71
78
|
end
|
@@ -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
|
data/lib/geordi/commands/rake.rb
CHANGED
@@ -6,6 +6,10 @@ option :public, aliases: '-P', type: :boolean,
|
|
6
6
|
desc: 'Make the server accessible from the local network'
|
7
7
|
|
8
8
|
def server(port = nil)
|
9
|
+
Hint.did_you_know [
|
10
|
+
[:server, :public]
|
11
|
+
]
|
12
|
+
|
9
13
|
invoke_geordi 'bundle_install'
|
10
14
|
invoke_geordi 'yarn_install'
|
11
15
|
require 'geordi/util'
|
@@ -27,6 +27,10 @@ def setup
|
|
27
27
|
|
28
28
|
Interaction.success 'Successfully set up the project.'
|
29
29
|
|
30
|
+
Hint.did_you_know [
|
31
|
+
:update
|
32
|
+
] unless options.dump || options.test
|
33
|
+
|
30
34
|
invoke_geordi 'dump', options.dump, load: true if options.dump
|
31
35
|
invoke_geordi 'tests' if options.test
|
32
36
|
end
|
@@ -15,6 +15,10 @@ option :select_server, type: :string, aliases: '-s', banner: '[SERVER_NUMBER]',
|
|
15
15
|
def shelll(target, *_args)
|
16
16
|
require 'geordi/remote'
|
17
17
|
|
18
|
+
Hint.did_you_know [
|
19
|
+
:console
|
20
|
+
]
|
21
|
+
|
18
22
|
Interaction.announce 'Opening a shell on ' + target
|
19
23
|
Geordi::Remote.new(target).shell(options)
|
20
24
|
end
|
@@ -27,7 +27,12 @@ def update
|
|
27
27
|
|
28
28
|
Interaction.success 'Successfully updated the project.'
|
29
29
|
|
30
|
+
Hint.did_you_know [
|
31
|
+
:setup
|
32
|
+
] unless options.dump || options.test
|
33
|
+
|
30
34
|
invoke_geordi 'dump', options.dump, load: true if options.dump
|
31
35
|
invoke_geordi 'tests' if options.test
|
32
36
|
end
|
37
|
+
|
33
38
|
end
|
data/lib/geordi/cucumber.rb
CHANGED
@@ -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
|
-
|
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
|
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?
|
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?
|
data/lib/geordi/hint.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Use the methods in this file to hint at other geordi features
|
2
|
+
require File.expand_path('settings', __dir__)
|
3
|
+
|
4
|
+
module Geordi
|
5
|
+
class Hint
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def did_you_know(hints)
|
9
|
+
settings_probability = Settings.new.hint_probability
|
10
|
+
default_probability = (Util.testing? ? 0 : 10) # Percent
|
11
|
+
should_print_hint = Random.new.rand(100) <= (settings_probability || default_probability)
|
12
|
+
|
13
|
+
generated_hints = hints.map(&method(:generate))
|
14
|
+
if generated_hints.any? && should_print_hint
|
15
|
+
puts
|
16
|
+
puts generated_hints.sample
|
17
|
+
puts 'You can configure the probability for these hints by setting hint_probability to a unitless percent number in ~/.config/geordi/global.yml' unless settings_probability
|
18
|
+
end
|
19
|
+
|
20
|
+
generated_hints
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def generate(hint)
|
26
|
+
if hint.is_a?(Symbol)
|
27
|
+
command = Geordi::CLI.commands[hint.to_s]
|
28
|
+
description = downcase_first_letter(command.description)
|
29
|
+
"Did you know? `geordi #{command.name}` can #{description}."
|
30
|
+
elsif hint.is_a?(Array)
|
31
|
+
command = Geordi::CLI.commands[hint[0].to_s]
|
32
|
+
option = command.options[hint[1]]
|
33
|
+
banner = option.banner.nil? ? '' : " #{option.banner}"
|
34
|
+
description = downcase_first_letter(option.description)
|
35
|
+
"Did you know? `geordi #{command.name} #{option.aliases.first}#{banner}` can #{description}."
|
36
|
+
elsif hint.is_a?(String)
|
37
|
+
"Did you know? #{hint}"
|
38
|
+
else
|
39
|
+
raise "Unsupported hint input #{hint.inspect}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def downcase_first_letter(str)
|
44
|
+
str[0].downcase + str[1..-1]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/geordi/settings.rb
CHANGED
@@ -8,7 +8,7 @@ module Geordi
|
|
8
8
|
GLOBAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/global_settings.yml'.freeze : File.join(ENV['HOME'], '.config/geordi/global.yml').freeze
|
9
9
|
LOCAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/local_settings.yml'.freeze : './.geordi.yml'.freeze
|
10
10
|
|
11
|
-
ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key auto_update_chromedriver pivotal_tracker_project_ids git_initials].freeze
|
11
|
+
ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key auto_update_chromedriver pivotal_tracker_project_ids git_initials hint_probability ].freeze
|
12
12
|
ALLOWED_LOCAL_SETTINGS = %w[ pivotal_tracker_project_ids ].freeze
|
13
13
|
|
14
14
|
SETTINGS_WARNED = 'GEORDI_INVALID_SETTINGS_WARNED'
|
@@ -27,6 +27,10 @@ module Geordi
|
|
27
27
|
save_global_settings
|
28
28
|
end
|
29
29
|
|
30
|
+
def hint_probability
|
31
|
+
@global_settings['hint_probability']
|
32
|
+
end
|
33
|
+
|
30
34
|
def git_initials
|
31
35
|
@global_settings['git_initials']
|
32
36
|
end
|
@@ -103,7 +107,7 @@ module Geordi
|
|
103
107
|
invalid_keys = settings.keys - allowed_keys
|
104
108
|
unless invalid_keys.empty?
|
105
109
|
Interaction.warn "Unknown settings in #{file}: #{invalid_keys.join(", ")}"
|
106
|
-
|
110
|
+
puts "Supported settings in #{file} are: #{allowed_keys.join(", ")}"
|
107
111
|
end
|
108
112
|
end
|
109
113
|
|
data/lib/geordi/version.rb
CHANGED
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.
|
4
|
+
version: 9.6.0
|
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-
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/geordi/db_cleaner.rb
|
89
89
|
- lib/geordi/dump_loader.rb
|
90
90
|
- lib/geordi/gitpt.rb
|
91
|
+
- lib/geordi/hint.rb
|
91
92
|
- lib/geordi/interaction.rb
|
92
93
|
- lib/geordi/remote.rb
|
93
94
|
- lib/geordi/settings.rb
|
@@ -101,10 +102,7 @@ metadata:
|
|
101
102
|
bug_tracker_uri: https://github.com/makandra/geordi/issues
|
102
103
|
changelog_uri: https://github.com/makandra/geordi/blob/master/CHANGELOG.md
|
103
104
|
rubygems_mfa_required: 'true'
|
104
|
-
post_install_message:
|
105
|
-
with @solo has been dropped.
|
106
|
-
|
107
|
-
'
|
105
|
+
post_install_message:
|
108
106
|
rdoc_options: []
|
109
107
|
require_paths:
|
110
108
|
- lib
|
@@ -119,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
117
|
- !ruby/object:Gem::Version
|
120
118
|
version: '0'
|
121
119
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.2.3
|
123
121
|
signing_key:
|
124
122
|
specification_version: 4
|
125
123
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails
|