Skip to content

fix(test): optimize Tkinter test suite and configure pytest-tkl-optimizer plugin - #472

Merged
MarkSant merged 1 commit into
mainfrom
fix/tkinter-test-suite-optimization
Aug 15, 2026
Merged

fix(test): optimize Tkinter test suite and configure pytest-tkl-optimizer plugin#472
MarkSant merged 1 commit into
mainfrom
fix/tkinter-test-suite-optimization

Conversation

@MarkSant

Copy link
Copy Markdown
Owner

Summary

  • Activate and configure local plugin .agents/plugins/pytest-tkl-optimizer/ with guidelines in rules/pytest.md.
  • Refactor tests/ui/test_zone_controls_multi_aquarium.py to use canonical tkinter_root session fixture and add @pytest.mark.gui marker.
  • Make tests/ui/components/test_processing_reports_widget.py::test_right_click_emits_event deterministic by mocking tree row/column resolution, eliminating test skipping on unmapped windows and verifying payload assertions against UIEvents.PROCESSING_REPORTS_ITEM_RIGHT_CLICK.
  • Exclude .lnk files in .gitignore and sync legacy documentation ahead of the v6.0.0 archival milestone.

Validation

  • GUI Test Suite (pytest -m gui -n0 --no-cov): 1114 passed, 0 skipped, 0 failed in 51.17s (~45% speedup).
  • Fast Test Suite (pytest -m "not (gui or slow or ttkbootstrap_singleton)" --no-cov): 4231 passed in 169.62s.
  • Linters and Types: ruff check, ruff format, markdownlint, and mypy all passed with 0 errors.

…izer plugin

- Add pytest-tkl-optimizer plugin configuration and guidelines in rules/pytest.md
- Refactor test_zone_controls_multi_aquarium.py to use canonical tkinter_root fixture and @pytest.mark.gui
- Fix test_processing_reports_widget.py::test_right_click_emits_event to be deterministic and avoid unmapped tree skips
- Update .gitignore for Windows shortcuts and sync legacy archive documentation
Copilot AI lite review requested due to automatic review settings August 15, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves the reliability and runtime of the Tkinter GUI test suite by standardizing on the canonical Tkinter root fixtures, removing environment-dependent skips, and documenting/packaging local guidance for Tkinter pytest practices. It also tidies archival documentation and ignores Windows .lnk shortcuts.

Changes:

  • Standardize Tkinter GUI tests on the shared tkinter_root fixture and apply the gui marker consistently.
  • Make ProcessingReportsWidget right-click tests deterministic by mocking tree hit-testing and asserting the exact EventBusV2.publish() call payload.
  • Refresh legacy archive docs by removing inappropriate-for-public-archive artifacts and updating the archive README; extend .gitignore to ignore *.lnk.

Reviewed changes

Copilot reviewed 9 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/ui/test_zone_controls_multi_aquarium.py Switches tests to the canonical tkinter_root fixture and marks the module as GUI tests.
tests/ui/components/test_processing_reports_widget.py Removes environment-dependent skipping by mocking Treeview hit-testing and asserting deterministic event publishing.
docs/archive/legacy/fapesp/README.md Clarifies what remains in the public legacy archive and what was removed ahead of the archival snapshot.
docs/archive/legacy/fapesp/proposals/Projeto_Consolidado_Mudanca_Prorrogacao_Excepcional_v1.md Removes proposal draft content from repository HEAD (legacy archival cleanup).
docs/archive/legacy/fapesp/finance/Tabela Itens e Notas FAPESP - 2025.csv Removes finance spreadsheet content from repository HEAD (legacy archival cleanup).
.mcp.json Removes a tracked MCP config file (repo already treats it as gitignored configuration).
.gitignore Ignores Windows shortcut files (*.lnk).
.agents/plugins/pytest-tkl-optimizer/rules/pytest.md Adds local guidelines for writing and running non-blocking Tkinter pytest GUI tests.
.agents/plugins/pytest-tkl-optimizer/plugin.json Registers the local agent/plugin metadata for the pytest Tkinter optimizer instructions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to +5
{
"$schema": "https://antigravity.google/schemas/v1/plugin.json",
"name": "pytest-tkl-optimizer",
"description": "Custom agent instructions for generating non-blocking Tkinter pytests."
}
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkSant
MarkSant merged commit e08ccc9 into main Aug 15, 2026
7 checks passed
@MarkSant
MarkSant deleted the fix/tkinter-test-suite-optimization branch August 15, 2026 19:35
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