PowerShell / PowerShell/PowerShellEditorServices

Trying to "wait for debugger" in tests doesn't work

未关闭
#676 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Area-Test Issue-Bug
主要语言
C#
星标
767
派生
266
平均合并
3 天 16 小时
30 天内合并 PR
1

描述

There are lines in both LanguageServerTests.cs and DebugServerTests.cs that can be uncommented to enable debugger attachment:

https://github.com/PowerShell/PowerShellEditorServices/blob/4bb71bd93320ba9b2105e3b5d2007f09f0f4a959/test/PowerShellEditorServices.Test.Host/LanguageServerTests.cs#L53

However, trying these in VSCode, I just get a bunch of error dialogs pop up in the machine's native UI and the tests just plough on and fail. I'm guessing this option is meant for Visual Studio usage, rather than VSCode.

I'm thinking we should retire this functionality and instead add a compile-time-conditional block with something like a Console.ReadKey() that reports the process ID of the test runner (that's how I tend to do it at the moment at least).

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

检查 LanguageServerTests.cs 和 DebugServerTests.cs 中与调试器附加相关的代码行,从链接的 LanguageServerTests.cs 位置开始。在 VSCode 中重现该行为,并将原生错误对话框和测试执行的继续情况与预期的调试工作流进行比较。当废弃的行为被移除,或被提议的测试运行器暂停和进程识别所替代,并且测试提供了可用的附加点时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, powershell, vscode
领域
testing-qa
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。