-
Notifications
You must be signed in to change notification settings - Fork 2
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
improve mocking framework for tests #871
Conversation
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.
I like it! 🧹
|
||
Process.sleep(50) | ||
assert Engine.Config.sign_config("chelsea_outbound", :auto) == :off | ||
end |
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.
What do these removals relate to? Not sure how they tie into the mocking changes.
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.
Oh, this leaked through from another change I was testing, but backed out. I was seeing if we could disable the application entirely in test mode to further reduce log spam. There were a handful of tests that failed because they access the actual application processes.
Even though it's unrelated, this still seems worth keeping, because this style of test is unnecessarily brittle for what it's doing. The two deleted cases were duplicated by other tests later in the file, and the third one is rewritten to use the more isolated approach.
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.
Gotcha. I'd agree this seems brittle, and if the behavior is already covered by other tests, no problem with removing these.
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.
✨
Summary of changes
This makes several improvements related to mocking and test infrastructure.
capture_log
option, eliminating log spam when running tests (logs will still be printed if a test fails).