fix: copy ci directory when exec_dir is not '.' in coverage test - #34792
Conversation
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.
Summary of ChangesHello, 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
🧠 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
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 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.
There was a problem hiding this comment.
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 != ".", copytest/ciinto 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 != ".", copytest/ciintotmp/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.
3883933 to
e7a040a
Compare
e7a040a to
4c23508
Compare
…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.
4c23508 to
d309d94
Compare
There was a problem hiding this comment.
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/*intotmp/thread_volume/<thread>/whenci/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.
| # 如果 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 |
| # 如果 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/" |
| # 如果 test 目录不存在,复制整个 test 目录内容 | ||
| if [ ! -d "${TMP_DIR}/thread_volume/$thread_no/test" ]; then |
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:
which previously failed with 'No such file or directory' error.