-
Notifications
You must be signed in to change notification settings - Fork 32
Refactoring the reftests. #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 refactors the reftests plugin from a monolithic single-file structure into a well-organized modular architecture, improving code maintainability and separation of concerns.
Key Changes:
- Extracts a 523-line monolithic
reftest.pyinto separate modules with clear responsibilities - Separates HTML/CSS/JavaScript from Python code into dedicated static asset files
- Introduces a
WebReportclass to encapsulate report generation logic - Creates utility functions for file fetching and message retrieval
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
meta/plugins/reftest.py |
Deleted - replaced by modular structure in reftests/ directory |
meta/plugins/__init__.py |
Updated import to use new reftests module instead of old reftest |
meta/plugins/reftests/__init__.py |
New module initialization file |
meta/plugins/reftests/reftest.py |
Main reftest logic extracted and cleaned up from original file |
meta/plugins/reftests/utils.py |
Utility functions for file/message fetching extracted from main module |
meta/plugins/reftests/WebReport.py |
Web report generation logic encapsulated in dedicated class |
meta/plugins/reftests/report.js |
JavaScript code extracted from inline HTML string to separate file |
meta/plugins/reftests/report.css |
CSS styles extracted from inline HTML string to separate file |
| print(f"Running {file.relative_to(TESTS_DIR)}...") | ||
|
|
||
| def getContainer(test_content: str) -> str | None: | ||
| searchContainer = re.search(r"""<container>([\w\W]+?)</container>""", test) |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable test_content used instead of test in function call. The function parameter is named test_content, but the function body references a variable test on line 239 that doesn't exist in this scope, which will cause a runtime error.
| searchContainer = re.search(r"""<container>([\w\W]+?)</container>""", test) | |
| searchContainer = re.search(r"""<container>([\w\W]+?)</container>""", test_content) |
No description provided.