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

Move "thinking cat" fixture to lib folder #3824

Merged
merged 4 commits into from
Nov 4, 2020

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Oct 31, 2020

Description

With the exclusion of the spec folder from the packaged solidus_core gem
in 80bea87, all factories that use an image can now not access that
image when loaded from the lib folder of a packaged gem.

The reason for that is that the image referenced in those factories
lives under spec/fixtures - in the spec folder.

This commit does the simplest thing that could possibly work: Move the
image to the lib/fixtures folder instead and adapt the factories so that
they work even if loaded from the packaged gem.

One could imagine a single-pixel image file instead of an actual JPEG of a thinking cat to conserve space on the many machines this gem runs on. Would that still be in scope?

I would very much like a new version of Solidus to be cut with this change, as 2.11.0 has broken factories because of this.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@mamhoff mamhoff force-pushed the move-file-fixtures-to-gem branch from fc05857 to 8d94aa8 Compare October 31, 2020 14:29
@aldesantis
Copy link
Member

Thanks @mamhoff! 🙏 Do you think it would make more sense to move the image to lib/spree/testing_support/fixtures, since that's where all test-related files live (including the factories)?

@mamhoff
Copy link
Contributor Author

mamhoff commented Nov 2, 2020

Sure! but you know what: When I do that, I might as well also do the 1-pixel-image thing? I mean I don't think it's worth distributing those 20kB that I have not looked at in the however many years I've spent with this software.

@aldesantis
Copy link
Member

Go for it! 👍

@mamhoff mamhoff force-pushed the move-file-fixtures-to-gem branch 2 times, most recently from a059ccf to 45ad4ff Compare November 2, 2020 11:20
With the exclusion of the spec folder from the packaged solidus_core gem
in 80bea87, all factories that use an image can now not access that
image when loaded from the lib folder of a packaged gem.

The reason for that is that the image referenced in those factories
lives under spec/fixtures - in the spec folder.

This commit does the simplest thing that could possibly work: Move the
image to the lib/fixtures folder instead and adapt the factories so that
they work even if loaded from the packaged gem.
This image is only 631 bytes in size, and lives in the correct location
under lib/spree/testing_support in core.
@kennyadsl
Copy link
Member

@mamhoff thanks for this PR! For some reason, CircleCI did not receive the hook for running the CI after the last push. Can you please push again to retrigger it?

@mamhoff mamhoff force-pushed the move-file-fixtures-to-gem branch 2 times, most recently from 7818714 to 851cfec Compare November 3, 2020 18:04
We don't need a thinking cat for testing. A blank, really small image is
enough.
@mamhoff mamhoff force-pushed the move-file-fixtures-to-gem branch from 851cfec to c42e3d7 Compare November 3, 2020 18:15
This image is being replaced with a blank image that lives under
core/lib/spree/testing_support.
@mamhoff mamhoff force-pushed the move-file-fixtures-to-gem branch from c42e3d7 to ae4ed90 Compare November 3, 2020 19:19
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Martin!

@kennyadsl kennyadsl modified the milestones: 2.11, 3.0.0 Nov 4, 2020
@kennyadsl kennyadsl merged commit 0e35bb6 into solidusio:master Nov 4, 2020
@kennyadsl
Copy link
Member

I'm going to backport and release Solidus 2.11.1 tomorrow, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants