From 3f4db849d1ec467e0c7c77d54e09ee0085ba7e8c Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 16 Jul 2019 15:00:52 +0200 Subject: [PATCH 01/23] Bump Solidus to 2.9 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index 030429c7b4a..3f560673c78 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.0.rc.1" + VERSION = "2.9" def self.solidus_version VERSION From b0c376cb2a3d2f3cb20e9df3defcfd76394e5c9a Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 16 Jul 2019 15:10:48 +0200 Subject: [PATCH 02/23] Bump Solidus to 2.9.0 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index 3f560673c78..a0f84fb1b0a 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9" + VERSION = "2.9.0" def self.solidus_version VERSION From e5261cccf59f2812a437cbed0470a3696326a72b Mon Sep 17 00:00:00 2001 From: Michela Frecchiami Date: Wed, 17 Jul 2019 11:20:19 +0200 Subject: [PATCH 03/23] Update Tab colors with its own variables Avoid using navbar variables and general variables color, about Tabs. Dedicated variables has been added. --- .../spree/backend/components/_tabs.scss | 22 +++++++++---------- .../spree/backend/globals/_variables.scss | 8 +++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/backend/app/assets/stylesheets/spree/backend/components/_tabs.scss b/backend/app/assets/stylesheets/spree/backend/components/_tabs.scss index fd6055b586a..7148e68d714 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_tabs.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_tabs.scss @@ -1,7 +1,7 @@ .tabs { display: flex; margin: 1em 0; - border-bottom: 1px solid $color-border; + border-bottom: 1px solid $color-tab-border; white-space: nowrap; &, @@ -26,9 +26,9 @@ top: 2px; > a { - color: $color-navbar-submenu; + color: $color-tab; display: block; - border: 1px solid $color-border; + border: 1px solid $color-tab-border; border-radius: 4px 4px 0 0; line-height: 1; } @@ -38,19 +38,19 @@ } &:not(.active) > a { - background: $color-tbl-thead; + background: $color-tab-bg; } &.active > a, &.active:hover { - background: white; - border-bottom-color: white; - color: $color-navbar-active; + background: $color-tab-active-bg; + border-bottom-color: $color-tab-active-border; + color: $color-tab-active; font-weight: $font-weight-bold; } &:not(.active):hover > a { - color: $color-navbar-active; + color: $color-tab-active; } } @@ -70,7 +70,7 @@ > a { position: relative; - background: white; + background: $color-tab-active-bg; z-index: 1; &:before { @@ -81,7 +81,7 @@ } &:hover > a { - background: white; + background: $color-tab-active-bg; } &:not(:hover) ul { @@ -99,7 +99,7 @@ .tabs li.in-dropdown { a { display: block; - border: 1px solid $color-border; + border: 1px solid $color-tab-border; background: white; } diff --git a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss index 5589a6efb7a..b4961038620 100644 --- a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss +++ b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss @@ -53,6 +53,14 @@ $color-navbar-footer-bg: $color-light !default; $color-navbar-footer-active: $color-primary !default; $color-icon-navbar: $color-dark-light !default; +// Basic Tabs colors +$color-tab: $color-dark-light !default; +$color-tab-bg: very-light($color-dark-light, 4) !default; +$color-tab-border: $color-border !default; +$color-tab-active: $color-primary !default; +$color-tab-active-bg: $color-white !default; +$color-tab-active-border: $color-white !default; + // Basic flash colors @include bs-deprecated-variable("color-success", "brand-success"); $color-success: $color-green !default; From 20b5d846b8ca6f06b74801c55fb393d137f7e137 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Thu, 18 Jul 2019 14:45:31 +0200 Subject: [PATCH 04/23] Freeze preferences for backend, frontend and api in specs We are already doing that for core preferences (plain Spree::Config). This commit also allows to use stub_spree_preferences into stores and extensions that define their own configuration classes, like Spree::Auth::Config in solidus_auth_devise for example. --- api/spec/features/checkout_spec.rb | 4 +- api/spec/models/spree/legacy_user_spec.rb | 2 +- .../spree/api/checkouts_controller_spec.rb | 2 +- .../spree/api/products_controller_spec.rb | 6 +- ...nauthenticated_products_controller_spec.rb | 4 +- api/spec/spec_helper.rb | 2 +- backend/spec/features/admin/locale_spec.rb | 3 +- core/lib/spree/testing_support/preferences.rb | 69 +++++++++++++++---- .../models/spree/stock/quantifier_spec.rb | 2 +- .../controllers/controller_helpers_spec.rb | 3 +- frontend/spec/features/locale_spec.rb | 3 +- 11 files changed, 68 insertions(+), 32 deletions(-) diff --git a/api/spec/features/checkout_spec.rb b/api/spec/features/checkout_spec.rb index 08f2c97ed9d..6dccc4472e8 100644 --- a/api/spec/features/checkout_spec.rb +++ b/api/spec/features/checkout_spec.rb @@ -4,7 +4,9 @@ module Spree describe 'Api Feature Specs', type: :request do - before { Spree::Api::Config[:requires_authentication] = false } + before do + stub_spree_preferences(Spree::Api::Config, requires_authentication: false) + end let!(:promotion) { FactoryBot.create(:promotion, :with_order_adjustment, code: 'foo', weighted_order_adjustment_amount: 10) } let(:promotion_code) { promotion.codes.first } let!(:store) { FactoryBot.create(:store) } diff --git a/api/spec/models/spree/legacy_user_spec.rb b/api/spec/models/spree/legacy_user_spec.rb index d995b6e9e85..5340e69d308 100644 --- a/api/spec/models/spree/legacy_user_spec.rb +++ b/api/spec/models/spree/legacy_user_spec.rb @@ -54,7 +54,7 @@ module Spree before { user.clear_spree_api_key! - stub_spree_preferences roles_for_auto_api_key: ['hobbit'] + stub_spree_preferences(roles_for_auto_api_key: ['hobbit']) } it { expect { subject }.to change { user.reload.spree_api_key }.from(nil) } diff --git a/api/spec/requests/spree/api/checkouts_controller_spec.rb b/api/spec/requests/spree/api/checkouts_controller_spec.rb index df0c714a40f..9963059b7c9 100644 --- a/api/spec/requests/spree/api/checkouts_controller_spec.rb +++ b/api/spec/requests/spree/api/checkouts_controller_spec.rb @@ -6,7 +6,7 @@ module Spree describe Api::CheckoutsController, type: :request do before(:each) do stub_authentication! - stub_spree_preferences track_inventory_levels: false + stub_spree_preferences(track_inventory_levels: false) country_zone = create(:zone, name: 'CountryZone') @state = create(:state) @country = @state.country diff --git a/api/spec/requests/spree/api/products_controller_spec.rb b/api/spec/requests/spree/api/products_controller_spec.rb index 24a4748f387..eacc2996972 100644 --- a/api/spec/requests/spree/api/products_controller_spec.rb +++ b/api/spec/requests/spree/api/products_controller_spec.rb @@ -326,11 +326,7 @@ module Spree # Regression test for https://github.com/spree/spree/issues/2140 context "with authentication_required set to false" do before do - Spree::Api::Config.requires_authentication = false - end - - after do - Spree::Api::Config.requires_authentication = true + stub_spree_preferences(Spree::Api::Config, requires_authentication: false) end it "can still create a product" do diff --git a/api/spec/requests/spree/api/unauthenticated_products_controller_spec.rb b/api/spec/requests/spree/api/unauthenticated_products_controller_spec.rb index 4e9f4d53867..006996a3303 100644 --- a/api/spec/requests/spree/api/unauthenticated_products_controller_spec.rb +++ b/api/spec/requests/spree/api/unauthenticated_products_controller_spec.rb @@ -9,7 +9,9 @@ module Spree let(:attributes) { [:id, :name, :description, :price, :available_on, :slug, :meta_description, :meta_keywords, :taxon_ids, :meta_title] } context "without authentication" do - before { Spree::Api::Config[:requires_authentication] = false } + before do + stub_spree_preferences(Spree::Api::Config, requires_authentication: false) + end it "retrieves a list of products" do get spree.api_products_path diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb index 43b8b658163..0142231cf31 100644 --- a/api/spec/spec_helper.rb +++ b/api/spec/spec_helper.rb @@ -59,7 +59,7 @@ config.before(:each) do Rails.cache.clear - Spree::Api::Config[:requires_authentication] = true + stub_spree_preferences(Spree::Api::Config, requires_authentication: true) end config.include ActiveJob::TestHelper diff --git a/backend/spec/features/admin/locale_spec.rb b/backend/spec/features/admin/locale_spec.rb index 72fb641e886..460c25dec70 100644 --- a/backend/spec/features/admin/locale_spec.rb +++ b/backend/spec/features/admin/locale_spec.rb @@ -19,12 +19,11 @@ }, listing_orders: "Ordres" }) - Spree::Backend::Config[:locale] = "fr" + stub_spree_preferences(Spree::Backend::Config, locale: "fr") end after do I18n.locale = I18n.default_locale - Spree::Backend::Config[:locale] = "en" ActionView::Base.raise_on_missing_translations = true end diff --git a/core/lib/spree/testing_support/preferences.rb b/core/lib/spree/testing_support/preferences.rb index 6368e3189b5..53ed1e3df8c 100644 --- a/core/lib/spree/testing_support/preferences.rb +++ b/core/lib/spree/testing_support/preferences.rb @@ -44,21 +44,36 @@ def assert_preference_unset(preference) # This method may be used for stubbing one or more different preferences # at the same time. # - # @param [Hash] preferences names and values to be stubbed + # @param prefs_or_conf_class [Class, Hash] the class we want to stub + # preferences for or the preferences hash (see prefs param). If this + # param is an Hash, preferences will be stubbed on Spree::Config. + # @param prefs [Hash, nil] names and values to be stubbed # - # @example Stubs `currency` and `track_inventory_levels` preferences + # @example Stubs `currency` and `track_inventory_levels` on `Spree::Config`: # stub_spree_preferences(currency: 'EUR', track_inventory_levels: false) # expect(Spree::Config.currency).to eql 'EUR' # + # @example Stubs `locale` preference on `Spree::Backend::Config`: + # stub_spree_preferences(Spree::Backend::Config, locale: 'fr'), + # expect(Spree::Backend::Config.locale).to eql 'fr' + # # @see https://github.com/solidusio/solidus/issues/3219 # Solidus #3219 for more details and motivations. - def stub_spree_preferences(preferences) + def stub_spree_preferences(prefs_or_conf_class, prefs = nil) + if prefs_or_conf_class.is_a?(Hash) + preference_store_class = Spree::Config + preferences = prefs_or_conf_class + else + preference_store_class = prefs_or_conf_class + preferences = prefs + end + preferences.each do |name, value| - if Spree::Config.method(:[]).owner >= Spree::Config.class - allow(Spree::Config).to receive(:[]).and_call_original + if preference_store_class.method(:[]).owner >= preference_store_class.class + allow(preference_store_class).to receive(:[]).and_call_original end - allow(Spree::Config).to receive(:[]).with(name) { value } - allow(Spree::Config).to receive(name) { value } + allow(preference_store_class).to receive(:[]).with(name) { value } + allow(preference_store_class).to receive(name) { value } end end @@ -75,12 +90,30 @@ def stub_spree_preferences(preferences) # expect(Spree::Config.currency).to eql 'EUR' # end # @see Spree::TestingSupport::Preferences#stub_spree_preferences - def with_unfrozen_spree_preference_store - frozen_store = Spree::Config.preference_store - Spree::Config.preference_store = Spree::Config[:unfrozen_preference_store].dup + def with_unfrozen_spree_preference_store(preference_store_class: Spree::Config) + frozen_store = preference_store_class.preference_store + preference_store_class.preference_store = preference_store_class[:unfrozen_preference_store].dup yield ensure - Spree::Config.preference_store = frozen_store + preference_store_class.preference_store = frozen_store + end + + # This class method allows to freeze preferences for a specific + # configuration store class. It also stores the current state into + # a new preference of that store, so it can be reused when needed + # (eg. with_unfrozen_spree_preference_store) + # + # It is meant to be used by extensions as well, for example if one + # extension has its own Spree::ExtensionName::Config class, we can + # freeze it and be sure we always stub values on it during tests. + # + # @param preference_store_class [Class] the configuration class we want + # to freeze. + def self.freeze_preferences(preference_store_class) + config_class = preference_store_class.class + config_class.preference :unfrozen_preference_store, :hash + preference_store_class.unfrozen_preference_store = preference_store_class.preference_store.dup + preference_store_class.preference_store.freeze end end end @@ -88,9 +121,15 @@ def with_unfrozen_spree_preference_store RSpec.configure do |config| config.before :suite do - # keep a copy of the original unfrozen preference_store for later use: - Spree::AppConfiguration.preference :unfrozen_preference_store, :hash - Spree::Config.unfrozen_preference_store = Spree::Config.preference_store.dup - Spree::Config.preference_store.freeze + %w[ + Spree::Config + Spree::Frontend::Config + Spree::Backend::Config + Spree::Api::Config + ].each do |configuration_class| + if Object.const_defined?(configuration_class) + Spree::TestingSupport::Preferences.freeze_preferences(configuration_class.constantize) + end + end end end diff --git a/core/spec/models/spree/stock/quantifier_spec.rb b/core/spec/models/spree/stock/quantifier_spec.rb index 0faf852f3ee..394679633e2 100644 --- a/core/spec/models/spree/stock/quantifier_spec.rb +++ b/core/spec/models/spree/stock/quantifier_spec.rb @@ -27,7 +27,7 @@ module Stock end context 'when track_inventory_levels is false' do - before { stub_spree_preferences track_inventory_levels: false } + before { stub_spree_preferences(track_inventory_levels: false) } specify { expect(subject.total_on_hand).to eq(Float::INFINITY) } diff --git a/frontend/spec/controllers/controller_helpers_spec.rb b/frontend/spec/controllers/controller_helpers_spec.rb index dcc8318ec19..9c43b372e17 100644 --- a/frontend/spec/controllers/controller_helpers_spec.rb +++ b/frontend/spec/controllers/controller_helpers_spec.rb @@ -8,7 +8,7 @@ describe Spree::ProductsController, type: :controller do before do I18n.enforce_available_locales = false - Spree::Frontend::Config[:locale] = :de + stub_spree_preferences(Spree::Frontend::Config, locale: :de) I18n.backend.store_translations(:de, spree: { i18n: { this_file_language: "Deutsch (DE)" } }) @@ -16,7 +16,6 @@ after do I18n.reload! - Spree::Frontend::Config[:locale] = :en I18n.locale = :en I18n.enforce_available_locales = true end diff --git a/frontend/spec/features/locale_spec.rb b/frontend/spec/features/locale_spec.rb index d5fc70b522a..3fb89f0b3f5 100644 --- a/frontend/spec/features/locale_spec.rb +++ b/frontend/spec/features/locale_spec.rb @@ -6,11 +6,10 @@ let!(:store) { create(:store) } def with_locale(locale) I18n.locale = locale - Spree::Frontend::Config[:locale] = locale + stub_spree_preferences(Spree::Frontend::Config, locale: locale) yield ensure I18n.locale = I18n.default_locale - Spree::Frontend::Config[:locale] = 'en' end context 'shopping cart link and page' do From 74e66d5ef8f9e0642419f1e30ff41943625f847f Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Thu, 18 Jul 2019 15:21:10 +0200 Subject: [PATCH 05/23] Avoid setting a preference at each api spec run it's already the default value --- api/spec/spec_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb index 0142231cf31..78fd73a6b74 100644 --- a/api/spec/spec_helper.rb +++ b/api/spec/spec_helper.rb @@ -59,7 +59,6 @@ config.before(:each) do Rails.cache.clear - stub_spree_preferences(Spree::Api::Config, requires_authentication: true) end config.include ActiveJob::TestHelper From df44e618c20a04003fe921bc60d179582743609a Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Wed, 7 Aug 2019 18:09:36 +0200 Subject: [PATCH 06/23] Bump Solidus to 2.9.1 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index a0f84fb1b0a..a79502119ab 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.0" + VERSION = "2.9.1" def self.solidus_version VERSION From b765a2e070cbf36cf766e6cd0ec5953875dbd83d Mon Sep 17 00:00:00 2001 From: Ajmal Eylia Date: Fri, 30 Aug 2019 23:51:05 +0800 Subject: [PATCH 07/23] Fix tab background color, too dark #3311 https://github.com/solidusio/solidus/issues/3311 --- .../assets/stylesheets/spree/backend/globals/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss index b4961038620..12323846a09 100644 --- a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss +++ b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss @@ -55,7 +55,7 @@ $color-icon-navbar: $color-dark-light !default; // Basic Tabs colors $color-tab: $color-dark-light !default; -$color-tab-bg: very-light($color-dark-light, 4) !default; +$color-tab-bg: $color-light !default; $color-tab-border: $color-border !default; $color-tab-active: $color-primary !default; $color-tab-active-bg: $color-white !default; From c1eed23ace6da66564a12ec375f34e7230c258f2 Mon Sep 17 00:00:00 2001 From: Michela Frecchiami Date: Wed, 11 Sep 2019 14:37:58 +0200 Subject: [PATCH 08/23] Use default sass function to lighten colors Noticed that the custom sass `@function very-light` doesn't work properly and this fact is generating display issues, both in tables with actions, and in components such as Taxonomies. --- .../spree/backend/components/_messages.scss | 6 +-- .../spree/backend/globals/_variables.scss | 40 +++++++++---------- .../spree/backend/sections/_taxonomies.scss | 2 +- .../spree/backend/shared/_tables.scss | 4 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/backend/app/assets/stylesheets/spree/backend/components/_messages.scss b/backend/app/assets/stylesheets/spree/backend/components/_messages.scss index 757fce36294..2ec1a44c48a 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_messages.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_messages.scss @@ -40,15 +40,15 @@ color: $body-color; &.notice { - background-color: rgba(very-light($color-notice, 15), .95); + background-color: rgba(lighten($color-notice, 15), .95); border-top-color: $color-notice; } &.success { - background-color: rgba(very-light($color-success, 30), .95); + background-color: rgba(lighten($color-success, 30), .95); border-top-color: $color-success; } &.error { - background-color: rgba(very-light($color-error, 30), .95); + background-color: rgba(lighten($color-error, 30), .95); border-top-color: $color-error; } } diff --git a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss index 12323846a09..00cc0c4c08e 100644 --- a/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss +++ b/backend/app/assets/stylesheets/spree/backend/globals/_variables.scss @@ -89,8 +89,8 @@ $color-style-guide-table-border: #CEE1F4; // Table colors $color-tbl-odd: $color-white !default; -$color-tbl-even: very-light($color-dark-light, 4) !default; -$color-tbl-thead: very-light($color-dark-light, 4) !default; +$color-tbl-even: $color-light !default; +$color-tbl-thead: $color-light !default; // Pill colors // @@ -114,24 +114,24 @@ $color-pill-error: #ff967b; $color-pill-error-text: $color-pill-text; // Actions colors -$color-action-edit-bg: very-light($color-success, 5 ) !default; -$color-action-edit-brd: very-light($color-success, 20 ) !default; -$color-action-clone-bg: very-light($color-notice, 5 ) !default; -$color-action-clone-brd: very-light($color-notice, 15 ) !default; -$color-action-remove-bg: very-light($color-error, 5 ) !default; -$color-action-remove-brd: very-light($color-error, 10 ) !default; -$color-action-void-bg: very-light($color-error, 10 ) !default; -$color-action-void-brd: very-light($color-error, 20 ) !default; -$color-action-cancel-bg: very-light($color-notice, 10 ) !default; -$color-action-cancel-brd: very-light($color-notice, 20 ) !default; -$color-action-capture-bg: very-light($color-success, 5 ) !default; -$color-action-capture-brd: very-light($color-success, 20 ) !default; -$color-action-save-bg: very-light($color-success, 5 ) !default; -$color-action-save-brd: very-light($color-success, 20 ) !default; -$color-action-mail-bg: very-light($color-success, 5 ) !default; -$color-action-mail-brd: very-light($color-success, 20 ) !default; -$color-action-failure-bg: very-light($color-error, 10 ) !default; -$color-action-failure-brd: very-light($color-error, 20 ) !default; +$color-action-edit-bg: lighten($color-success, (5 * 5) ) !default; +$color-action-edit-brd: lighten($color-success, (20 * 5) ) !default; +$color-action-clone-bg: lighten($color-notice, (5 * 5) ) !default; +$color-action-clone-brd: lighten($color-notice, (15 * 5) ) !default; +$color-action-remove-bg: lighten($color-error, (5 * 5) ) !default; +$color-action-remove-brd: lighten($color-error, (10 * 5) ) !default; +$color-action-void-bg: lighten($color-error, (10 * 5) ) !default; +$color-action-void-brd: lighten($color-error, (20 * 5) ) !default; +$color-action-cancel-bg: lighten($color-notice, (10 * 5) ) !default; +$color-action-cancel-brd: lighten($color-notice, (20 * 5) ) !default; +$color-action-capture-bg: lighten($color-success, (5 * 5) ) !default; +$color-action-capture-brd: lighten($color-success, (20 * 5) ) !default; +$color-action-save-bg: lighten($color-success, (5 * 5) ) !default; +$color-action-save-brd: lighten($color-success, (20 * 5) ) !default; +$color-action-mail-bg: lighten($color-success, (5 * 5) ) !default; +$color-action-mail-brd: lighten($color-success, (20 * 5) ) !default; +$color-action-failure-bg: lighten($color-error, (10 * 5) ) !default; +$color-action-failure-brd: lighten($color-error, (20 * 5) ) !default; // Available states $states: ( diff --git a/backend/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss b/backend/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss index 04dac0d84cc..b06762cc1b2 100644 --- a/backend/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +++ b/backend/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss @@ -12,7 +12,7 @@ } .taxon { - background-color: very-light($color-dark-light); + background-color: $color-light; border: 1px solid $color-border; border-radius: $border-radius; color: $body-color; diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss b/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss index b09f86dc1cf..8b22cf9177b 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss @@ -114,8 +114,8 @@ table { tbody { tr { &.deleted td { - background-color: very-light(theme-color("danger"), 6); - border-color: very-light(theme-color("danger"), 15); + background-color: lighten(theme-color("danger"), 6); + border-color: lighten(theme-color("danger"), 15); } } From 81cd767f48249513107de7dae54b556ae73b3728 Mon Sep 17 00:00:00 2001 From: Michela Frecchiami Date: Thu, 12 Sep 2019 13:09:19 +0200 Subject: [PATCH 09/23] Add warning msg to the very-light sass function --- .../assets/stylesheets/spree/backend/globals/_functions.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/assets/stylesheets/spree/backend/globals/_functions.scss b/backend/app/assets/stylesheets/spree/backend/globals/_functions.scss index c110f4e9afb..6faadbbd92f 100644 --- a/backend/app/assets/stylesheets/spree/backend/globals/_functions.scss +++ b/backend/app/assets/stylesheets/spree/backend/globals/_functions.scss @@ -1,5 +1,7 @@ // Make color very close to white @function very-light($color, $adjust: 3){ + @warn "The `very-light` function is deprecated. Please use the default sass `lighten` function, instead."; + @if type-of($adjust) == 'number' and $adjust > 0 { @for $i from 0 through 100 { @if lighten($color, $i) == white and ($i - $adjust) > $adjust { From 799ba676f03c40411b369b4c1cce5e8a9e742d90 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Mon, 30 Sep 2019 13:54:33 +0200 Subject: [PATCH 10/23] Bump Solidus to 2.9.2 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index a79502119ab..7faf84ef88b 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.1" + VERSION = "2.9.2" def self.solidus_version VERSION From 2615a917bcf3b2328f0f9939c848949ec3393bfe Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Fri, 11 Oct 2019 11:09:13 +0200 Subject: [PATCH 11/23] Lock Sprockets to v3.x Temporary fix for https://github.com/solidusio/solidus/issues/3374 --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 8c3042592ca..da5ef1373a3 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,11 @@ group :backend, :frontend, :core, :api do rails_version = ENV['RAILS_VERSION'] || '~> 5.2.0' gem 'rails', rails_version, require: false + # Temporarily locking sprockets to v3.x + # see https://github.com/solidusio/solidus/issues/3374 + # and https://github.com/rails/sprockets-rails/issues/369 + gem 'sprockets', '~> 3' + platforms :ruby do case ENV['DB'] when /mysql/ From a614cc19c1c74a47e1fc723cd936322695e44dbf Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Wed, 23 Oct 2019 16:52:38 +0200 Subject: [PATCH 12/23] Bump Solidus to 2.9.3 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index 7faf84ef88b..e964c59cc79 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.2" + VERSION = "2.9.3" def self.solidus_version VERSION From 9372b8171bd12adeaf49dec9f8bbea244b5f9bd0 Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Thu, 10 Oct 2019 10:29:41 +0200 Subject: [PATCH 13/23] Create app/assets/images on install for Sprockets 4 compatibility Sprockets 4 uses manifest files[1], and the default manifest.js links `app/assets/images`. To prevent it from crashing due to the directory not being present, the easiest solution is to create an empty `app/assets/images` directory. [1]: https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs --- core/lib/generators/spree/install/install_generator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/lib/generators/spree/install/install_generator.rb b/core/lib/generators/spree/install/install_generator.rb index 39bf0296994..21975b5f05d 100644 --- a/core/lib/generators/spree/install/install_generator.rb +++ b/core/lib/generators/spree/install/install_generator.rb @@ -58,6 +58,9 @@ def additional_tweaks def setup_assets @lib_name = 'spree' + + empty_directory 'app/assets/images' + %w{javascripts stylesheets images}.each do |path| empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test? empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test? From bdc7ec3b8869af1389bd7ccc7bad6ac89678ee13 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Wed, 8 Jan 2020 10:54:05 +0100 Subject: [PATCH 14/23] Revert "Remove unused method" The method was only "unused" within the Solidus codebase, but extensions and apps were relying on it. This reverts commit d82fb569ab2f4d79181473c35169813ab7c39e35. --- core/lib/spree/core/environment_extension.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/lib/spree/core/environment_extension.rb b/core/lib/spree/core/environment_extension.rb index a1f3865b9bf..0e38473ff86 100644 --- a/core/lib/spree/core/environment_extension.rb +++ b/core/lib/spree/core/environment_extension.rb @@ -22,6 +22,10 @@ def add_class_set(name) end end end + + def add_class(name) + singleton_class.send(:add_class_set, name) + end end end end From 4faad8192443d204fed9ac52cb8e543998b5eebc Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Wed, 8 Jan 2020 11:31:19 +0100 Subject: [PATCH 15/23] Add a deprecation for EnvironmentExtension#add_class It mixes different levels of configuration and just forwards to its class level counterpart. --- core/lib/spree/core/environment_extension.rb | 5 +++++ .../lib/spree/core/environment_extension_spec.rb | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/lib/spree/core/environment_extension.rb b/core/lib/spree/core/environment_extension.rb index 0e38473ff86..54321a2c381 100644 --- a/core/lib/spree/core/environment_extension.rb +++ b/core/lib/spree/core/environment_extension.rb @@ -24,6 +24,11 @@ def add_class_set(name) end def add_class(name) + Spree::Deprecation.warn( + 'This method is deprecated. ' \ + "Please use `#{self.class}.add_class_set(#{name.inspect})` instead.", + caller, + ) singleton_class.send(:add_class_set, name) end end diff --git a/core/spec/lib/spree/core/environment_extension_spec.rb b/core/spec/lib/spree/core/environment_extension_spec.rb index b56cbcc2602..10f3fc7483b 100644 --- a/core/spec/lib/spree/core/environment_extension_spec.rb +++ b/core/spec/lib/spree/core/environment_extension_spec.rb @@ -4,7 +4,7 @@ require 'spree/core/environment_extension' RSpec.describe Spree::Core::EnvironmentExtension do - let(:base) { Class.new } + let(:base) { Class.new { def self.to_s; 'ExampleClass'; end } } subject! { base.include(described_class).new } describe '.add_class_set' do @@ -32,4 +32,15 @@ end end end + + describe '#add_class' do + it 'is deprecated' do + expect(Spree::Deprecation).to receive(:warn) do |message, _caller| + expect(message).to include('ExampleClass.add_class_set(:foo)') + end + expect(base).to receive(:add_class_set).with(:foo) + + base.new.add_class(:foo) + end + end end From b6f0f6ac2676dba45d006e155f6fa00877511717 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 14 Jan 2020 12:19:35 +0100 Subject: [PATCH 16/23] Bump Solidus to 2.9.4 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index e964c59cc79..b372d6dd4e0 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.3" + VERSION = "2.9.4" def self.solidus_version VERSION From 707d89a6a8f2fcefcdfa18b9931aa9b38db4f0f3 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Thu, 23 Jan 2020 17:01:34 +0100 Subject: [PATCH 17/23] Reintroduce and deprecate Order#deliver_order_confirmation_email Was removed as part of https://github.com/solidusio/solidus/pull/3081, but not being private it's better to keep it around with a deprecation for a while. --- core/app/models/spree/order.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb index bde803c1d48..7581528c944 100644 --- a/core/app/models/spree/order.rb +++ b/core/app/models/spree/order.rb @@ -435,6 +435,13 @@ def finalize! touch :completed_at Spree::Event.fire 'order_finalized', order: self + + if method(:deliver_order_confirmation_email).owner != self.class + Spree::Deprecation.warn \ + "deliver_order_confirmation_email has been deprecated and moved to " \ + "Spree::MailerSubscriber#order_finalized, please move there any customizations.", + caller(1) + end end def fulfill! @@ -443,6 +450,16 @@ def fulfill! save! end + def deliver_order_confirmation_email + Spree::Deprecation.warn \ + "deliver_order_confirmation_email has been deprecated and moved to " \ + "Spree::MailerSubscriber#order_finalized.", + caller(1) + + Spree::Config.order_mailer_class.confirm_email(order).deliver_later + order.update_column(:confirmation_delivered, true) + end + # Helper methods for checkout steps def paid? %w(paid credit_owed).include?(payment_state) From ebb31e79656eb7dc52142f3b1df83e7a5173e62d Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 4 Feb 2020 10:44:05 +0100 Subject: [PATCH 18/23] Bump Solidus to 2.9.5 --- core/lib/spree/core/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/core/version.rb b/core/lib/spree/core/version.rb index b372d6dd4e0..56c3cbcb741 100644 --- a/core/lib/spree/core/version.rb +++ b/core/lib/spree/core/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Spree - VERSION = "2.9.4" + VERSION = "2.9.5" def self.solidus_version VERSION From dc74e38138805f0646568e872e1c1706a029309a Mon Sep 17 00:00:00 2001 From: Jared Kreppein Date: Fri, 4 Sep 2020 10:17:41 -0600 Subject: [PATCH 19/23] init commit --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ Gemfile | 2 ++ api/appmap.yml | 1 + api/spec/spec_helper.rb | 2 ++ appmap.yml | 7 +++++++ backend/appmap.yml | 1 + backend/spec/spec_helper.rb | 2 ++ core/appmap.yml | 1 + core/spec/spec_helper.rb | 2 ++ frontend/appmap.yml | 1 + frontend/spec/spec_helper.rb | 2 ++ 11 files changed, 54 insertions(+) create mode 100644 .travis.yml create mode 120000 api/appmap.yml create mode 100644 appmap.yml create mode 120000 backend/appmap.yml create mode 120000 core/appmap.yml create mode 120000 frontend/appmap.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..db7830247b2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +# Turn on validation, so we can use import: +version: ~> 1.0 + +addons: + chrome: stable + +# installation instructions for chrome driver found from +# https://amihaiemil.com/2017/07/14/selenium-headless-chrome-travis.html +install: + - wget -N http://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip -P ~/ + - unzip ~/chromedriver_linux64.zip -d ~/ + - rm ~/chromedriver_linux64.zip + - sudo mv -f ~/chromedriver /usr/local/share/ + - sudo chmod +x /usr/local/share/chromedriver + - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver + +import: +- land-of-apps/land-of-apps:travis/ruby-imports.yml + +script: +- bundle install +- cd api; APPMAP=true bundle exec rspec; cd .. +- cd backend; APPMAP=true bundle exec rspec; cd .. +- cd core; APPMAP=true bundle exec rspec; cd .. +- cd frontend; APPMAP=true bundle exec rspec; cd .. + +after_script: +- env DEBUG=true ruby ./upload-appmaps tmp/appmap/rspec + +- env DEBUG=true ruby ./upload-appmaps api/tmp/appmap/rspec +- env DEBUG=true ruby ./upload-appmaps backend/tmp/appmap/rspec +- env DEBUG=true ruby ./upload-appmaps core/tmp/appmap/rspec +- env DEBUG=true ruby ./upload-appmaps frontend/tmp/appmap/rspec diff --git a/Gemfile b/Gemfile index da5ef1373a3..375d18049b6 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,8 @@ source 'https://rubygems.org' group :backend, :frontend, :core, :api do gemspec require: false + gem 'appmap' + rails_version = ENV['RAILS_VERSION'] || '~> 5.2.0' gem 'rails', rails_version, require: false diff --git a/api/appmap.yml b/api/appmap.yml new file mode 120000 index 00000000000..89529491de1 --- /dev/null +++ b/api/appmap.yml @@ -0,0 +1 @@ +../appmap.yml \ No newline at end of file diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb index 78fd73a6b74..538a03a004f 100644 --- a/api/spec/spec_helper.rb +++ b/api/spec/spec_helper.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'appmap/rspec' + if ENV["COVERAGE"] require 'simplecov' SimpleCov.start('rails') diff --git a/appmap.yml b/appmap.yml new file mode 100644 index 00000000000..d2e6d5bb374 --- /dev/null +++ b/appmap.yml @@ -0,0 +1,7 @@ +name: solidus + +packages: +- path: api +- path: backend +- path: core +- path: frontend diff --git a/backend/appmap.yml b/backend/appmap.yml new file mode 120000 index 00000000000..89529491de1 --- /dev/null +++ b/backend/appmap.yml @@ -0,0 +1 @@ +../appmap.yml \ No newline at end of file diff --git a/backend/spec/spec_helper.rb b/backend/spec/spec_helper.rb index 44a59288679..de0ff833799 100644 --- a/backend/spec/spec_helper.rb +++ b/backend/spec/spec_helper.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'appmap/rspec' + if ENV["COVERAGE"] require 'simplecov' SimpleCov.start('rails') diff --git a/core/appmap.yml b/core/appmap.yml new file mode 120000 index 00000000000..89529491de1 --- /dev/null +++ b/core/appmap.yml @@ -0,0 +1 @@ +../appmap.yml \ No newline at end of file diff --git a/core/spec/spec_helper.rb b/core/spec/spec_helper.rb index 803b5deb1be..386b4ee9163 100644 --- a/core/spec/spec_helper.rb +++ b/core/spec/spec_helper.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'appmap/rspec' + if ENV["COVERAGE"] require 'simplecov' SimpleCov.start('rails') diff --git a/frontend/appmap.yml b/frontend/appmap.yml new file mode 120000 index 00000000000..89529491de1 --- /dev/null +++ b/frontend/appmap.yml @@ -0,0 +1 @@ +../appmap.yml \ No newline at end of file diff --git a/frontend/spec/spec_helper.rb b/frontend/spec/spec_helper.rb index cb7a5992e24..f4b18881958 100644 --- a/frontend/spec/spec_helper.rb +++ b/frontend/spec/spec_helper.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'appmap/rspec' + if ENV["COVERAGE"] require 'simplecov' SimpleCov.start('rails') From 6713e1328c39e68e80bac70f13de1ca84f96a52c Mon Sep 17 00:00:00 2001 From: Jared Kreppein Date: Fri, 4 Sep 2020 14:14:27 -0600 Subject: [PATCH 20/23] travis --- .travis.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index db7830247b2..6caf8d25820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,29 +4,19 @@ version: ~> 1.0 addons: chrome: stable -# installation instructions for chrome driver found from -# https://amihaiemil.com/2017/07/14/selenium-headless-chrome-travis.html -install: - - wget -N http://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip -P ~/ - - unzip ~/chromedriver_linux64.zip -d ~/ - - rm ~/chromedriver_linux64.zip - - sudo mv -f ~/chromedriver /usr/local/share/ - - sudo chmod +x /usr/local/share/chromedriver - - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver +before_install: +- gem install selenium-webdriver import: - land-of-apps/land-of-apps:travis/ruby-imports.yml script: -- bundle install - cd api; APPMAP=true bundle exec rspec; cd .. - cd backend; APPMAP=true bundle exec rspec; cd .. - cd core; APPMAP=true bundle exec rspec; cd .. - cd frontend; APPMAP=true bundle exec rspec; cd .. after_script: -- env DEBUG=true ruby ./upload-appmaps tmp/appmap/rspec - - env DEBUG=true ruby ./upload-appmaps api/tmp/appmap/rspec - env DEBUG=true ruby ./upload-appmaps backend/tmp/appmap/rspec - env DEBUG=true ruby ./upload-appmaps core/tmp/appmap/rspec From aa049a33d4148f9a827e900a1e56f0690de86f9f Mon Sep 17 00:00:00 2001 From: Jared Kreppein Date: Mon, 14 Sep 2020 12:23:18 -0600 Subject: [PATCH 21/23] new travis config --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6caf8d25820..beb022caf00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,23 @@ # Turn on validation, so we can use import: version: ~> 1.0 -addons: - chrome: stable - -before_install: -- gem install selenium-webdriver - import: - land-of-apps/land-of-apps:travis/ruby-imports.yml -script: -- cd api; APPMAP=true bundle exec rspec; cd .. -- cd backend; APPMAP=true bundle exec rspec; cd .. -- cd core; APPMAP=true bundle exec rspec; cd .. -- cd frontend; APPMAP=true bundle exec rspec; cd .. +addons: + apt: + packages: + - parallel + +script: | + run_tests() ( + cd $1 + # Use -f doc so we get regular output and keep Travis happy + APPMAP=true bundle exec rspec -f doc || true + ) + export -f run_tests + echo 'api backend core frontend' | parallel --will-cite --line-buffer -d ' ' run_tests -after_script: -- env DEBUG=true ruby ./upload-appmaps api/tmp/appmap/rspec -- env DEBUG=true ruby ./upload-appmaps backend/tmp/appmap/rspec -- env DEBUG=true ruby ./upload-appmaps core/tmp/appmap/rspec -- env DEBUG=true ruby ./upload-appmaps frontend/tmp/appmap/rspec +env: + global: + - EXTRA_APPMAPS="*/tmp/appmap/rspec" From 23b86194227cfb955277ec188b6593670458e9fa Mon Sep 17 00:00:00 2001 From: Jared Kreppein Date: Fri, 18 Sep 2020 12:27:47 -0600 Subject: [PATCH 22/23] updated travis.yml and add 'appmap/railtie' --- .travis.yml | 43 +++++++++++++++++---- Gemfile | 2 +- appmap.yml | 13 +++++-- core/lib/spree/testing_support/dummy_app.rb | 1 + 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index beb022caf00..c82901901ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,42 @@ addons: packages: - parallel -script: | - run_tests() ( - cd $1 - # Use -f doc so we get regular output and keep Travis happy - APPMAP=true bundle exec rspec -f doc || true - ) - export -f run_tests - echo 'api backend core frontend' | parallel --will-cite --line-buffer -d ' ' run_tests +# script: | +# run_tests() ( +# cd $1 +# # Use -f doc so we get regular output and keep Travis happy +# APPMAP=true bundle exec rspec -f doc || true +# ) +# export -f run_tests +# echo 'api backend core frontend' | parallel -j3 --will-cite --line-buffer -d ' ' run_tests env: global: - EXTRA_APPMAPS="*/tmp/appmap/rspec" + +jobs: + include: + - stage: test + workspaces: + create: + name: appmaps + paths: + - "$EXTRA_APPMAPS" + script: | + run_tests() ( + cd $1 + # Use -f doc so we get regular output and keep Travis happy + APPMAP=true bundle exec rspec -f doc || true + ) + export -f run_tests + echo 'api backend core frontend' | parallel --will-cite --line-buffer -d ' ' run_tests + after_script: + - true + - stage: upload + workspaces: + use: + - appmaps + install: + - true + script: + - true diff --git a/Gemfile b/Gemfile index 375d18049b6..8fbbf2fc36f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' group :backend, :frontend, :core, :api do gemspec require: false - gem 'appmap' + gem 'appmap', github: 'applandinc/appmap-ruby', branch: 'master' rails_version = ENV['RAILS_VERSION'] || '~> 5.2.0' gem 'rails', rails_version, require: false diff --git a/appmap.yml b/appmap.yml index d2e6d5bb374..4859f884e1f 100644 --- a/appmap.yml +++ b/appmap.yml @@ -1,7 +1,12 @@ name: solidus packages: -- path: api -- path: backend -- path: core -- path: frontend +- path: app/controllers +- path: app/helpers +- path: app/jobs +- path: app/mailers +- path: app/models +- path: app/subscribers +- path: config +- path: db +- path: lib diff --git a/core/lib/spree/testing_support/dummy_app.rb b/core/lib/spree/testing_support/dummy_app.rb index 2a5250e029c..4f7304ee8ef 100644 --- a/core/lib/spree/testing_support/dummy_app.rb +++ b/core/lib/spree/testing_support/dummy_app.rb @@ -7,6 +7,7 @@ require 'active_record/railtie' require 'action_controller/railtie' require 'action_mailer/railtie' +require 'appmap/railtie' Rails.env = 'test' From 96b55528bb9e923e82e2280cfd8a4a41adc168d9 Mon Sep 17 00:00:00 2001 From: Jared Kreppein Date: Fri, 18 Sep 2020 15:36:39 -0600 Subject: [PATCH 23/23] travis config --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index c82901901ea..7d6f98859a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,9 @@ env: global: - EXTRA_APPMAPS="*/tmp/appmap/rspec" +# install selenium chrome driver instructions from +# https://github.com/yizeng/setup-selenium-webdriver-ruby-project-on-travis-ci/blob/master/.travis.yml + jobs: include: - stage: test @@ -30,6 +33,16 @@ jobs: name: appmaps paths: - "$EXTRA_APPMAPS" + before_script: | + install_selenium() ( + gem install selenium-webdriver + wget -N https://chromedriver.storage.googleapis.com/85.0.4183.38/chromedriver_linux64.zip -P ~/Downloads + unzip ~/Downloads/chromedriver_linux64.zip -d ~/Downloads + sudo mv -f ~/Downloads/chromedriver /usr/local/share/ + sudo chmod +x /usr/local/share/chromedriver + sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver + sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver + ) script: | run_tests() ( cd $1