Skip to content

test: add partial-tail coverage for parse_vscode_log public API (#1173)#1175

Open
microsasa wants to merge 1 commit intomainfrom
fix/1173-parse-vscode-log-partial-tail-tests-2dc0faa85435cd8f
Open

test: add partial-tail coverage for parse_vscode_log public API (#1173)#1175
microsasa wants to merge 1 commit intomainfrom
fix/1173-parse-vscode-log-partial-tail-tests-2dc0faa85435cd8f

Conversation

@microsasa
Copy link
Copy Markdown
Owner

Closes #1173

Summary

Adds three tests to TestParseVscodeLog in tests/copilot_usage/test_vscode_parser.py that exercise the documented include_partial_tail=True contract through the public parse_vscode_log API.

Tests Added

  1. 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.
  2. test_parse_vscode_log_includes_partial_tail_after_complete_lines — verifies all three lines are returned when the final ccreq line is unterminated.
  3. test_private_default_excludes_partial_tail — regression contrast confirming _parse_vscode_log_from_offset with default include_partial_tail=False drops the unterminated line, pinning the semantic difference between the public and private APIs.

Regression Guard

Changing include_partial_tail=TrueFalse on line 322 of vscode_parser.py now causes tests 1 and 2 to fail.

Notes

  • Test-only change — no production code modified.
  • Uses the existing _make_log_line helper for consistency.

Warning

⚠️ Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • astral.sh
  • pypi.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "astral.sh"
    - "pypi.org"

See Network Configuration for more information.

Generated by Issue Implementer · ● 5.4M ·

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>
Copilot AI review requested due to automatic review settings May 3, 2026 14:33
@microsasa microsasa added the aw Created by agentic workflow label May 3, 2026
@microsasa microsasa enabled auto-merge May 3, 2026 14:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aw Created by agentic workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw][test audit] parse_vscode_log partial-tail contract untested via public API

2 participants