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

Fix tests for minitest 5.16 #45370

Merged
merged 1 commit into from
Jun 23, 2022
Merged

Conversation

eileencodes
Copy link
Member

@eileencodes eileencodes commented Jun 15, 2022

In minitest/minitest@6e06ac9 minitest changed such that it now accepts
kwargs instead of requiring kwargs to be shoved into the args array.
This is a good change but required some updates to our test code to get
the new version of minitest passing.

Changes are as follows:

  1. Lock minitest to 5.15 for Ruby 2.7. We don't love this change but
    it's pretty difficult to get 2.7 and 3.0 to play nicely together with
    the new kwargs changes. Dropping 2.7 support isn't an option right
    now for Rails. This is safe because all of the code changes here are
    internal methods to Rails like assert_called_with. Applications
    shouldn't be consuming them as they are no-doc'd.
  2. Update the assert_called_with method to take any kwargs but also
    the returns kwarg.
  3. Update callers of assert_called_with to move the kwargs outside the
    args array.
  4. Update the message from marshaled exceptions. In 5.16 the exception
    message is "result not reported" instead of "Wrapped undumpable
    exception".

Co-authored-by: Matthew Draper matthew@trebex.net

In minitest/minitest@6e06ac9 minitest changed such that it now accepts
`kwargs` instead of requiring kwargs to be shoved into the args array.
This is a good change but required some updates to our test code to get
the new version of minitest passing.

Changes are as follows:

1) Lock minitest to 5.15 for Ruby 2.7. We don't love this change but
it's pretty difficult to get 2.7 and 3.0 to play nicely together with
the new kwargs changes. Dropping 2.7 support isn't an option right
now for Rails. This is safe because all of the code changes here are
internal methods to Rails like assert_called_with. Applications
shouldn't be consuming them as they are no-doc'd.
2) Update the `assert_called_with` method to take any kwargs but also
the returns kwarg.
3) Update callers of `assert_called_with` to move the kwargs outside the
args array.
4) Update the message from marshaled exceptions. In 5.16 the exception
message is "result not reported" instead of "Wrapped undumpable
exception".

Co-authored-by: Matthew Draper <matthew@trebex.net>
@eileencodes eileencodes merged commit b55e834 into rails:main Jun 23, 2022
@eileencodes eileencodes deleted the fix-minitest-kwargs branch June 23, 2022 12:52
@pvalena
Copy link
Contributor

pvalena commented Jun 8, 2023

  • or there was additional incompatibility, I'll check.

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

Successfully merging this pull request may close these issues.

None yet

2 participants