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
spec_helper refactoring and fixing Scan tests #14503
Conversation
Uh-oh, I've no idea what happened on AppVeyor. Time to dust off my virtualbox and download some Windows images. |
The tests failing are those which were not running before the fix. See #14502 which "breaks" them but they keep passing.. Looks like they are severely out of date and can be removed. WDYT? |
Ugh, I had looked at that Left some comments. A guess regarding the two failing tests: Maybe the Slack part of |
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.
Hey, glad this sorts things out! I was actually fixing a Windows-specific issue in documentation generator and while writing a test, I needed to temporarily change environment.
I think the tests were written for Slack::Notifier
, which no longer exists, and instead has SlackAction
. Here's the PR that would break those tests, should they have run by that time: #13791.
Oh, pretty recent that test even. Well, I think nobody will miss those tests then. Bye 👋 |
After sitting for a while staring at the code over the weekend, I decided that it's worth fixing these tests. PTAL? |
Yep, tests look right to me (although the last one threw me a bit, but as it passes this seems to be an appropriate way to ensure the call is doing what it should). And: TIL |
Yes, I think this reaction on the test is appropriate. I had to use something I've never tried before ( Haha, please pardon me this uncalled for "l33t sp3ak" outbreak, it is too addictive. |
Is there anything else I can do for this PR? |
No, I think we are just waiting for someone with more ruby chops to come along from the team and leave an "Approve" review. I don't fully trust myself here. |
Hey there friendly Fastlane team, may I humbly request some feedback for this PR? It's blocking some of the further contributions I have in queue. |
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.
Look good from my side, but needs some more eyes from someone with more ruby.
(Pinged the appropriate people in the background @dotdoom)
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.
This is soooooo 💯 Thanks for taking the time to clean up our tests ❤️ ❤️ ❤️
Hey @dotdoom 👋 Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉 Please let us know if this change requires an immediate release by adding a comment here 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.122.0 🚀 |
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 validMotivation and Context
with_env_values
) are defined in more than onespec_helper.rb
, with the same signatures and functionalityfastlane/fastlane_core/spec/spec_helper.rb
Lines 36 to 43 in 875e348
stubbing.rb
does not seem to add any value, so I simply moved its content intospec_helper.rb
to have less entities. If the team feels strongly about having it as a separate file, I will delete that commit from this PRwith_...
methods (some more permissive than others) I picked / reimplemented with the following principles:with_...
methods in rspec. Ruby developers would expect it to take a block). Despitestub_const
looks very pretty to use, it does not allow to limit scope (the scope always equals that of the wholeit
block) and requires a different naming convention (ex.:stub_env_values
)ENV['MYVAR']
does the same).