-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve nightly tests #13903
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
Improve nightly tests #13903
Conversation
Summary of ChangesHello @Kangyan-Zhou, 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 nightly test trace publishing script to support collecting and uploading trace files from multiple source directories. This enhancement improves the flexibility and efficiency of the trace collection process, enabling better utilization of test results by consolidating data from various test runs or configurations into a single published artifact. Highlights
Ignored Files
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.
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 refactors the trace publishing script to support multiple trace directories, which is a good improvement for flexibility. A new function collect_all_trace_files has been introduced to gather files from multiple sources, and the command-line interface has been updated accordingly. The changes are well-implemented and logical. My review includes a couple of suggestions to add type hints to the new and modified functions to improve code clarity and maintainability, aligning with practices seen in other scripts in the repository.
scripts/ci/publish_traces.py
Outdated
| def collect_all_trace_files(traces_dirs, target_base_path): | ||
| """Collect trace files from multiple directories""" |
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.
For better code clarity and maintainability, consider adding type hints to the new collect_all_trace_files function. This aligns with practices in other scripts within the repository (e.g., scripts/ci/cleanup_hf_cache.py). You'll need to add from typing import List, Tuple at the top of the file.
| def collect_all_trace_files(traces_dirs, target_base_path): | |
| """Collect trace files from multiple directories""" | |
| def collect_all_trace_files(traces_dirs: "List[str]", target_base_path: str) -> "List[Tuple[str, bytes]]": | |
| """Collect trace files from multiple directories""" |
scripts/ci/publish_traces.py
Outdated
| def publish_traces(traces_dirs, run_id, run_number): | ||
| """Publish traces to GitHub repository in a single commit | ||
| Args: | ||
| traces_dirs: A single directory path (str) or list of directory paths | ||
| run_id: GitHub run ID | ||
| run_number: GitHub run number | ||
| """ |
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.
To improve code clarity and prevent potential type-related errors, please add type hints to the publish_traces function signature. This is consistent with the project's style in other scripts. You'll need to import List and Union from the typing module.
| def publish_traces(traces_dirs, run_id, run_number): | |
| """Publish traces to GitHub repository in a single commit | |
| Args: | |
| traces_dirs: A single directory path (str) or list of directory paths | |
| run_id: GitHub run ID | |
| run_number: GitHub run number | |
| """ | |
| def publish_traces(traces_dirs: "Union[str, List[str]]", run_id: str, run_number: str) -> None: | |
| """Publish traces to GitHub repository in a single commit | |
| Args: | |
| traces_dirs: A single directory path (str) or list of directory paths | |
| run_id: GitHub run ID | |
| run_number: GitHub run number | |
| """ |
Uh oh!
There was an error while loading. Please reload this page.