solidus_dev_support 2.5.2 โ†’ 2.5.5

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: e98ad4f08c0abe09fd5c4a86640e25db13f003324dcbd0ca1dc8e8747dcfd35b
4
- data.tar.gz: 76ac684f40e4615ed1cad8a91c0f1140416e4009ad0e2ddd61986d05a04703e5
3
+ metadata.gz: fe379e7fb130ab58c9441d18cae3d9c0eb6041c112db22497d93d170f4670267
4
+ data.tar.gz: 0a2bbcd253dd04a0b76723aa46279c68a0d2596c57fb7dc197c89bc4b8d50e16
5
5
  SHA512:
6
- metadata.gz: 075e9de0887997b6893354aa756a720b82e8cad4f15bbaf59face03658b1a3259360aff1d6b25850d9ea37365dc81e12321b69ed6130b4919384df8ac1b79a9c
7
- data.tar.gz: 8b9432063e8147d83bc856961d8404b140bedc8a921137ba3db8f04542e1d18bfcf87a31f7bcba516a76adc4e977d0bcde8698568945f60e51bd114aaf3631ee
6
+ metadata.gz: 16934e61453c2437bf129eaaa4ffb91927ccb811d5325490da187ede88a8d14c956e3e9d44bfb2b358f745036b4fdeced91a20884467e6bf2e3899222f72fae5
7
+ data.tar.gz: 31090179be805e26f804ee26e7fb3ac70865d73105087777e2485961ddfed1a41c6ce48d32c7e4b1cceb45796cb5a2e189099756665228301196b73c13212a9d
data/.circleci/config.yml CHANGED
@@ -12,21 +12,25 @@ commands:
12
12
  steps:
13
13
  - checkout
14
14
  - run:
15
- command: "gem install bundler -v '>=2' --conservative"
16
- no_output_timeout: 20m
15
+ name: "Update bundler"
16
+ command: |
17
+ sudo gem update --system
18
+ gem --version
19
+ gem install bundler -v '>=2.3.21' --conservative
20
+ bundle --version
17
21
 
18
22
  jobs:
19
23
  solidus-master:
20
- executor: solidusio_extensions/sqlite-memory
24
+ executor: solidusio_extensions/sqlite
21
25
  steps: ['setup', 'solidusio_extensions/run-tests-solidus-master']
22
26
  solidus-current:
23
- executor: solidusio_extensions/sqlite-memory
27
+ executor: solidusio_extensions/sqlite
24
28
  steps: ['setup', 'solidusio_extensions/run-tests-solidus-current']
25
29
  solidus-older:
26
- executor: solidusio_extensions/sqlite-memory
30
+ executor: solidusio_extensions/sqlite
27
31
  steps: ['setup', 'solidusio_extensions/run-tests-solidus-older']
28
32
  lint-code:
29
- executor: solidusio_extensions/sqlite-memory
33
+ executor: solidusio_extensions/sqlite
30
34
  steps: ['setup', 'solidusio_extensions/lint-code']
31
35
 
32
36
  workflows:
data/.rubocop.yml CHANGED
@@ -36,6 +36,11 @@ Style/RedundantRegexpEscape:
36
36
  Style/SlicingWithRange:
37
37
  Enabled: true
38
38
 
39
+ # Disable this cop until this isssue gets a clear answer:
40
+ # https://github.com/rubocop/rubocop/issues/10675
41
+ Gemspec/DeprecatedAttributeAssignment:
42
+ Enabled: false
43
+
39
44
  AllCops:
40
45
  TargetRubyVersion: 2.5
41
46
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,8 +1,30 @@
1
1
  # Changelog
2
2
 
3
- ## [2.5.2](https://github.com/solidusio/solidus_dev_support/tree/2.5.2) (2021-11-23)
3
+ ## [2.5.5](https://github.com/solidusio/solidus_dev_support/tree/2.5.5) (2022-09-08)
4
4
 
5
- [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.5.1...2.5.2)
5
+ [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.5.4...2.5.5)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Configure solidus\_chrome\_headless as capybara-screenshot driver [\#190](https://github.com/solidusio/solidus_dev_support/pull/190) ([tvdeyen](https://github.com/tvdeyen))
10
+ - Misc: auth-devise, extracted frontend gem, sqlite [\#188](https://github.com/solidusio/solidus_dev_support/pull/188) ([elia](https://github.com/elia))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Revert temporary fix for Octokit [\#186](https://github.com/solidusio/solidus_dev_support/pull/186) ([waiting-for-dev](https://github.com/waiting-for-dev))
15
+
16
+ ## [v2.5.4](https://github.com/solidusio/solidus_dev_support/tree/v2.5.4) (2022-05-31)
17
+
18
+ [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.5.2...v2.5.4)
19
+
20
+ **Fixed bugs:**
21
+
22
+ - Add a missing require for octokit/repository [\#185](https://github.com/solidusio/solidus_dev_support/pull/185) ([elia](https://github.com/elia))
23
+ - Fix window resizing of `solidus_chrome_headless` driver [\#184](https://github.com/solidusio/solidus_dev_support/pull/184) ([gsmendoza](https://github.com/gsmendoza))
24
+
25
+ ## [v2.5.2](https://github.com/solidusio/solidus_dev_support/tree/v2.5.2) (2021-11-23)
26
+
27
+ [Full Changelog](https://github.com/solidusio/solidus_dev_support/compare/v2.5.1...v2.5.2)
6
28
 
7
29
  **Merged pull requests:**
8
30
 
@@ -13,7 +13,7 @@ module SolidusDevSupport
13
13
 
14
14
  def initialize(root: Dir.pwd)
15
15
  @root = Pathname(root)
16
- @test_app_path = @root.join(ENV['DUMMY_PATH'] || 'spec/dummy')
16
+ @test_app_path = @root.join(ENV.fetch('DUMMY_PATH', 'spec/dummy'))
17
17
  @gemspec = Bundler.load_gemspec(@root.glob("{,*}.gemspec").first)
18
18
  end
19
19
 
@@ -43,7 +43,7 @@ module SolidusDevSupport
43
43
  cd root
44
44
  end
45
45
 
46
- directory ENV['DUMMY_PATH'] do
46
+ directory ENV.fetch('DUMMY_PATH', nil) do
47
47
  Rake::Task['extension:test_app'].invoke
48
48
  end
49
49
  end
@@ -61,7 +61,7 @@ module SolidusDevSupport
61
61
  require 'rspec/core/rake_task'
62
62
 
63
63
  namespace :extension do
64
- ::RSpec::Core::RakeTask.new(:specs, [] => FileList[ENV['DUMMY_PATH']]) do |t|
64
+ ::RSpec::Core::RakeTask.new(:specs, [] => FileList[ENV.fetch('DUMMY_PATH', nil)]) do |t|
65
65
  # Ref: https://circleci.com/docs/2.0/configuration-reference#store_test_results
66
66
  # Ref: https://github.com/solidusio/circleci-orbs-extensions#test-results-rspec
67
67
  if ENV['TEST_RESULTS_PATH']
@@ -82,7 +82,7 @@ module SolidusDevSupport
82
82
 
83
83
  config.user = repo.owner
84
84
  config.project = repo.name
85
- config.future_release = "v#{ENV['UNRELEASED_VERSION'] || gemspec.version}"
85
+ config.future_release = "v#{ENV.fetch('UNRELEASED_VERSION') { gemspec.version }}"
86
86
 
87
87
  rescue Octokit::InvalidRepository
88
88
  warn <<~WARN
@@ -3,18 +3,28 @@
3
3
  require 'webdrivers/chromedriver'
4
4
 
5
5
  # Allow to override the initial windows size
6
- CAPYBARA_WINDOW_SIZE = (ENV['CAPYBARA_WINDOW_SIZE'] || '1920x1080').split('x', 2).map(&:to_i)
6
+ CAPYBARA_WINDOW_SIZE = ENV.fetch('CAPYBARA_WINDOW_SIZE', '1920x1080').split('x', 2).map(&:to_i)
7
+ CAPYBARA_WINDOW_WIDTH = CAPYBARA_WINDOW_SIZE[0]
8
+ CAPYBARA_WINDOW_HEIGHT = CAPYBARA_WINDOW_SIZE[1]
7
9
 
8
- Capybara.javascript_driver = (ENV['CAPYBARA_JAVASCRIPT_DRIVER'] || "solidus_chrome_headless").to_sym
10
+ Capybara.javascript_driver = ENV.fetch('CAPYBARA_JAVASCRIPT_DRIVER', "solidus_chrome_headless").to_sym
9
11
  Capybara.default_max_wait_time = 10
10
12
  Capybara.server = :puma, { Silent: true } # A fix for rspec/rspec-rails#1897
11
13
 
12
14
  Capybara.drivers[:selenium_chrome_headless].tap do |original_driver|
13
15
  Capybara.register_driver :solidus_chrome_headless do |app|
14
16
  original_driver.call(app).tap do |driver|
15
- driver.options[:options].args << "--window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}"
17
+ driver.resize_window_to(
18
+ driver.current_window_handle, CAPYBARA_WINDOW_WIDTH, CAPYBARA_WINDOW_HEIGHT
19
+ )
16
20
  end
17
21
  end
18
22
  end
19
23
 
24
+ require 'capybara-screenshot/rspec'
25
+
26
+ Capybara::Screenshot.register_driver(:solidus_chrome_headless) do |driver, path|
27
+ driver.browser.save_screenshot(path)
28
+ end
29
+
20
30
  require 'spree/testing_support/capybara_ext'
@@ -8,11 +8,9 @@
8
8
  #
9
9
 
10
10
  require 'solidus_dev_support/rspec/rails_helper'
11
-
12
- require 'capybara-screenshot/rspec'
13
11
  require 'solidus_dev_support/rspec/capybara'
14
12
 
15
- def dev_support_assets_preload
13
+ dev_support_assets_preload = ->(*) {
16
14
  if Rails.application.respond_to?(:precompiled_assets)
17
15
  Rails.application.precompiled_assets
18
16
  else
@@ -21,18 +19,14 @@ def dev_support_assets_preload
21
19
  Rails.application.assets.find_asset(asset)
22
20
  end
23
21
  end
24
- end
22
+ }
25
23
 
26
24
  RSpec.configure do |config|
27
25
  config.when_first_matching_example_defined(type: :feature) do
28
- config.before :suite do
29
- dev_support_assets_preload
30
- end
26
+ config.before :suite, &dev_support_assets_preload
31
27
  end
32
28
 
33
29
  config.when_first_matching_example_defined(type: :system) do
34
- config.before :suite do
35
- dev_support_assets_preload
36
- end
30
+ config.before :suite, &dev_support_assets_preload
37
31
  end
38
32
  end
@@ -14,7 +14,7 @@ RSpec.configure do |config|
14
14
  config.mock_with :rspec
15
15
  config.color = true
16
16
 
17
- config.fail_fast = ENV['FAIL_FAST'] || false
17
+ config.fail_fast = ENV.fetch('FAIL_FAST', false)
18
18
  config.order = 'random'
19
19
 
20
20
  config.raise_errors_for_deprecations!
@@ -1,6 +1,9 @@
1
1
  version: 2.1
2
2
 
3
3
  orbs:
4
+ # Required for feature specs.
5
+ browser-tools: circleci/browser-tools@1.1
6
+
4
7
  # Always take the latest version of the orb, this allows us to
5
8
  # run specs against Solidus supported versions only without the need
6
9
  # to change this configuration every time a Solidus version is released
@@ -11,14 +14,17 @@ jobs:
11
14
  run-specs-with-postgres:
12
15
  executor: solidusio_extensions/postgres
13
16
  steps:
17
+ - browser-tools/install-browser-tools
14
18
  - solidusio_extensions/run-tests
15
19
  run-specs-with-mysql:
16
20
  executor: solidusio_extensions/mysql
17
21
  steps:
22
+ - browser-tools/install-browser-tools
18
23
  - solidusio_extensions/run-tests
19
24
  lint-code:
20
25
  executor: solidusio_extensions/sqlite-memory
21
26
  steps:
27
+ - browser-tools/install-browser-tools
22
28
  - solidusio_extensions/lint-code
23
29
 
24
30
  workflows:
@@ -6,6 +6,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
7
7
  gem 'solidus', github: 'solidusio/solidus', branch: branch
8
8
 
9
+ # The solidus_frontend gem has been pulled out since v3.2
10
+ gem 'solidus_frontend', github: 'solidusio/solidus_frontend' if branch == 'master'
11
+ gem 'solidus_frontend' if branch >= 'v3.2' # rubocop:disable Bundler/DuplicatedGem
12
+
9
13
  # Needed to help Bundler figure out how to resolve dependencies,
10
14
  # otherwise it takes forever to resolve them.
11
15
  # See https://github.com/bundler/bundler/issues/6677
@@ -14,7 +18,7 @@ gem 'rails', '>0.a'
14
18
  # Provides basic authentication functionality for testing parts of your engine
15
19
  gem 'solidus_auth_devise'
16
20
 
17
- case ENV['DB']
21
+ case ENV.fetch('DB', nil)
18
22
  when 'mysql'
19
23
  gem 'mysql2'
20
24
  when 'postgresql'
@@ -23,6 +27,11 @@ else
23
27
  gem 'sqlite3'
24
28
  end
25
29
 
30
+ # While we still support Ruby < 3 we need to workaround a limitation in
31
+ # the 'async' gem that relies on the latest ruby, since RubyGems doesn't
32
+ # resolve gems based on the required ruby version.
33
+ gem 'async', '< 3' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
34
+
26
35
  gemspec
27
36
 
28
37
  # Use a local Gemfile to include development dependencies that might not be
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  set -e
4
+ if [ ! -z $DEBUG ]
5
+ then
6
+ set -x
7
+ fi
4
8
 
5
9
  case "$DB" in
6
10
  postgres|postgresql)
@@ -9,21 +13,36 @@ postgres|postgresql)
9
13
  mysql)
10
14
  RAILSDB="mysql"
11
15
  ;;
12
- sqlite|'')
16
+ sqlite3|sqlite)
17
+ RAILSDB="sqlite3"
18
+ ;;
19
+ '')
20
+ echo "~~> Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
13
21
  RAILSDB="sqlite3"
14
22
  ;;
15
23
  *)
16
- echo "Invalid DB specified: $DB"
24
+ echo "Invalid value specified for the Solidus sandbox: DB=\"$DB\"."
25
+ echo "Please use 'postgres', 'mysql', or 'sqlite' instead."
17
26
  exit 1
18
27
  ;;
19
28
  esac
29
+ echo "~~> Using $RAILSDB as the database engine"
20
30
 
21
- if [ ! -z $SOLIDUS_BRANCH ]
31
+ if [ -n $SOLIDUS_BRANCH ]
22
32
  then
23
33
  BRANCH=$SOLIDUS_BRANCH
24
34
  else
35
+ echo "~~> Use 'export SOLIDUS_BRANCH=[master|v3.2|...]' to control the Solidus branch"
25
36
  BRANCH="master"
26
37
  fi
38
+ echo "~~> Using branch $BRANCH of solidus"
39
+
40
+ if [ -z $SOLIDUS_FRONTEND ]
41
+ then
42
+ echo "~~> Use 'export SOLIDUS_FRONTEND=[solidus_frontend|solidus_starter_frontend]' to control the Solidus frontend"
43
+ SOLIDUS_FRONTEND="solidus_frontend"
44
+ fi
45
+ echo "~~> Using branch $SOLIDUS_FRONTEND as the solidus frontend"
27
46
 
28
47
  extension_name="<%= file_name %>"
29
48
 
@@ -50,7 +69,6 @@ fi
50
69
  cd ./sandbox
51
70
  cat <<RUBY >> Gemfile
52
71
  gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
53
- gem 'solidus_auth_devise', '>= 2.1.0'
54
72
  gem 'rails-i18n'
55
73
  gem 'solidus_i18n'
56
74
 
@@ -71,16 +89,14 @@ unbundled bundle exec rails generate solidus:install \
71
89
  --auto-accept \
72
90
  --user_class=Spree::User \
73
91
  --enforce_available_locales=true \
74
- --with-authentication=false \
92
+ --with-authentication=<%= file_name != 'solidus_auth_devise' %> \
75
93
  --payment-method=none \
94
+ --frontend=${SOLIDUS_FRONTEND} \
76
95
  $@
77
96
 
78
- unbundled bundle exec rails generate solidus:auth:install
79
- unbundled bundle exec rails generate ${extension_name}:install
97
+ unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations
98
+ unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations
80
99
 
81
100
  echo
82
101
  echo "๐Ÿš€ Sandbox app successfully created for $extension_name!"
83
- echo "๐Ÿš€ Using $RAILSDB and Solidus $BRANCH"
84
- echo "๐Ÿš€ Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
85
- echo "๐Ÿš€ Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
86
- echo "๐Ÿš€ This app is intended for test purposes."
102
+ echo "๐Ÿงช This app is intended for test purposes."
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.metadata['source_code_uri'] = '<%= gemspec.metadata["source_code_uri"] %>'
18
18
  spec.metadata['changelog_uri'] = '<%= gemspec.metadata["changelog_uri"] %>'
19
19
 
20
- spec.required_ruby_version = Gem::Requirement.new('~> 2.5')
20
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 4')
21
21
 
22
22
  # Specify which files should be added to the gem when it is released.
23
23
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusDevSupport
4
- VERSION = "2.5.2"
4
+ VERSION = "2.5.5"
5
5
 
6
6
  def self.gem_version
7
7
  Gem::Version.new(VERSION)
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency 'capybara-screenshot', '~> 1.0'
34
34
  spec.add_dependency 'codecov', '~> 0.2'
35
35
  spec.add_dependency 'database_cleaner', '~> 1.7'
36
- spec.add_dependency 'factory_bot', '~> 4.8'
36
+ spec.add_dependency 'factory_bot', '>= 4.8'
37
37
  spec.add_dependency 'factory_bot_rails'
38
38
  spec.add_dependency 'ffaker', '~> 2.13'
39
39
  spec.add_dependency 'gem-release', '~> 2.1'
@@ -155,18 +155,22 @@ RSpec.describe 'Create extension' do
155
155
 
156
156
  def sh(*args)
157
157
  command = args.size == 1 ? args.first : args.shelljoin
158
- output, status = with_unbundled_env { Open3.capture2e(command) }
158
+ output, status = with_unbundled_env do
159
+ Open3.capture2e({ 'CI' => nil }, command)
160
+ end
159
161
 
160
- if status.success?
161
- output.to_s
162
- else
163
- if $DEBUG
164
- warn '~' * 80
165
- warn "$ #{command}"
166
- warn output.to_s
167
- end
162
+ if $DEBUG || ENV['DEBUG']
163
+ warn '~' * 80
164
+ warn "$ #{command}"
165
+ warn output.to_s
166
+ warn "$ #{command} ~~~~> EXIT STATUS: #{status.exitstatus}"
167
+ end
168
+
169
+ unless status.success?
168
170
  raise(command_failed_error, "command failed: #{command}\n#{output}")
169
171
  end
172
+
173
+ output.to_s
170
174
  end
171
175
 
172
176
  def with_unbundled_env(&block)
@@ -182,11 +186,12 @@ RSpec.describe 'Create extension' do
182
186
  # variables doesn't help because commands are run with a clean env.
183
187
  bundle_path = "#{gem_root}/vendor/bundle"
184
188
 
185
- command = 'bundle install'
186
- command += " --path=#{bundle_path.shellescape}" if File.exist?(bundle_path)
189
+ if File.exist?(bundle_path)
190
+ sh "bundle config set --local path #{bundle_path.shellescape}"
191
+ end
187
192
 
188
193
  output = nil
189
- cd(install_path) { output = sh command }
194
+ cd(install_path) { output = sh 'bundle install' }
190
195
  output
191
196
  end
192
197
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_dev_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: factory_bot
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.8'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.8'
83
83
  - !ruby/object:Gem::Dependency
@@ -308,7 +308,7 @@ dependencies:
308
308
  - - ">="
309
309
  - !ruby/object:Gem::Version
310
310
  version: '0'
311
- description:
311
+ description:
312
312
  email:
313
313
  - alessandrodesantis@nebulab.it
314
314
  executables:
@@ -397,7 +397,7 @@ metadata:
397
397
  source_code_uri: https://github.com/solidusio/solidus_dev_support
398
398
  changelog_uri: https://github.com/solidusio/solidus_dev_support/blob/master/CHANGELOG.md
399
399
  rubygems_mfa_required: 'true'
400
- post_install_message:
400
+ post_install_message:
401
401
  rdoc_options: []
402
402
  require_paths:
403
403
  - lib
@@ -412,8 +412,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
412
  - !ruby/object:Gem::Version
413
413
  version: '0'
414
414
  requirements: []
415
- rubygems_version: 3.0.3
416
- signing_key:
415
+ rubygems_version: 3.3.21
416
+ signing_key:
417
417
  specification_version: 4
418
418
  summary: Development tools for Solidus extensions.
419
419
  test_files: