-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(dws): include command output in failures #10279
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
Open
AaronZ345
wants to merge
4
commits into
QwenLM:main
Choose a base branch
from
AaronZ345:fix/10276-dws-error-detail
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+174
−2
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[Suggestion] R3-1: The stderr-over-stdout precedence of this fallback chain is pinned by no test:
mockFailedDwsCommanddefaults both streams to''and every test populates at most one of them. A one-line mutation swapping the operands (dwsCommandFailureDetails(stdout) || dwsCommandFailureDetails(stderr)) survives the whole file — verified by mutation run in a scratch tree at this commit: with the operands flipped,npx vitest run src/dws-client-process.test.tsstill reportsTests 7 passed (7). So a DWS command that prints diagnostic noise on stdout while the real error lands on stderr — the common case this ordering exists for — could silently start surfacing the stdout noise inDwsCommandError.messageafter a future refactor, with no test ever going red. Add one test that callsmockFailedDwsCommand({ stdout: 'stdout noise', stderr: 'real error' })and asserts the message containsreal errorand notstdout noise; it must go red if the||operand order is flipped (under the mutation it fails withexpected 'DWS command failed (1): stdout noise' to contain 'real error').中文说明
这个兜底链中 stderr 优先于 stdout 的顺序没有任何测试固定:
mockFailedDwsCommand默认两个流都是'',而每个测试至多只填充其中一个。把两个操作数对调(dwsCommandFailureDetails(stdout) || dwsCommandFailureDetails(stderr))的单行变异可以通过整个测试文件——已在本提交的临时树中实测:对调后npx vitest run src/dws-client-process.test.ts仍报告Tests 7 passed (7)。因此,一个在 stdout 打印诊断噪音、而真正错误落在 stderr 的 DWS 命令(正是这个顺序存在的常见场景),在未来重构后可能会悄无声息地在DwsCommandError.message中呈现 stdout 噪音,而没有任何测试变红。请补一个测试:调用mockFailedDwsCommand({ stdout: 'stdout noise', stderr: 'real error' }),断言消息包含real error且不包含stdout noise;当||操作数顺序被对调时它必须失败(变异下报错为expected 'DWS command failed (1): stdout noise' to contain 'real error')。— qwen3.8-max via Qwen Code /review (v0.22.2)