Fix mgrep watch for Windows and add CI hooks tests#27
Open
Conversation
- Change python3 to python in hook.json (python3 doesn't exist on Windows) - Use shutil.which() to find mgrep executable (Windows subprocess doesn't find .cmd files by base name) - Make postbuild script cross-platform (chmod doesn't exist on Windows) - Update tests to mock shutil.which Tested manually on Windows 10: - Hook launches mgrep watch successfully with CREATE_NEW_PROCESS_GROUP - PID file created in %TEMP% - Kill hook terminates process and cleans up PID file - All 5 unit tests pass
Author
|
the tests can go they were place holders but fully tested on my windows 10/11 now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Make mgrep watch/kill hooks Windows-compatible with temp-dir handling, add Python unit tests and a Windows/Ubuntu CI job, and adjust postbuild for Windows.
plugins/mgrep/hooks/mgrep_watch.py:TMP_DIRfromMGREP_TMP/system temp; write logs/PIDs there.mgrepviashutil.which.CREATE_NEW_PROCESS_GROUP; POSIX: useos.setsid.launch_watchhelper.plugins/mgrep/hooks/mgrep_watch_kill.py:SIGTERM; POSIX: useSIGKILL.kill_watchhelper.plugins/mgrep/hooks/hook.json: invoke withpythoninstead ofpython3.package.json: makepostbuildchmod no-op on Windows..github/workflows/ci.yml: addhooks-testsmatrix (Ubuntu/Windows), run Python unit tests, and a Windows smoke import check.Written by Cursor Bugbot for commit 77fa3e1. This will update automatically on new commits. Configure here.