-
Notifications
You must be signed in to change notification settings - Fork 39
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
Modernize scripts in bin/ #2679
Conversation
34f9aa7
to
88f57c7
Compare
This had to be too easy. What did I miss? |
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.
As you write, this seemed too easy. There's still some work left, but it's beautiful so far :-)
Yes, moving the scripts is easy, but finding all the references to them, and tests for them is more difficult. In particular, you have some failing tests that look for the binaries under their old names (not the generated tests).
We don't have proper tests that test for consistency when it comes to cron jobs, for example. See all crontab snippets in this directory:
Also see daemon config in this file:
An extensive search in the codebase for any of the script names that originally ended in .py
would be wise.
Tests for Cron-files and daemon.yml updated. After running |
9588f5a
to
983bf4d
Compare
0db1c96
to
ba8d9ee
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.
Can't put my finger on anything but the failing tests for now. Sudo issues, I assume.
Get the tests running, and I'll approve :)
8e9e806
to
ba05910
Compare
The tests are all green when running locally with the test docker setup. I can't seem to make them green on gihub. What is currently happening is that each script is executed in situ, with hardcoded paths to |
6b0b038
to
a708cad
Compare
26cddf9
to
e8be647
Compare
I was able to reproduce the GitHub issue locally by adding The failing tests are more or less designed to run the installed version of the executable, which is the only "sane" way to ensure sudo-to-root knows how to run it using the correct python interpreter and environment. As a nice "bonus", you also get to verify that the installation of the executable |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2679 +/- ##
==========================================
- Coverage 57.18% 56.69% -0.49%
==========================================
Files 568 602 +34
Lines 41301 43971 +2670
==========================================
+ Hits 23617 24931 +1314
- Misses 17684 19040 +1356 ☔ View full report in Codecov by Sentry. |
5e60889
to
5531f5a
Compare
6afb01d
to
2e6abf5
Compare
26cbaa8
to
4330753
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.
Looks good to me! Glad to get it done!
My last addition is an entry to the release notes, as this change may require action from users on an upgrade.
Not all scripts had a sufficiently pure main()-function. Also, remove bindir-magic from setup.py.
This makes it possible for all the other scripts to find nav itself. It will still be installed in a bin-dir as "nav".
All scripts installed via entrypoints needs to have an importable callable. This script lacked that.
This makes sudo available in the Docker-based test environment, in order to make the environment slightly more similar to GitHub Actions (which doesn't feature gosu). With sudo it is easier to locally reproduce sudo-related problems observed on GitHub actions.
Co-authored-by: Morten Brekkevold <[email protected]>
49f747f
to
300d891
Compare
Closes #2676