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 minitest setup code and make minitest support scenarios run at least one test #921

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

mvz
Copy link
Contributor

@mvz mvz commented Apr 1, 2024

Summary

Make minitest scenarios run at least one test so test summary is displayed.

Details

This change fixes the name of the test method in the minitest scenario so minitest actually recognizes it as a test. It also updates the setup code which was outdated. This was never noticed because it was not run.

It also updates the minitest initializer so it generates a dummy test, and fixes the test setup that it generates.

Motivation and Context

Due to how test success is checked, the failure to run at least one test was never noticed. A change in behavior in minitest exposed the problem by making nearly all CI jobs fail. See minitest/minitest#986.

How Has This Been Tested?

The failing scenarios now pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Internal change (refactoring, test improvements, developer experience or update of dependencies)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Due to how test success is checked, the failure to run at least one test
was never noticed. A change in behavior in minitest exposed the problem.
See minitest/minitest#986.
@mvz
Copy link
Contributor Author

mvz commented Apr 1, 2024

Another scenario is failing which really should have zero tests run 😢

mvz added 2 commits April 1, 2024 10:18
This makes the minitest initializer create a dummy test so
- the test code gets exercised on the first run
- minitest will output the number of tests run in version 5.22 (see
  minitest/minitest#986)

It also fixes the setup code which was now finally tested and found
failing.
This removes some boilerplate closing and reopening of modules.
@mvz mvz changed the title Make minitest support scenario run at least one test Fix minitest setup code and make minitest support scenarios run at least one test Apr 1, 2024
@mvz
Copy link
Contributor Author

mvz commented Apr 1, 2024

The RuboCop failure will be fixed in a separate pull request.

@mvz mvz merged commit 92306fb into main Apr 1, 2024
17 of 18 checks passed
@mvz mvz deleted the fix-minitest-scenario branch April 1, 2024 09:03
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.

None yet

1 participant