Skip to content

fix: copy ci directory when exec_dir is not '.' in coverage test - #34792

Merged
guanshengliang merged 3 commits into
3.0from
fix/coverage-ci-dir-copy
Mar 16, 2026
Merged

guanshengliang merged 3 commits into
3.0from
fix/coverage-ci-dir-copy

Conversation

@tomchon

@tomchon tomchon commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

Problem

When exec_dir is not '.' (e.g., 'cases'), only the subdirectory was copied to tmp/thread_volume/, but the 'ci' directory was missing. This caused the following error in Docker container:

https://project.feishu.cn/taosdata_td/job/detail/6918249043

Root Cause

In run_coverage_container_internal.sh, when exec_dir != '.', only the specified subdirectory (e.g., 'cases') was copied, but ci/ directory (which contains run_case.sh) was not.

Fix

Also copy ci directory when exec_dir is not '.', ensuring run_case.sh is accessible in the container.

Testing

This fixes test cases like:

  • 200,,n,cases,bash 82-UnitTest/test.sh

which previously failed with 'No such file or directory' error.

When exec_dir is not '.', only the subdirectory (e.g., 'cases') was copied
to tmp/thread_volume/, but 'ci' directory was missing. This caused
run_case.sh not found error in Docker container.

Now also copy ci directory to ensure run_case.sh is accessible.
@tomchon
tomchon requested a review from a team as a code owner March 15, 2026 08:29
Copilot AI review requested due to automatic review settings March 15, 2026 08:29
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 resolves a critical bug in the coverage test setup that prevented tests from executing correctly in Docker containers when a specific execution directory was provided. By ensuring all necessary CI scripts are copied into the test environment, it restores the functionality of these tests and prevents 'file not found' errors.

Highlights

  • Problem Identification: When the exec_dir for coverage tests was not the current directory ('.'), the ci directory, which contains essential scripts like run_case.sh, was not copied into the temporary test volume. This led to 'No such file or directory' errors within the Docker container during test execution.
  • Root Cause: The run_coverage_container_internal.sh script only copied the specified subdirectory when exec_dir was not '.', omitting the crucial ci/ directory.
  • Solution Implemented: The fix explicitly adds a step to copy the ci directory to the temporary test volume whenever exec_dir is not '.', ensuring run_case.sh and other necessary files are accessible within the Docker container.

🧠 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
  • test/ci/cov/run_coverage_container_internal.sh
    • Added logic to explicitly copy the 'ci' directory when 'exec_dir' is not '.' to ensure all necessary scripts are available in the Docker container.
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.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request addresses an issue where the 'ci' directory was not being copied under certain conditions in the coverage test, leading to errors. The fix involves explicitly copying the 'ci' directory. While the fix is correct, I've identified a minor inefficiency where a directory could be copied twice in some cases. I've provided a suggestion to prevent this redundant operation, improving the script's efficiency and maintainability.

Comment thread test/ci/cov/run_coverage_container_internal.sh Outdated

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

Fixes coverage-container runs when exec_dir is not "." by ensuring test/ci is present in the mounted test/ tree inside the container (so ci/run_case.sh can be executed).

Changes:

  • When exec_dir != ".", copy test/ci into the per-thread volume alongside the selected subdirectory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/ci/cov/run_coverage_container_internal.sh Outdated
@codecov

codecov Bot commented Mar 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.21%. Comparing base (163aa94) to head (e7bf33d).
⚠️ Report is 1 commits behind head on 3.0.

Additional details and impacted files
@@             Coverage Diff             @@
##              3.0   #34792       +/-   ##
===========================================
- Coverage   68.67%   37.21%   -31.47%     
===========================================
  Files         606      691       +85     
  Lines      308702   335145    +26443     
===========================================
- Hits       212009   124726    -87283     
- Misses      96693   210419   +113726     
Flag Coverage Δ
TDengine 37.21% <ø> (-31.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings March 16, 2026 04:45

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

Fixes coverage-container test execution when exec_dir is not . by ensuring test/ci (including run_case.sh) is present in the per-thread mounted test volume.

Changes:

  • When exec_dir != ".", copy test/ci into tmp/thread_volume/$thread_no/ alongside the selected test subdirectory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/ci/cov/run_coverage_container_internal.sh Outdated
@tomchon
tomchon force-pushed the fix/coverage-ci-dir-copy branch from 3883933 to e7a040a Compare March 16, 2026 04:56
Copilot AI review requested due to automatic review settings March 16, 2026 05:05
@tomchon
tomchon force-pushed the fix/coverage-ci-dir-copy branch from e7a040a to 4c23508 Compare March 16, 2026 05:05
…e.sh exists

In coverage test, when exec_dir is not '.' (e.g., 'cases'), the original
logic only copied the subdirectory, missing the 'ci' directory. This
caused 'run_case.sh: No such file or directory' error in Docker container.

Simplify the logic: always copy the entire test/* if ci directory does not
exist, regardless of exec_dir value.

This fixes test cases like:
- 200,,n,cases,bash 82-UnitTest/test.sh

which previously failed with 'No such file or directory' error.
@tomchon
tomchon force-pushed the fix/coverage-ci-dir-copy branch from 4c23508 to d309d94 Compare March 16, 2026 05:08

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

Fixes coverage-container test execution when exec_dir is not . by ensuring the test/ci scripts (notably run_case.sh) are present inside the mounted temp volume used by Docker.

Changes:

  • Replaces the prior “copy only subdir” logic with a guarded copy of test/* into tmp/thread_volume/<thread>/ when ci/ is missing.
  • Uses ci/ presence in the temp volume as the condition to decide whether to (re)copy test assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +281 to 285
# 如果 test 目录不存在,复制整个 test 目录内容
if [ ! -d "${TMP_DIR}/thread_volume/$thread_no/test" ]; then
if [ "$exec_dir" != "." ]; then
subdir=`echo "$exec_dir"|cut -d/ -f1`
echo "cp -rf ${REPDIR}/test/$subdir ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf ${REPDIR}/test/$subdir ${TMP_DIR}/thread_volume/$thread_no/
else
echo "cp -rf ${REPDIR}/test/* ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf "${REPDIR}/test/"* "${TMP_DIR}/thread_volume/$thread_no/"
fi
echo "cp -rf ${REPDIR}/test/* ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf "${REPDIR}/test/"* "${TMP_DIR}/thread_volume/$thread_no/"
fi
Comment on lines +281 to +283
# 如果 test 目录不存在,复制整个 test 目录内容
if [ ! -d "${TMP_DIR}/thread_volume/$thread_no/test" ]; then
if [ "$exec_dir" != "." ]; then
subdir=`echo "$exec_dir"|cut -d/ -f1`
echo "cp -rf ${REPDIR}/test/$subdir ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf ${REPDIR}/test/$subdir ${TMP_DIR}/thread_volume/$thread_no/
else
echo "cp -rf ${REPDIR}/test/* ${TMP_DIR}/thread_volume/$thread_no/"
cp -rf "${REPDIR}/test/"* "${TMP_DIR}/thread_volume/$thread_no/"
fi
echo "cp -rf ${REPDIR}/test/* ${TMP_DIR}/thread_volume/$thread_no/"
Comment on lines +281 to 282
# 如果 test 目录不存在,复制整个 test 目录内容
if [ ! -d "${TMP_DIR}/thread_volume/$thread_no/test" ]; then
@guanshengliang
guanshengliang merged commit 131736d into 3.0 Mar 16, 2026
4 of 5 checks passed
@guanshengliang
guanshengliang deleted the fix/coverage-ci-dir-copy branch March 16, 2026 06:00
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