-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add shebang functionality to tests #1784
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1784 +/- ##
===========================================
+ Coverage 37.05% 48.16% +11.10%
===========================================
Files 62 62
Lines 6499 6499
Branches 1438 1561 +123
===========================================
+ Hits 2408 3130 +722
+ Misses 3898 3120 -778
- Partials 193 249 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
What is a concrete benefit of making these test files executable other than we don't need to type |
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 nifty, I like it!
@ekzhu : The main benefit derives from a simple empirical observation: if running test cases is easy, then contributors tend to run tests more often, add new test cases, and perceive that the validation system helps them to be more effective. A secondary purpose is to enable those contributors who use Unix-based operating systems (or even WSL on Windows) to use the workflow they are used to. |
@jackgerrits : Thank you! Shebang for the win! ;-) |
Tests that contain `if __name__ == "__main__":` now have a shebang line and execute permission.
0bca1c9
to
ecdec15
Compare
Tests that contain `if __name__ == "__main__":` now have a shebang line and execute permission.
Tests that contain
if __name__ == "__main__":
now have a shebang line and execute permission.Why are these changes needed?
The main reason for these changes is increased developer productivity and shortening the validation cycle. This functionality enables executing tests directly from the shell. We use the shebang functionality and execute permissions. The end result looks like this:
This is the blunt logic (there probably is a more elegant way to accomplish this ;-)) that I used to make the updates on macOS:
Discussion points:
if __name__ == "__main__":
part to make running them easier? Currently they don't, potential follow-up work here.Related issue number
N/A
Checks