Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generating the dummy app for extensions using solidus_frontend #5060

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 23 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,25 @@ commands:
echo "Exited with $?"
kill $(cat "tmp/pids/server.pid")

install_dummy_app:
parameters:
extra_gems:
type: string
default: ""
description: "Gems to be added to the extension's Gemfile before running the installer"
steps:
- run:
name: "Test `rake task: extensions:test_app` <<#parameters.extra_gems>>(with <<parameters.extra_gems>>)<</parameters.extra_gems>>"
command: |
rm -rf /tmp/dummy_extension # cleanup previous runs
mkdir -p /tmp/dummy_extension
cd /tmp/dummy_extension
bundle init
bundle add rails sqlite3 <<parameters.extra_gems>> --skip-install
bundle add solidus --git "file://$(ruby -e"puts File.expand_path ENV['CIRCLE_WORKING_DIRECTORY']")"
export LIB_NAME=set # dummy requireable file
bundle exec rake -rrails -rspree/testing_support/extension_rake -e'Rake::Task["extension:test_app"].invoke'

jobs:
solidus_installer:
executor:
Expand All @@ -219,37 +238,14 @@ jobs:

- install_solidus: { flags: "--sample=false --frontend=starter --authentication=devise --payment-method=stripe" }
- test_page: { expected_text: "The only eCommerce platform you’ll ever need." }
- run:
name: Ensure the correct Stripe is installed for SSF
command: |
cd /tmp/my_app
bundle list
bundle list | grep 'solidus_stripe (5.'

- install_solidus: { flags: "--sample=false --frontend=starter --payment-method=braintree" }
- test_page: { expected_text: "The only eCommerce platform you’ll ever need." }
- run:
name: Ensure the correct Braintree is installed for SSF
command: |
cd /tmp/my_app
bundle list | grep 'solidus_braintree (3.'

- install_solidus: { flags: "--sample=false --frontend=none --authentication=none" }
- test_page: { expected_text: "<title>Ruby on Rails" }

- install_solidus: { flags: "--sample=false --frontend=starter --authentication=custom" }
- test_page: { expected_text: "The only eCommerce platform you’ll ever need." }
- install_dummy_app

- install_dummy_app: { extra_gems: "solidus_frontend" }
- run:
name: "Test `rake task: extensions:test_app`"
name: "Ensure solidus_frontend installer is run"
command: |
mkdir -p /tmp/dummy_extension
cd /tmp/dummy_extension
bundle init
bundle add rails sqlite3 --skip-install
bundle add solidus --git "file://$(ruby -e"puts File.expand_path ENV['CIRCLE_WORKING_DIRECTORY']")"
export LIB_NAME=set # dummy requireable file
bundle exec rake -rrails -rspree/testing_support/extension_rake -e'Rake::Task["extension:test_app"].invoke'
test -f /tmp/dummy_extension/spec/dummy/config/initializers/solidus_frontend.rb

test_solidus:
parameters:
Expand Down
6 changes: 3 additions & 3 deletions core/lib/spree/testing_support/common_rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def initialize
"--quiet",
].shelljoin)

# TODO: Our extensions ecosystem expects the legacy frontend when the
# env FRONTEND variable is not given
ENV['FRONTEND'] || sh("bundle add solidus_frontend")
if Bundler.locked_gems.dependencies['solidus_frontend']
sh "bin/rails g solidus_frontend:install --auto-accept"
end

puts "Setting up dummy database..."

Expand Down