optimise batch report#475
Open
rhaegar325 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #475 +/- ##
=====================================
Coverage 78.4% 78.4%
=====================================
Files 33 33
Lines 6483 6491 +8
Branches 1226 1228 +2
=====================================
+ Hits 5082 5090 +8
Misses 1128 1128
Partials 273 273
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Improve JSON readability of batch report failures
Background
In the
moppy_batch_report.jsonproduced bybatch_processing, each entry in thefailuressection is hard to read: botherror_messageandstderr_tailhold multi-line text. Once JSON-escaped (newlines become\n), they collapse into a single very long line.Changes
Multi-line fields in failure entries are now emitted as arrays of lines, so that with
json.dumps(indent=2)each line renders on its own row._as_lines()helper: empty →None, single line → plain string, multi-line → list of lines._stderr_tailreturn type tostr | list[str] | None(string for a single line, list for multiple lines); no longer uses"\n".join._as_linestoerror_messagein bothtasksandfailures, keeping the field type consistent.SCHEMA_VERSIONfromv1tov2(field shape changed).Before / After
Before (one very long line):
After (one line per entry):
Short messages (e.g.
"input missing") stay plain strings.Compatibility
Testing
stderr_tailand schema-version assertions._as_linesbehavior test and a multi-lineerror_messagesplitting test.tests/unit/test_batch_report.py: 25 passed.