geordi 5.4.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +6 -6
- data/.rspec +2 -0
- data/CHANGELOG.md +22 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +17 -10
- data/README.md +15 -52
- data/geordi.gemspec +3 -2
- data/lib/geordi/capistrano_config.rb +13 -4
- data/lib/geordi/chromedriver_updater.rb +7 -7
- data/lib/geordi/cli.rb +6 -6
- data/lib/geordi/commands/cucumber.rb +7 -41
- data/lib/geordi/commands/delete_dumps.rb +1 -1
- data/lib/geordi/commands/docker.rb +7 -1
- data/lib/geordi/commands/drop_databases.rb +0 -2
- data/lib/geordi/commands/remove_executable_flags.rb +2 -1
- data/lib/geordi/commands/tests.rb +36 -12
- data/lib/geordi/cucumber.rb +4 -100
- data/lib/geordi/db_cleaner.rb +5 -5
- data/lib/geordi/docker.rb +71 -4
- data/lib/geordi/gitpt.rb +22 -7
- data/lib/geordi/interaction.rb +5 -3
- data/lib/geordi/settings.rb +18 -26
- data/lib/geordi/version.rb +1 -1
- metadata +8 -10
- data/exe/launchy_browser +0 -15
- data/lib/geordi/commands/_setup_vnc.rb +0 -64
- data/lib/geordi/commands/firefox.rb +0 -32
- data/lib/geordi/commands/vnc.rb +0 -18
- data/lib/geordi/firefox_for_selenium.rb +0 -200
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c44afe4591d03e6424d4ba630a66082f7d3305c9470d6e6c4ae0563e6d46ab2
|
4
|
+
data.tar.gz: ec092f0c1e9ab2c5c6f19a6cf929be1565146eec1c402d8bdc60d6bb72c0009b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19b544d7e3b3e324334f8a7179263d0554607cfe4d2e659f8f3d6303c97de7d111917332a92862759f797c937175c84d82e9ad7b4f582156fd06022af88dcc4d
|
7
|
+
data.tar.gz: 29b1e80a11773f12332b3fe1a2fb830db6b48c55d2691410dedc513b1f621560b4e3f94f0036f619ec5e5bcd41feb266aa920ad9c996776d0ba62686256a320d
|
data/.github/workflows/test.yml
CHANGED
@@ -25,6 +25,8 @@ jobs:
|
|
25
25
|
gemfile: Gemfile
|
26
26
|
- ruby: 2.7.2
|
27
27
|
gemfile: Gemfile
|
28
|
+
- ruby: 3.0.0
|
29
|
+
gemfile: Gemfile
|
28
30
|
env:
|
29
31
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
30
32
|
steps:
|
@@ -33,16 +35,14 @@ jobs:
|
|
33
35
|
uses: ruby/setup-ruby@v1
|
34
36
|
with:
|
35
37
|
ruby-version: "${{ matrix.ruby }}"
|
36
|
-
- name: Install vncserver
|
37
|
-
run: |
|
38
|
-
sudo apt-get update
|
39
|
-
sudo apt-get install -y tightvncserver
|
40
|
-
# Fake required password for vncserver
|
41
|
-
mkdir ~/.vnc && touch ~/.vnc/passwd && chmod 700 ~/.vnc/passwd
|
42
38
|
- name: Bundle
|
43
39
|
run: |
|
44
40
|
gem install bundler:1.17.3
|
45
41
|
bundle install --no-deployment
|
42
|
+
- name: Install VNC viewer
|
43
|
+
run: |
|
44
|
+
sudo apt-get update
|
45
|
+
sudo apt-get install -y xtightvncviewer
|
46
46
|
- name: Run tests
|
47
47
|
run: bundle exec rake
|
48
48
|
|
data/.rspec
ADDED
data/CHANGELOG.md
CHANGED
@@ -3,12 +3,33 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
-
|
7
6
|
## Unreleased
|
8
7
|
|
9
8
|
### Compatible changes
|
9
|
+
### Breaking changes
|
10
|
+
|
11
|
+
|
12
|
+
## 6.1.0 2021-07-15
|
13
|
+
|
14
|
+
### Compatible changes
|
15
|
+
* Improve parsing of Capistrano files ([#162](https://github.com/makandra/geordi/issues/162))
|
16
|
+
* `geordi tests` now takes test files as arguments and passes them to either RSpec or Cucumber ([#152](https://github.com/makandra/geordi/issues/152))
|
17
|
+
|
18
|
+
|
19
|
+
## 6.0.0 2021-06-02
|
20
|
+
|
21
|
+
### Compatible changes
|
22
|
+
* `geordi commit` will continue even if one of the given projects is inaccessible. It will only fail if no stories could be found at all.
|
10
23
|
|
11
24
|
### Breaking changes
|
25
|
+
* Removed VNC test browser support for integration tests – Headless Chrome has
|
26
|
+
matured and is almost a drop-in replacement. Also, key binding issues have
|
27
|
+
increased with VNC and recent Linux.
|
28
|
+
* Please use a headless Chrome setup <https://makandracards.com/makandra/492109-capybara-running-tests-with-headless-chrome>.
|
29
|
+
* You might also want to get rid of your local VNC server `sudo apt remove tightvncserver`.
|
30
|
+
* Removed support for serial execution of scenarios tagged with @solo. Serial
|
31
|
+
execution is not needed with Headless Chrome, as Headless instances cannot
|
32
|
+
interfere (like, stealing focus).
|
12
33
|
|
13
34
|
|
14
35
|
## 5.4.0 2021-02-01
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
geordi (
|
4
|
+
geordi (6.1.0)
|
5
5
|
thor (~> 1)
|
6
6
|
|
7
7
|
GEM
|
@@ -22,9 +22,9 @@ GEM
|
|
22
22
|
thread_safe (~> 0.3, >= 0.3.1)
|
23
23
|
backports (3.18.2)
|
24
24
|
builder (3.2.4)
|
25
|
+
byebug (10.0.2)
|
25
26
|
childprocess (1.0.1)
|
26
27
|
rake (< 13.0)
|
27
|
-
coderay (1.1.3)
|
28
28
|
coercible (1.0.0)
|
29
29
|
descendants_tracker (~> 0.0.1)
|
30
30
|
contracts (0.16.0)
|
@@ -61,27 +61,34 @@ GEM
|
|
61
61
|
ice_nine (0.11.2)
|
62
62
|
launchy (2.4.3)
|
63
63
|
addressable (~> 2.3)
|
64
|
-
|
65
|
-
|
64
|
+
mimemagic (0.3.9)
|
65
|
+
nokogiri (~> 1)
|
66
|
+
rake
|
67
|
+
mini_portile2 (2.4.0)
|
66
68
|
multi_json (1.15.0)
|
67
69
|
multi_test (0.1.2)
|
68
70
|
multipart-post (2.1.1)
|
71
|
+
nokogiri (1.9.1)
|
72
|
+
mini_portile2 (~> 2.4.0)
|
69
73
|
parallel (1.19.2)
|
70
74
|
parallel_tests (2.32.0)
|
71
75
|
parallel
|
72
|
-
pry (0.13.1)
|
73
|
-
coderay (~> 1.1)
|
74
|
-
method_source (~> 1.0)
|
75
76
|
public_suffix (3.1.1)
|
76
77
|
rake (12.3.3)
|
77
78
|
representable (3.0.4)
|
78
79
|
declarative (< 0.1.0)
|
79
80
|
declarative-option (< 0.2.0)
|
80
81
|
uber (< 0.2.0)
|
82
|
+
rspec (3.10.0)
|
83
|
+
rspec-core (~> 3.10.0)
|
84
|
+
rspec-expectations (~> 3.10.0)
|
85
|
+
rspec-mocks (~> 3.10.0)
|
86
|
+
rspec-core (3.10.1)
|
87
|
+
rspec-support (~> 3.10.0)
|
81
88
|
rspec-expectations (3.10.0)
|
82
89
|
diff-lcs (>= 1.2.0, < 2.0)
|
83
90
|
rspec-support (~> 3.10.0)
|
84
|
-
rspec-mocks (3.10.
|
91
|
+
rspec-mocks (3.10.2)
|
85
92
|
diff-lcs (>= 1.2.0, < 2.0)
|
86
93
|
rspec-support (~> 3.10.0)
|
87
94
|
rspec-support (3.10.0)
|
@@ -109,13 +116,13 @@ PLATFORMS
|
|
109
116
|
|
110
117
|
DEPENDENCIES
|
111
118
|
aruba (< 1)
|
119
|
+
byebug
|
112
120
|
geordi!
|
113
121
|
highline
|
114
122
|
launchy
|
115
123
|
parallel_tests
|
116
|
-
pry
|
117
124
|
rake (< 13)
|
118
|
-
rspec
|
125
|
+
rspec
|
119
126
|
tracker_api
|
120
127
|
|
121
128
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -90,27 +90,15 @@ Run Cucumber features.
|
|
90
90
|
|
91
91
|
Example: `geordi cucumber features/authentication_feature:3`
|
92
92
|
|
93
|
-
Runs Cucumber with `bundle exec`, using parallel tests
|
94
|
-
|
95
|
-
and beta support for re-running failed scenarios.
|
93
|
+
Runs Cucumber with `bundle exec`, using parallel tests and with support for
|
94
|
+
re-running failed scenarios.
|
96
95
|
|
97
|
-
|
98
|
-
|
96
|
+
Any unknown option will be passed through to Cucumber, e.g. `--format=pretty`.
|
97
|
+
Make sure to connect option and value with an equals sign, i.e. have each option
|
98
|
+
a contiguous string.
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
`--debug` or `-d`.
|
103
|
-
|
104
|
-
- *Options:* Any unknown option will be passed through to Cucumber,
|
105
|
-
e.g. `--format=pretty`. Make sure to connect option and value with an equals
|
106
|
-
sign, i.e. have each option a contiguous string.
|
107
|
-
|
108
|
-
- *VNC:* By default, test browsers will run in a VNC session. When using a
|
109
|
-
headless test browser anyway, you can disable VNC by setting `use_vnc: false`
|
110
|
-
in `.geordi.yml` in the project root.
|
111
|
-
|
112
|
-
- In order to limit processes in a parallel run, you can set an environment
|
113
|
-
variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi cucumber`
|
100
|
+
In order to limit processes in a parallel run, you can set an environment
|
101
|
+
variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi cucumber`
|
114
102
|
|
115
103
|
**Options**
|
116
104
|
- `-m, [--modified], [--no-modified]`: Run all modified features
|
@@ -188,6 +176,7 @@ There are three subcommands:
|
|
188
176
|
|
189
177
|
- `geordi docker vnc`
|
190
178
|
Opens a VNC viewer to connect to the VNC server in the container.
|
179
|
+
Append `--setup` to be guided through the setup of VNC viewer.
|
191
180
|
|
192
181
|
|
193
182
|
### `geordi drop-databases`
|
@@ -235,19 +224,6 @@ Loading a dump into one of multiple local databases is not supported yet.
|
|
235
224
|
- `-d, [--database=NAME]`: Database name, if there are multiple databases
|
236
225
|
|
237
226
|
|
238
|
-
### `geordi firefox COMMAND`
|
239
|
-
Run a command with VNC and test browser set up (alias: chrome).
|
240
|
-
|
241
|
-
Example: `geordi firefox b cucumber` or `geordi firefox --setup 24.0`
|
242
|
-
|
243
|
-
Useful when you need Firefox for Selenium or the VNC set up, but can't use the
|
244
|
-
`geordi cucumber` command. This command is aliased `chrome` for users running
|
245
|
-
Selenium in Chrome.
|
246
|
-
|
247
|
-
**Options**
|
248
|
-
- `[--setup=FIREFOX_VERSION]`: Install a special test runner Firefox with the given version
|
249
|
-
|
250
|
-
|
251
227
|
### `geordi help [COMMAND]`
|
252
228
|
Describe available commands or one specific command.
|
253
229
|
|
@@ -366,9 +342,15 @@ servers. When passed a number, directly connects to the selected server.
|
|
366
342
|
- `-s, [--select-server=[SERVER_NUMBER]]`: Select a server to connect to
|
367
343
|
|
368
344
|
|
369
|
-
### `geordi tests`
|
345
|
+
### `geordi tests [FILES]`
|
370
346
|
Run all employed tests.
|
371
347
|
|
348
|
+
When running `geordi tests` without any arguments, all unit tests, rspec specs
|
349
|
+
and cucumber features will be run.
|
350
|
+
|
351
|
+
When passing arguments, Geordi will forward them to either `rspec` or `cucumber`,
|
352
|
+
depending on what the first argument indicates.
|
353
|
+
|
372
354
|
|
373
355
|
### `geordi unit`
|
374
356
|
Run Test::Unit.
|
@@ -389,18 +371,6 @@ Performs: `git pull`, `bundle install` (if necessary) and migrates (if applicabl
|
|
389
371
|
### `geordi version`
|
390
372
|
Print the current version of geordi.
|
391
373
|
|
392
|
-
|
393
|
-
### `geordi vnc`
|
394
|
-
Show the hidden VNC window.
|
395
|
-
|
396
|
-
Example: `geordi vnc` or `geordi vnc --setup`
|
397
|
-
|
398
|
-
Launch a VNC session to the hidden screen where `geordi cucumber` runs Selenium
|
399
|
-
tests.
|
400
|
-
|
401
|
-
**Options**
|
402
|
-
- `[--setup], [--no-setup]`: Guide through the setup of VNC
|
403
|
-
|
404
374
|
b
|
405
375
|
---
|
406
376
|
|
@@ -424,13 +394,6 @@ Stores a timestamped database dump for the given Rails environment in `~/dumps`:
|
|
424
394
|
- `--compress`: After dumping, run gzip to compress the dump in place
|
425
395
|
|
426
396
|
|
427
|
-
launchy_browser
|
428
|
-
---------------
|
429
|
-
|
430
|
-
Used by the `geordi cucumber` command. Makes launchy open pages in the user's
|
431
|
-
browser, as opposed to opening it within the VNC window.
|
432
|
-
|
433
|
-
|
434
397
|
Contributing
|
435
398
|
============
|
436
399
|
|
data/geordi.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'thor', '~> 1'
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
spec.post_install_message = <<-ATTENTION
|
29
|
+
Support for sequential running of integration tests tagged with @solo has been dropped.
|
30
|
+
ATTENTION
|
30
31
|
end
|
@@ -11,7 +11,7 @@ module Geordi
|
|
11
11
|
|
12
12
|
def user(server)
|
13
13
|
cap2user = deploy_info[/^\s*set\s*:user,\s*['"](.*?)['"]/, 1]
|
14
|
-
cap2user || deploy_info[/^\s*server\s*['"]#{server}['"],.*user.{1,4}['"](.*?)['"]
|
14
|
+
cap2user || deploy_info[/^\s*server\s*['"]#{server}['"],.*user.{1,4}['"](.*?)['"]/, 1]
|
15
15
|
end
|
16
16
|
|
17
17
|
def servers
|
@@ -42,14 +42,23 @@ module Geordi
|
|
42
42
|
attr_accessor :deploy_info, :stage
|
43
43
|
|
44
44
|
def load_deploy_info
|
45
|
+
lines = []
|
45
46
|
self.deploy_info = ''
|
46
47
|
|
47
48
|
if stage
|
48
|
-
|
49
|
-
deploy_info << "\n"
|
49
|
+
lines += File.readlines(File.join(root, "config/deploy/#{stage}.rb"))
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
lines += File.readlines(File.join(root, 'config/deploy.rb'))
|
53
|
+
|
54
|
+
lines.each do |line|
|
55
|
+
next if line =~ /^\s*#/ # Omit comment lines
|
56
|
+
line.chomp! if line =~ /[\\,]\s*$/ # Join wrapped lines
|
57
|
+
|
58
|
+
deploy_info << line
|
59
|
+
end
|
60
|
+
|
61
|
+
deploy_info
|
53
62
|
end
|
54
63
|
|
55
64
|
def find_project_root!
|
@@ -10,7 +10,7 @@ module Geordi
|
|
10
10
|
chromedriver_version = determine_chromedriver_version
|
11
11
|
|
12
12
|
if skip_update?(chrome_version, chromedriver_version)
|
13
|
-
Interaction.
|
13
|
+
Interaction.success "No update required: both Chrome and chromedriver are on v#{chrome_version}!" unless options[:quiet_if_matching]
|
14
14
|
else
|
15
15
|
chromedriver_zip = download_chromedriver(chrome_version)
|
16
16
|
unzip(chromedriver_zip, File.expand_path('~/bin'))
|
@@ -18,7 +18,7 @@ module Geordi
|
|
18
18
|
chromedriver_zip.unlink
|
19
19
|
|
20
20
|
# We need to determine the version again, as it could be nil in case no chromedriver was installed before
|
21
|
-
Interaction.
|
21
|
+
Interaction.success "Chromedriver updated to v#{determine_chromedriver_version}."
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -31,7 +31,7 @@ module Geordi
|
|
31
31
|
end
|
32
32
|
|
33
33
|
if !status.success? || chrome_version.nil?
|
34
|
-
Interaction.fail('Could not determine the
|
34
|
+
Interaction.fail('Could not determine the version of Google Chrome.')
|
35
35
|
else
|
36
36
|
chrome_version.to_i
|
37
37
|
end
|
@@ -46,7 +46,7 @@ module Geordi
|
|
46
46
|
end
|
47
47
|
|
48
48
|
if !status.success? || chromedriver_version.nil?
|
49
|
-
Interaction.fail('Could not determine the
|
49
|
+
Interaction.fail('Could not determine the version of chromedriver.')
|
50
50
|
else
|
51
51
|
chromedriver_version.to_i
|
52
52
|
end
|
@@ -68,7 +68,7 @@ module Geordi
|
|
68
68
|
|
69
69
|
file
|
70
70
|
else
|
71
|
-
Interaction.fail("Could not download chromedriver
|
71
|
+
Interaction.fail("Could not download chromedriver v#{latest_version}.")
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -79,7 +79,7 @@ module Geordi
|
|
79
79
|
if response.is_a?(Net::HTTPSuccess)
|
80
80
|
response.body.to_s
|
81
81
|
else
|
82
|
-
Interaction.fail("Could not
|
82
|
+
Interaction.fail("Could not download the chromedriver v#{chrome_version}.")
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -87,7 +87,7 @@ module Geordi
|
|
87
87
|
_stdout_str, _error_str, status = Open3.capture3('unzip', '-d', output_dir, '-o', zip.path)
|
88
88
|
|
89
89
|
unless status.success?
|
90
|
-
Interaction.fail("Could not unzip #{zip.path}")
|
90
|
+
Interaction.fail("Could not unzip #{zip.path}.")
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
data/lib/geordi/cli.rb
CHANGED
@@ -15,12 +15,12 @@ module Geordi
|
|
15
15
|
class_eval File.read(file), file
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
no_commands do
|
19
|
+
# fix weird implementation of #invoke
|
20
|
+
def invoke_geordi(name, *args)
|
21
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
22
|
+
invoke(name, args, options)
|
23
|
+
end
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
@@ -2,27 +2,15 @@ desc 'cucumber [FILES and OPTIONS]', 'Run Cucumber features'
|
|
2
2
|
long_desc <<-LONGDESC
|
3
3
|
Example: `geordi cucumber features/authentication_feature:3`
|
4
4
|
|
5
|
-
Runs Cucumber with `bundle exec`, using parallel tests
|
6
|
-
|
7
|
-
and beta support for re-running failed scenarios.
|
5
|
+
Runs Cucumber with `bundle exec`, using parallel tests and with support for
|
6
|
+
re-running failed scenarios.
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
Any unknown option will be passed through to Cucumber, e.g. `--format=pretty`.
|
9
|
+
Make sure to connect option and value with an equals sign, i.e. have each option
|
10
|
+
a contiguous string.
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
`--debug` or `-d`.
|
15
|
-
|
16
|
-
- *Options:* Any unknown option will be passed through to Cucumber,
|
17
|
-
e.g. `--format=pretty`. Make sure to connect option and value with an equals
|
18
|
-
sign, i.e. have each option a contiguous string.
|
19
|
-
|
20
|
-
- *VNC:* By default, test browsers will run in a VNC session. When using a
|
21
|
-
headless test browser anyway, you can disable VNC by setting `use_vnc: false`
|
22
|
-
in `.geordi.yml` in the project root.
|
23
|
-
|
24
|
-
- In order to limit processes in a parallel run, you can set an environment
|
25
|
-
variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi cucumber`
|
12
|
+
In order to limit processes in a parallel run, you can set an environment
|
13
|
+
variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi cucumber`
|
26
14
|
LONGDESC
|
27
15
|
|
28
16
|
option :modified, aliases: '-m', type: :boolean,
|
@@ -67,28 +55,6 @@ def cucumber(*args)
|
|
67
55
|
cmd_opts, files = args.partition { |f| f.start_with? '-' }
|
68
56
|
cmd_opts << '--format' << 'pretty' << '--backtrace' if options.debug
|
69
57
|
|
70
|
-
# Serial run of @solo scenarios ############################################
|
71
|
-
if files.any? { |f| f.include? ':' }
|
72
|
-
Interaction.note '@solo run skipped when called with line numbers' if options.verbose
|
73
|
-
else
|
74
|
-
solo_files = if files.empty?
|
75
|
-
'features' # Proper grepping
|
76
|
-
else
|
77
|
-
files.join(' ')
|
78
|
-
end
|
79
|
-
|
80
|
-
solo_tag_usages = `grep -r '@solo' #{solo_files}`.split("\n")
|
81
|
-
|
82
|
-
if solo_tag_usages.any?
|
83
|
-
solo_cmd_opts = cmd_opts.dup
|
84
|
-
solo_cmd_opts << '--tags' << '@solo'
|
85
|
-
|
86
|
-
Interaction.announce 'Running @solo features'
|
87
|
-
solo_success = Geordi::Cucumber.new.run files, solo_cmd_opts, verbose: options.verbose, parallel: false
|
88
|
-
solo_success || Interaction.fail('Features failed.')
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
58
|
# Parallel run of all given features + reruns ##############################
|
93
59
|
Interaction.announce 'Running features'
|
94
60
|
normal_run_successful = Geordi::Cucumber.new.run(files, cmd_opts, verbose: options.verbose)
|