As @yahonda suggested in tests not being picked up on a brand new plugin · Issue #56406 · rails/rails · GitHub , there is a workaround that involves specifying it in an application’s Gemfile. However, for many Rails users, it would be better if the issue could be resolved simply by running bundle update to upgrade to the newly released Rails versions 8.1.2 and 8.0.5, rather than having to write a workaround themselves.
Rails depends on many gems, and upper version limits using < are typically not set for those dependencies. This is because the impact of new gem versions on Rails cannot be predicted in advance. Breaking changes that affect Rails’ behavior may or may not exist in major versions of dependent gems.
Setting upper limits with < would protect against breaking changes in new versions, but it would also prevent users from taking advantage of new features.
Regarding the recent minitest changes: after minitest 6 support was added to the main branch, The changes were backported to 8-1-stable and 8-0-stable. However, for 7-2-stable, a version restriction was applied instead, because the changes require required_ruby_version to be 3.2, while Rails 7.2 must continue to support Ruby 3.1. Since Rails 7.2 is now in security-fix-only mode, no release incorporating this fix will be made. Rails 7.2 users will need to manually restrict minitest to below version 6 in their application’s Gemfile.
As shown above, responses to new versions of dependent gems are handled on a case-by-case basis. Since our dependency configuration is kept open to new versions, patches are not immediately released for every behavioral change caused by gem updates. Instead, these fixes are included in patch versions that are released periodically. In the meantime, necessary workarounds may be available, which is why I added additional comments.