Skip to content

🧪 Add comprehensive tests for src/tools.py#17

Merged
badMade merged 5 commits into
mainfrom
testing-improvement-tools-2064790158391162633
Apr 22, 2026
Merged

🧪 Add comprehensive tests for src/tools.py#17
badMade merged 5 commits into
mainfrom
testing-improvement-tools-2064790158391162633

Conversation

@badMade

@badMade badMade commented Apr 16, 2026

Copy link
Copy Markdown
Owner

This commit introduces a new test file tests/test_tools.py which provides unit tests for all functions in src/tools.py, including build_tool_backlog, load_tool_snapshot, get_tool, and others.

Key improvements:

  • Verified build_tool_backlog returns correct PortingBacklog structure.
  • Added case-insensitive matching tests for get_tool.
  • Validated filtering logic in get_tools and filter_tools_by_permission_context.
  • Ensured execute_tool correctly handles both success and failure cases.
  • Added .port_sessions/ to .gitignore to prevent local session logs from being committed.

Test coverage:

  • 9 new unit tests covering 100% of the public functions in src/tools.py.
  • All 31 tests in the repository pass.

This commit introduces a new test file `tests/test_tools.py` which provides unit tests for all functions in `src/tools.py`, including `build_tool_backlog`, `load_tool_snapshot`, `get_tool`, and others.

Key improvements:
- Verified `build_tool_backlog` returns correct `PortingBacklog` structure.
- Added case-insensitive matching tests for `get_tool`.
- Validated filtering logic in `get_tools` and `filter_tools_by_permission_context`.
- Ensured `execute_tool` correctly handles both success and failure cases.
- Added `.port_sessions/` to `.gitignore` to prevent local session logs from being committed.

Test coverage:
- 9 new unit tests covering 100% of the public functions in `src/tools.py`.
- All 31 tests in the repository pass.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive test suite for tool-related functionality in tests/test_tools.py and updates the .gitignore to exclude session logs. Feedback focuses on removing several session log files that were accidentally committed to the .port_sessions/ directory and strengthening the simple_mode test case to ensure it does not pass on an empty result set.

Comment thread .port_sessions/03690d189e3a47a7988752f670bee42e.json
Comment thread tests/test_tools.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new unittest suite to exercise the public API in src/tools.py, and updates ignore rules for locally persisted porting sessions.

Changes:

  • Introduces tests/test_tools.py with unit tests covering snapshot loading, tool lookup/filtering, execution, and index rendering.
  • Adds .port_sessions/ to .gitignore to avoid committing locally saved session artifacts.
  • Includes several .port_sessions/*.json session log files in the PR (these appear to be local artifacts).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_tools.py Adds unit tests for the src.tools API surface.
.gitignore Ignores local .port_sessions/ directory.
.port_sessions/af1faf843fab41fbbfad064544248ef5.json Adds a persisted session log file (likely unintended to commit).
.port_sessions/58914d03e535496e9da6b526139f7371.json Adds a persisted session log file (likely unintended to commit).
.port_sessions/50ed5c42f34b48e0b5d11332cc3bd467.json Adds a persisted session log file (likely unintended to commit).
.port_sessions/03690d189e3a47a7988752f670bee42e.json Adds a persisted session log file (likely unintended to commit).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_tools.py Outdated
Comment thread tests/test_tools.py Outdated
badMade and others added 4 commits April 15, 2026 21:43
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@badMade badMade merged commit 9ec2e9d into main Apr 22, 2026
4 checks passed
@badMade badMade deleted the testing-improvement-tools-2064790158391162633 branch April 22, 2026 16:58
@badMade

badMade commented Apr 22, 2026

Copy link
Copy Markdown
Owner Author

@copilot code review

@badMade

badMade commented Apr 22, 2026

Copy link
Copy Markdown
Owner Author

@claude code review

@badMade badMade requested a review from Copilot April 22, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .port_sessions/af1faf843fab41fbbfad064544248ef5.json
Comment thread .port_sessions/58914d03e535496e9da6b526139f7371.json
Comment thread .port_sessions/50ed5c42f34b48e0b5d11332cc3bd467.json
Comment thread .port_sessions/03690d189e3a47a7988752f670bee42e.json
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.

5 participants