Closed gsmendoza closed 2 years ago
It looks like this PR is missing a label to determine the type of change it introduces. The maintainer should add one of the following labels:
bug
for bugfixes.enhancement
for new features and improvements.documentation
for documentation changes.security
for security patches.removed
for feature removals.infrastructure
for internal changes that should not go in the changelog.Additionally, the maintainer may also want to add one of the following:
breaking
for breaking changes.deprecated
for feature deprecations.Once the correct labels have been set, simply remove the needs changelog label
label from this PR so I can merge it.
Closing this for now. I have just noticed that common:test_app
already sets up RAILS_ENV
to test, but it's not being picked up by Solidus::InstallGenerator
. Will investigate.
This fixes the following error when running
bundle exec rake
in SolidusPaypalCommercePlatform:Cause
extension:specs
, the default rake task of SolidusPaypalCommercePlatform, executes the rake tasks and Ruby methods below in the given order:The
extension
namespace defined inSolidusDevSupport::RakeTasks#install_test_app_task
. This namespace invokes theextension:test_app
task (https://github.com/solidusio/solidus_dev_support/blob/e5fec9c039607ab9e97c3f821cc49f9bbec08796/lib/solidus_dev_support/rake_tasks.rb#L47).The Solidus
extension:test_app
task (https://github.com/solidusio/solidus/blob/07c88ddd1603699939ac0343965fa88dc2e1851a/core/lib/spree/testing_support/extension_rake.rb#L7)The
common:test_app
rake task inCommonRakeTasks#initialize
(https://github.com/solidusio/solidus/blob/07c88ddd1603699939ac0343965fa88dc2e1851a/core/lib/spree/testing_support/common_rake.rb#L14)Solidus::InstallGenerator#setup_assets
(https://github.com/solidusio/solidus/blob/07c88ddd1603699939ac0343965fa88dc2e1851a/core/lib/generators/solidus/install/install_generator.rb#L81)The
setup_assets
method would only install theall.*
frontend and backend assets if eitherSpree::Frontend
andSpree::Backend
are loaded, orCurrently, when we run
bundle exec rake
in SolidusPaypalCommercePlatform, neither condition is met:Spree::Frontend
andSpree::Backend
are NOT loaded.Trigger
This bug surfaced after we applied https://github.com/solidusio/solidus/pull/4251 (Fix: solidus:install adds the frontend assets even if the repo does not have
solidus_frontend
).Solution
Considering that the
extension:test_app
rake task generates thespec/dummy
directory, we can assume that it is expected to run under test environment.Testing
bundle exec rake
stripped off deprecation warnings and other noise: 2022-06-08-solidus-paypal-commerce-platform-output.txt.Checklist