diff --git a/.circleci/config.yml b/.circleci/config.yml index 89602140a21..560e196ee65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 <>)<>" + command: | + rm -rf /tmp/dummy_extension # cleanup previous runs + 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' + jobs: solidus_installer: executor: @@ -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: "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: diff --git a/core/lib/spree/testing_support/common_rake.rb b/core/lib/spree/testing_support/common_rake.rb index c2a2e720baf..02976918685 100644 --- a/core/lib/spree/testing_support/common_rake.rb +++ b/core/lib/spree/testing_support/common_rake.rb @@ -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..."