-
Notifications
You must be signed in to change notification settings - Fork 47
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
Ensure log truncations are at nearest newline after truncation size #62
base: main
Are you sure you want to change the base?
Conversation
It's great to see a more complete solution to this! I tried running the tests on your branch, but a few of them failed.
|
@macifell thanks for the review, I'll take a look. |
77cc94c
to
3ecf989
Compare
@macifell The issue was that the tests were sensitive to the line ending. I've created a .gitattributes file to ensure that the log files have LF only. I rewrote the history of that branch. |
3ecf989
to
5d3ee89
Compare
Thanks @ccrighton! The tests all pass for me now. |
I reviewed #41 and found that it didn't behave consistently.
The behaviour expected is to truncate the file at the new line immediately after the truncation break point is reached. This means the truncation is always at least as small as requested. There is also cases at the start and end of file in #41 that do not behave rationally.
I would recommend this PR instead of #41.
Run the test cases with:
python -m unittest tests/*_test.py -v
Here is the test case results from #41 using the unit tests from this PR: