-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[scan] fix regressions in unit tests #21729
Conversation
345b526
to
4a0b35a
Compare
4a0b35a
to
e10f528
Compare
e10f528
to
60cd431
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wuaar1003 thanks for this follow-up PR! 🙏
It seems to me that, conceptually/semantically, a "nil" value would make more sense than a "Version of 0", no? Could we work around the issue observed while keep using nil? Of course, this would mean not attempting to instantiate a Gem::Version.new(nil)
but instead guarding against that scenario from happening completely
Was reviewing this PR and was about to say the same before seeing Roger's comment already mentioning it 😄 I agree that still returning |
@wuaar1003 I've made a PR to address the code review. wuaar1003#1 |
Thanks @lacostej I've reviewed your PR there :) IMO you can merge that in here after that comment is addressed, so we can run the test suite and see if everything checks out |
Thanks for the helpful feedback and PR. It turns out that I did experiment with using The reason why tests are timing out is because caching does not capture
Thus, we will be doing output parsing every time for OS types which do not have a default. IIRC, this was my rationale for using version Apologies for not staying on top of this. I don't foresee having the bandwidth to track this actively so will close for now. |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
Resolves #21728
Description
Return version
0
instead ofnil
for correct memoization, which also resolves the issue of passingnil
toGem::Version
Testing Steps
New unit test to exercise code path.