Update Simple Scheduler Testing to Modern Ruby/ActiveJob/Sidekiq#67
Merged
bmedenwald merged 7 commits intosimplymadeapps:masterfrom Nov 14, 2025
Merged
Conversation
…iq. Also fix Rubocop to keep dependencies in gemspec.
…ator to time. This was required because when using time travel in testing it was completely overwriting our At class and breaking all the tests.
…nd nil blows that up.
…e to the At class.
… the images have been broken for some time.
f0a7934 to
66b63cc
Compare
brianpattison
approved these changes
Nov 14, 2025
Collaborator
brianpattison
left a comment
There was a problem hiding this comment.
I had to look up how the heck SimpleDelegator works 😜, but looks good!
Contributor
Author
|
Me too @brianpattison |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request started as just a modernization of the appraisal matrix to run against modern versions of ActiveJob, Ruby, and Sidekiq. Unfortunately it ballooned from there due to the tests all being broken because of changes to ActiveSupport in 7.x (major change to time travel in test helpers) and Sidekiq in 7.x (minor type casting change).
This can be reviewed commit-by-commit to separate changes. Notes below for each commit.
add_development_dependencyto continue without error.Atclass. This was the big change, and necessary, because of the changes to ActiveSupport's time travel test helper. Starting sometime in ActiveSupport 7, the time travel test helper overwritesTime. Because ourAtclass inherits fromTime, it too was being overwritten. Therefore, all tests were broken. To resolve this, I've reworked the class to useSimpleDelegatorinstead. This allows for__getobj__to referencing methods in Time without inheriting. It's essentially a class of its own, yet delegates toTimewhen needed. I renamed a few variables for clarity and removed an unnecessaryfreezepointed out by Rubocop.scoreand casts it to a float, breaking ifnilis handed in. Changed our tests to hand in an integer like the rest of the tests.Atclass, I bumped to 2.0.