fix(py): relocate tools of model-config test and sample-flow test#4669
fix(py): relocate tools of model-config test and sample-flow test#4669MengqinShen wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello @MengqinShen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Python sample testing infrastructure by relocating different testing tools into dedicated subdirectories. This change aims to improve the modularity and maintainability of the test suite, making it easier to manage and extend specific types of tests. The update also includes necessary adjustments to paths, dependency configurations, and enhances the output format for model configuration tests. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the model configuration and sample flow testing tools by relocating them into subdirectories. The changes are mostly file moves and path updates in scripts and configuration files. I've provided one suggestion to improve the error handling in one of the test scripts to make it more robust.
| except Exception: # noqa: S110 - intentionally silent, error handled by returning result dict | ||
| pass |
There was a problem hiding this comment.
The except Exception block currently uses pass, which means if an unexpected error occurs in the try block (e.g., during json.loads or asyncio.run), the script will exit silently without producing any output. The parent process, which expects a JSON output, will then fail with a less informative JSON decoding error. It would be more robust to handle this exception by printing a JSON object that indicates failure, similar to how errors are handled within the run_model_test function. This will ensure the parent script always receives a parsable JSON response and can report the specific error that occurred.
| except Exception: # noqa: S110 - intentionally silent, error handled by returning result dict | |
| pass | |
| except Exception: # noqa: S110 - error is captured and reported as JSON | |
| import traceback | |
| result = { | |
| 'success': False, | |
| 'response': None, | |
| 'error': f'Unexpected error in test script:\n{traceback.format_exc()}', | |
| 'timing': 0.0, | |
| } | |
| print(f'---JSON_RESULT_START---\n{json.dumps(result)}\n---JSON_RESULT_END---') |
No description provided.