Skip to content

Conversation

@AlistairNorman
Copy link
Contributor

Summary

This pulls some of the test refactoring that was done in the in memory order updater PR into its own pull request. We improve some of the test coverage for the regular order updater. These changes were extracted from #5872

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@AlistairNorman AlistairNorman requested a review from a team as a code owner November 20, 2025 19:16
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_promotions Changes to the solidus_promotions gem labels Nov 20, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.45%. Comparing base (f54d7ff) to head (db98d00).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6377   +/-   ##
=======================================
  Coverage   89.45%   89.45%           
=======================================
  Files         974      974           
  Lines       20322    20322           
=======================================
  Hits        18179    18179           
  Misses       2143     2143           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Noah-Silvera and others added 6 commits November 20, 2025 11:53
We were missing a spec for automations like the `CreateDiscountedItem`
benefit.
The new tests use factories to more realistically set up orders,
shipments, and inventory units in various states to simulate order
updater functionality.

Co-authored-by: Alistair Norman <[email protected]>
Co-authored-by: Kendra Riga <[email protected]>
Co-authored-by: Chris Todorov <[email protected]>
Co-Authored-By: Adam Mueller <[email protected]>
Co-Authored-By: Sofia Besenski <[email protected]>
This removes the deprecation warnings from our test suite.

Co-authored-by: Adam Mueller <[email protected]>
Co-authored-by: Kendra Riga <[email protected]>
Co-authored-by: Senem Soy <[email protected]>
We're proposing a new default for this configuration value, so this
change updates the test in the new promotion system to not be dependent
on the current default value.

This test will fail if the default configuration changes.

Co-authored-by: Benjamin Willems <[email protected]>
Co-authored-by: Kendra Riga <[email protected]>
Co-authored-by: Adam Mueller <[email protected]>
Co-Authored-By: Alistair Norman <[email protected]>
Co-Authored-By: Sofia Besenski <[email protected]>
This is calling the recalculate method not update_adjustments.

Co-Authored-By: Adam Mueller <[email protected]>
Co-Authored-By: benjamin wil <[email protected]>
Co-Authored-By: Andrew Stewart <[email protected]>
Co-Authored-By: Harmony Bouvier <[email protected]>
Co-Authored-By: Jared Norman <[email protected]>
Co-Authored-By: Kendra Riga <[email protected]>
Co-Authored-By: Sofia Besenski <[email protected]>
Co-Authored-By: Chris Todorov <[email protected]>
Co-Authored-By: Tom Van Manen <[email protected]>
Co-Authored-By: Noah Silvera <[email protected]>
Co-authored-by: Adam Mueller <[email protected]>
Co-authored-by: Andrew Stewart <[email protected]>
Co-authored-by: Jared Norman <[email protected]>
Co-authored-by: Noah Silvera <[email protected]>
Co-authored-by: benjamin wil <[email protected]>
Co-Authored-By: Sofia Besenski <[email protected]>
Co-Authored-By: Chris Todorov <[email protected]>
@AlistairNorman AlistairNorman force-pushed the improve-order-updater-test-coverage branch from ba0b073 to db98d00 Compare November 20, 2025 19:53
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

Love some love for the test suite.

initializer = SolidusPromotions::Engine.initializers.find { |i| i.name == "solidus_promotions.flickwerk_alias" }
initializer.run
expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("Spree::OrderUpdater")
expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("ThisIsATestClassName")
Copy link
Contributor

Choose a reason for hiding this comment

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

With #6376, we probably don't need the Flickwerk alias to be there anymore. Not blocking, just a note that the feature can be removed.

@adammathys adammathys merged commit 54511c8 into solidusio:main Nov 25, 2025
39 checks passed
@adammathys adammathys deleted the improve-order-updater-test-coverage branch November 25, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem changelog:solidus_promotions Changes to the solidus_promotions gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants