Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Coverage dropped below thresholds (38%) after adding the logs feature. Added comprehensive unit tests for all new logs modules.

Tests Added

  • src/logs/log-parser.test.ts - Squid log line parsing, domain extraction, CONNECT/HTTPS handling
  • src/logs/log-formatter.test.ts - Raw/pretty/JSON output formats, colorization, port display logic
  • src/logs/log-discovery.test.ts - Container detection, preserved log discovery, AWF_LOGS_DIR support
  • src/logs/log-streamer.test.ts - Container streaming via docker exec, file reading, tail -f following
  • src/commands/logs.test.ts - Command handler: list mode, source selection, error handling

Coverage

Metric Before After Threshold
Statements 32% 64% 38%
Branches 25% 58% 30%
Functions 33% 65% 35%
Lines 33% 64% 38%

New logs modules now at 96%+ coverage.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add log management commands and utilities for squid proxy logs test: add unit tests for logs feature to meet coverage thresholds Nov 28, 2025
Copilot AI requested a review from Mossaka November 28, 2025 00:43
Copilot finished work on behalf of Mossaka November 28, 2025 00:43
@Mossaka Mossaka marked this pull request as ready for review December 1, 2025 19:48
@Mossaka Mossaka merged commit beac47f into better-logs-command-dir Dec 1, 2025
@Mossaka Mossaka deleted the copilot/sub-pr-72 branch December 1, 2025 19:48
Mossaka added a commit that referenced this pull request Dec 2, 2025
* Initial plan

* test: add unit tests for logs feature to meet coverage thresholds

Co-authored-by: Mossaka <[email protected]>

* refactor: use proper imports instead of require in tests

Co-authored-by: Mossaka <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Mossaka <[email protected]>
Mossaka added a commit that referenced this pull request Dec 3, 2025
…72)

* feat: add log management commands and utilities for squid proxy logs

Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>

* docs: add documentation for awf logs command (#73)

* Initial plan

* docs: add documentation for awf logs command

Co-authored-by: Mossaka <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Mossaka <[email protected]>

* test: add unit tests for logs feature to meet coverage thresholds (#79)

* Initial plan

* test: add unit tests for logs feature to meet coverage thresholds

Co-authored-by: Mossaka <[email protected]>

* refactor: use proper imports instead of require in tests

Co-authored-by: Mossaka <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Mossaka <[email protected]>

* feat(cli): support --proxy-logs-dir

Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>

---------

Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Mossaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants