Skip to content

Conversation

@SallyHuo-TAOS
Copy link
Contributor

…binary name

Description

Please briefly describe the code changes in this pull request.

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@SallyHuo-TAOS SallyHuo-TAOS requested a review from a team as a code owner October 13, 2025 10:21
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SallyHuo-TAOS, 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 focuses on refactoring the test framework's utility functions to enhance modularity and efficiency. It centralizes the logic for locating build paths into a shared utility module and introduces a mechanism to skip version control directories during path searches. These changes aim to make the test suite more robust and easier to manage.

Highlights

  • Centralized Build Path Retrieval: The getBuildPath function, previously duplicated across numerous test files, has been removed from individual test classes and replaced with a centralized call to tdCom.getBuildPath(). This consolidates common utility logic, improving code maintainability and reducing redundancy.
  • Improved Path Traversal Logic: The utility functions responsible for finding build paths (getPath, getBuildPath, getTaosdemoPath, getTDenginePath) have been enhanced to explicitly ignore .git directories during their file system traversal. This prevents unnecessary processing and potential issues related to version control metadata.
  • Streamlined Test Imports: Several test files have updated their import statements to directly import tdCom from new_test_framework.utils, reflecting the new centralized utility structure.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 is a great refactoring effort to centralize the getBuildPath logic into tdCom.getBuildPath(), removing a lot of duplicated code across the test suite. This significantly improves maintainability. The change to ignore .git directories during path searches is also a good improvement.

I've found one critical issue where an incomplete refactoring introduces a syntax error, and one minor issue with a duplicated import. Please see the detailed comments.

@tomchon tomchon requested a review from Copilot October 14, 2025 02:25
Copy link
Contributor

Copilot AI left a 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 optimizes path-finding functions and removes duplicate code across the test framework. The changes consolidate duplicated getBuildPath implementations by replacing them with calls to a shared tdCom.getBuildPath() utility function, and add .git directory filtering to prevent unnecessary directory traversal during build path searches.

  • Removes duplicate getBuildPath method implementations across 50+ test files
  • Adds .git directory filtering to improve search efficiency in path-finding utilities
  • Consolidates path-finding logic by using shared tdCom.getBuildPath() function

Reviewed Changes

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

Show a summary per file
File Description
test/new_test_framework/utils/pathFinding.py Added .git directory exclusion to getTaosdemoPath and getTDenginePath methods
test/new_test_framework/utils/common.py Added .git directory exclusion to getBuildPath method
test/new_test_framework/utils/before_test.py Added .git directory exclusion to getPath method
test/cases/uncatalog/system-test/99-TDcase/*.py Removed duplicate getBuildPath methods and updated imports to use tdCom
test/cases/uncatalog/system-test/7-tmq/*.py Removed duplicate getBuildPath methods and replaced calls with tdCom.getBuildPath()
test/cases/uncatalog/system-test/6-cluster/*.py Removed duplicate getBuildPath methods from cluster test files
test/cases/uncatalog/system-test/2-query/*.py Updated query test files to use tdCom.getBuildPath()
test/cases/uncatalog/system-test/0-others/*.py Consolidated path-finding logic in miscellaneous test files
test/cases/70-Node/05-Cluster/*.py Removed duplicate implementations from cluster node tests
test/cases/41-StreamProcessing/*.py Updated stream processing tests to use shared utility
test/cases/10-DataIngestion/*.py Consolidated path-finding in data ingestion tests
test/cases/04-SuperTables/*.py Updated super table tests to use shared utility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 605 to +606


Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Unnecessary blank line added at the end of the file. Consider removing this trailing whitespace.

Suggested change

Copilot uses AI. Check for mistakes.
tdLog.success(f"{__file__} successfully executed")

event = threading.Event()

Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Unnecessary blank line added at the end of the file. Consider removing this trailing whitespace.

Suggested change

Copilot uses AI. Check for mistakes.
Copy link
Member

@feici02 feici02 left a comment

Choose a reason for hiding this comment

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

LGTM

@feici02 feici02 merged commit 98b6d11 into main Oct 14, 2025
5 of 6 checks passed
@feici02 feici02 deleted the feat/huoh/TD-33281 branch October 14, 2025 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants