test: add partial-tail coverage for parse_vscode_log public API (#1173)#1175
Open
test: add partial-tail coverage for parse_vscode_log public API (#1173)#1175
parse_vscode_log public API (#1173)#1175Conversation
Add three tests to TestParseVscodeLog that exercise the documented include_partial_tail=True contract through the public parse_vscode_log API: 1. Single-line file without trailing newline 2. Mixed file with complete lines followed by a partial tail 3. Regression contrast confirming the private default differs These tests ensure that changing include_partial_tail=True to False on line 322 of vscode_parser.py would cause at least one test failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR closes the test gap around parse_vscode_log’s documented partial-tail behavior in the VS Code log parser. It strengthens regression protection for the public API without changing production code.
Changes:
- Adds a public-API test covering a single unterminated final log line.
- Adds a public-API test covering complete lines followed by an unterminated final line.
- Adds a contrast test confirming the private incremental parser still excludes partial tails by default.
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.
Closes #1173
Summary
Adds three tests to
TestParseVscodeLogintests/copilot_usage/test_vscode_parser.pythat exercise the documentedinclude_partial_tail=Truecontract through the publicparse_vscode_logAPI.Tests Added
test_parse_vscode_log_includes_partial_tail_single_line— verifies the request is returned when the only line in the file lacks a trailing\n.test_parse_vscode_log_includes_partial_tail_after_complete_lines— verifies all three lines are returned when the final ccreq line is unterminated.test_private_default_excludes_partial_tail— regression contrast confirming_parse_vscode_log_from_offsetwith defaultinclude_partial_tail=Falsedrops the unterminated line, pinning the semantic difference between the public and private APIs.Regression Guard
Changing
include_partial_tail=True→Falseon line 322 ofvscode_parser.pynow causes tests 1 and 2 to fail.Notes
_make_log_linehelper for consistency.Warning
The following domains were blocked by the firewall during workflow execution:
astral.shpypi.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.