geordi 5.2.3 → 6.0.0

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: 601c58f6344b5fb02e2514749e216e60a6f6f1cc656d2a37eabb891cc013edfa
4
- data.tar.gz: 07b06fa74266f0ba5506b8218e10c78b4156c854cef9bb8bca3fd77ba5b6d30a
3
+ metadata.gz: 972d947bfb273cec9f5bb3a586ab1ead5021b63466b4322a42b047947c846c45
4
+ data.tar.gz: fd796ff8f25567d340e24012929ffda3a54eafba1f3b98c718ccdfab4c7b213b
5
5
  SHA512:
6
- metadata.gz: 533ceae3f15d374526bafa76278914212de5b930250c8375c8f4cde1661e56d4c22093a4266c48b3646b023c4925599e2c46e0f93f38b52430a9748ce1778e7c
7
- data.tar.gz: edf3b697d11b5ec5c932ccd6a60311325ea0d8ed50e3d0650aae3f63b8cd514374dfd465212aae82e6585daee7f7466113cf6b1dacbf430a2b7c95269c9b0dc2
6
+ metadata.gz: 889947c5d0139c9cc1fe4b7cc95ae7b08e83a0966696fce6e800db777c214544a6b8879b478e2999073c863405ff8e98a33c15ec4ad5ac73c92ab35f6084d1ae
7
+ data.tar.gz: c2771b0ca090e9d68557a6f8e9e1539a7b573f78caa7f66e6bdecc441710a4617fe390735a8f0b97304d10b5583d85b63dec13e7a0d74df421d41820262cd604
@@ -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
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,14 +1,46 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
-
5
4
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
5
 
7
6
  ## Unreleased
8
7
 
9
8
  ### Compatible changes
9
+ * Removed support for serial execution of scenarios tagged with @solo.
10
+
10
11
  ### Breaking changes
11
12
 
13
+ ## 6.0.0 2021-04-06
14
+
15
+ ### Compatible changes
16
+ * `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.
17
+
18
+ ### Breaking changes
19
+ * Removed VNC test browser support for integration tests.
20
+ * Please use a headless Chrome setup <https://makandracards.com/makandra/492109-capybara-running-tests-with-headless-chrome>.
21
+ * You might also want to get rid of your local VNC server `sudo apt remove tightvncserver`.
22
+
23
+ ## 5.4.0 2021-02-01
24
+
25
+ ### Compatible changes
26
+ * Add `geordi branch` command that checks out a feature branch based on a story from Pivotal Tracker
27
+ * Faster MySQL dumping with [`--single-transaction` and `--quick`](https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction)
28
+ * Allow pivotal tracker ids in the global config file
29
+ * Fix missing require for `Fileutils` in the dump load command (#145)
30
+ * Document `PARALLEL_TEST_PROCESSORS`
31
+
32
+
33
+ ## 5.3.0 2021-02-01
34
+
35
+ ### Compatible changes
36
+ * Changed: Dumping and loading a database will not keep the database dump in `tmp/` but delete it once the operation finishes successfully. Example: `geordi dump staging -l` will remove the file `tmp/staging.dump` after it loaded the dump.
37
+
38
+
39
+ ## 5.2.4 2021-01-29
40
+
41
+ ### Compatible changes
42
+ * Fix and improve delete-dumps command (now supporting multiple arguments)
43
+
12
44
 
13
45
  ## 5.2.3 2021-01-27
14
46
 
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gemspec
5
5
 
6
6
  gem 'aruba', '< 1' # Drops support for Ruby 2.2-
7
7
  gem 'rake', '< 13' # Drops support for Ruby 2.1
8
- gem 'rspec-mocks'
8
+ gem 'rspec'
9
9
  gem 'highline'
10
10
  gem 'parallel_tests'
11
11
  gem 'launchy'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (5.2.3)
4
+ geordi (6.0.0)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
@@ -62,10 +62,15 @@ GEM
62
62
  launchy (2.4.3)
63
63
  addressable (~> 2.3)
64
64
  method_source (1.0.0)
65
- mimemagic (0.3.5)
65
+ mimemagic (0.3.9)
66
+ nokogiri (~> 1)
67
+ rake
68
+ mini_portile2 (2.4.0)
66
69
  multi_json (1.15.0)
67
70
  multi_test (0.1.2)
68
71
  multipart-post (2.1.1)
72
+ nokogiri (1.9.1)
73
+ mini_portile2 (~> 2.4.0)
69
74
  parallel (1.19.2)
70
75
  parallel_tests (2.32.0)
71
76
  parallel
@@ -78,10 +83,16 @@ GEM
78
83
  declarative (< 0.1.0)
79
84
  declarative-option (< 0.2.0)
80
85
  uber (< 0.2.0)
86
+ rspec (3.10.0)
87
+ rspec-core (~> 3.10.0)
88
+ rspec-expectations (~> 3.10.0)
89
+ rspec-mocks (~> 3.10.0)
90
+ rspec-core (3.10.1)
91
+ rspec-support (~> 3.10.0)
81
92
  rspec-expectations (3.10.0)
82
93
  diff-lcs (>= 1.2.0, < 2.0)
83
94
  rspec-support (~> 3.10.0)
84
- rspec-mocks (3.10.0)
95
+ rspec-mocks (3.10.2)
85
96
  diff-lcs (>= 1.2.0, < 2.0)
86
97
  rspec-support (~> 3.10.0)
87
98
  rspec-support (3.10.0)
@@ -115,7 +126,7 @@ DEPENDENCIES
115
126
  parallel_tests
116
127
  pry
117
128
  rake (< 13)
118
- rspec-mocks
129
+ rspec
119
130
  tracker_api
120
131
 
121
132
  BUNDLED WITH
data/README.md CHANGED
@@ -25,6 +25,15 @@ You can always run `geordi help <command>` to quickly look up command help.
25
25
  Enable the given virtual host, disabling all others.
26
26
 
27
27
 
28
+ ### `geordi branch`
29
+ Check out a feature branch based on a story from Pivotal Tracker.
30
+
31
+ Example: `geordi branch`
32
+
33
+ On the first execution we ask for your Pivotal Tracker API token. It will be
34
+ stored in `~/.config/geordi/global.yml`.
35
+
36
+
28
37
  ### `geordi capistrano COMMAND`
29
38
  Run a capistrano command on all deploy targets.
30
39
 
@@ -81,24 +90,15 @@ Run Cucumber features.
81
90
 
82
91
  Example: `geordi cucumber features/authentication_feature:3`
83
92
 
84
- Runs Cucumber with `bundle exec`, using parallel tests, with a VNC session
85
- holding Selenium test browsers, support for using a dedicated testing browser
86
- and beta support for re-running failed scenarios.
87
-
88
- - *@solo:* Generally, features are run in parallel. However, scenarios tagged
89
- with @solo are excluded from the parallel run and executed sequentially instead.
93
+ Runs Cucumber with `bundle exec`, using parallel tests and with support for
94
+ re-running failed scenarios.
90
95
 
91
- - *Debugging:* In some cases, the dot-printing Cucumber formatter swallows
92
- errors. In case a feature fails without an error message, try running it with
93
- `--debug` or `-d`.
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.
94
99
 
95
- - *Options:* Any unknown option will be passed through to Cucumber,
96
- e.g. `--format=pretty`. Make sure to connect option and value with an equals
97
- sign, i.e. have each option a contiguous string.
98
-
99
- - *VNC:* By default, test browsers will run in a VNC session. When using a
100
- headless test browser anyway, you can disable VNC by setting `use_vnc: false`
101
- in `.geordi.yml` in the project root.
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`
102
102
 
103
103
  **Options**
104
104
  - `-m, [--modified], [--no-modified]`: Run all modified features
@@ -111,13 +111,13 @@ in `.geordi.yml` in the project root.
111
111
  ### `geordi delete-dumps [DIRECTORY]`
112
112
  Delete database dump files (*.dump).
113
113
 
114
- Example: `geordi delete_dumps` or `geordi delete_dumps ~/tmp/dumps`
114
+ Example: `geordi delete-dumps` or `geordi delete-dumps ~/tmp/dumps`
115
115
 
116
- Recursively search for files ending in `*.dump` and offer to delete those. When
116
+ Recursively searches for files ending in `.dump` and offers to delete them. When
117
117
  no argument is given, two default directories are searched for dump files: the
118
118
  current working directory and `~/dumps` (for dumps created with geordi).
119
119
 
120
- Geordi will ask for confirmation before actually deleting files.
120
+ Will ask for confirmation before actually deleting files.
121
121
 
122
122
 
123
123
  ### `geordi deploy [STAGE]`
@@ -169,11 +169,14 @@ There are three subcommands:
169
169
 
170
170
  - `geordi docker setup`
171
171
  Fetches all docker containers.
172
+
172
173
  - `geordi docker shell`
173
174
  Runs the docker service named 'main'.
174
- Append `--secondary` to open a second shell in a already running container.
175
+ Append `--secondary` to open a second shell in an already running container.
176
+
175
177
  - `geordi docker vnc`
176
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.
177
180
 
178
181
 
179
182
  ### `geordi drop-databases`
@@ -221,19 +224,6 @@ Loading a dump into one of multiple local databases is not supported yet.
221
224
  - `-d, [--database=NAME]`: Database name, if there are multiple databases
222
225
 
223
226
 
224
- ### `geordi firefox COMMAND`
225
- Run a command with VNC and test browser set up (alias: chrome).
226
-
227
- Example: `geordi firefox b cucumber` or `geordi firefox --setup 24.0`
228
-
229
- Useful when you need Firefox for Selenium or the VNC set up, but can't use the
230
- `geordi cucumber` command. This command is aliased `chrome` for users running
231
- Selenium in Chrome.
232
-
233
- **Options**
234
- - `[--setup=FIREFOX_VERSION]`: Install a special test runner Firefox with the given version
235
-
236
-
237
227
  ### `geordi help [COMMAND]`
238
228
  Describe available commands or one specific command.
239
229
 
@@ -279,7 +269,10 @@ Run RSpec.
279
269
 
280
270
  Example: `geordi rspec spec/models/user_spec.rb:13`
281
271
 
282
- Runs RSpec with RSpec 1/2 support, parallel_tests detection and `bundle exec`.
272
+ Runs RSpec with version 1/2 support, parallel_tests detection and `bundle exec`.
273
+
274
+ In order to limit processes in a parallel run, you can set an environment
275
+ variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi rspec`
283
276
 
284
277
 
285
278
  ### `geordi security-update [STEP]`
@@ -372,18 +365,6 @@ Performs: `git pull`, `bundle install` (if necessary) and migrates (if applicabl
372
365
  ### `geordi version`
373
366
  Print the current version of geordi.
374
367
 
375
-
376
- ### `geordi vnc`
377
- Show the hidden VNC window.
378
-
379
- Example: `geordi vnc` or `geordi vnc --setup`
380
-
381
- Launch a VNC session to the hidden screen where `geordi cucumber` runs Selenium
382
- tests.
383
-
384
- **Options**
385
- - `[--setup], [--no-setup]`: Guide through the setup of VNC
386
-
387
368
  b
388
369
  ---
389
370
 
@@ -407,13 +388,6 @@ Stores a timestamped database dump for the given Rails environment in `~/dumps`:
407
388
  - `--compress`: After dumping, run gzip to compress the dump in place
408
389
 
409
390
 
410
- launchy_browser
411
- ---------------
412
-
413
- Used by the `geordi cucumber` command. Makes launchy open pages in the user's
414
- browser, as opposed to opening it within the VNC window.
415
-
416
-
417
391
  Contributing
418
392
  ============
419
393
 
@@ -424,11 +398,9 @@ Once you have completed your modifications, please update CHANGELOG and README
424
398
  as needed. Use `rake readme` to regenerate the Geordi section of the README from
425
399
  the command documentations.
426
400
 
427
- Make sure tests are green in the default Ruby *plus* in the oldest Ruby > 1.8
428
- that you have installed on your system (1.8.7 support has been dropped).
429
-
430
- Before releasing your changes, wait for the Travis results to see that tests
431
- passed in all Ruby versions.
401
+ Make sure tests are green in the oldest supported Ruby version. Before releasing
402
+ a new gem version, wait for the CI results to see that tests are green in all
403
+ Ruby versions.
432
404
 
433
405
 
434
406
  Adding a new command
data/exe/dumple CHANGED
@@ -78,6 +78,13 @@ begin
78
78
  command << " -p\"#{config['password']}\""
79
79
  command << " #{config['database']}"
80
80
  command << " -r #{dump_path}"
81
+ # Using a transaction to allow concurrent request while creating a dump.
82
+ # This works only reliable for InnoDB tables.
83
+ # More details: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction
84
+ command << ' --single-transaction'
85
+ # Disable buffering in memory to avoid a memory overflow for large tables
86
+ # More details https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_quick
87
+ command << ' --quick'
81
88
  if port
82
89
  command << " -h#{host || '127.0.0.1'} -P#{port}"
83
90
  else
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
- #spec.post_install_message = <<-ATTENTION
29
- #ATTENTION
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
@@ -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.note("No update required, you are using for both executables the same version #{chrome_version}!") unless options[:quiet_if_matching]
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.note "Chromedriver updated to version #{determine_chromedriver_version}"
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 current Google Chrome version')
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 current chromedriver version')
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 version #{latest_version}")
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 find the latest version for Google Chrome version #{chrome_version}")
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
- private
19
-
20
- # fix weird implementation of #invoke
21
- def invoke_geordi(name, *args)
22
- options = args.last.is_a?(Hash) ? args.pop : {}
23
- invoke(name, args, options)
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
@@ -0,0 +1,12 @@
1
+ desc 'branch', 'Check out a feature branch based on a story from Pivotal Tracker'
2
+ long_desc <<-LONGDESC
3
+ Example: `geordi branch`
4
+
5
+ On the first execution we ask for your Pivotal Tracker API token. It will be
6
+ stored in `~/.config/geordi/global.yml`.
7
+ LONGDESC
8
+
9
+ def branch
10
+ require 'geordi/gitpt'
11
+ Gitpt.new.run_branch
12
+ end
@@ -10,5 +10,5 @@ LONGDESC
10
10
 
11
11
  def commit(*git_args)
12
12
  require 'geordi/gitpt'
13
- Gitpt.new.run(git_args)
13
+ Gitpt.new.run_commit(git_args)
14
14
  end
@@ -2,24 +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, with a VNC session
6
- holding Selenium test browsers, support for using a dedicated testing browser
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
- - *@solo:* Generally, features are run in parallel. However, scenarios tagged
10
- with @solo are excluded from the parallel run and executed sequentially instead.
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
- - *Debugging:* In some cases, the dot-printing Cucumber formatter swallows
13
- errors. In case a feature fails without an error message, try running it with
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.
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`
23
14
  LONGDESC
24
15
 
25
16
  option :modified, aliases: '-m', type: :boolean,
@@ -64,28 +55,6 @@ def cucumber(*args)
64
55
  cmd_opts, files = args.partition { |f| f.start_with? '-' }
65
56
  cmd_opts << '--format' << 'pretty' << '--backtrace' if options.debug
66
57
 
67
- # Serial run of @solo scenarios ############################################
68
- if files.any? { |f| f.include? ':' }
69
- Interaction.note '@solo run skipped when called with line numbers' if options.verbose
70
- else
71
- solo_files = if files.empty?
72
- 'features' # Proper grepping
73
- else
74
- files.join(' ')
75
- end
76
-
77
- solo_tag_usages = `grep -r '@solo' #{solo_files}`.split("\n")
78
-
79
- if solo_tag_usages.any?
80
- solo_cmd_opts = cmd_opts.dup
81
- solo_cmd_opts << '--tags' << '@solo'
82
-
83
- Interaction.announce 'Running @solo features'
84
- solo_success = Geordi::Cucumber.new.run files, solo_cmd_opts, verbose: options.verbose, parallel: false
85
- solo_success || Interaction.fail('Features failed.')
86
- end
87
- end
88
-
89
58
  # Parallel run of all given features + reruns ##############################
90
59
  Interaction.announce 'Running features'
91
60
  normal_run_successful = Geordi::Cucumber.new.run(files, cmd_opts, verbose: options.verbose)