`Get-CodeCoverageResult`: New command proposal
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- cli, testing-qa
调研方向
未指定实现文件或测试。首先检查现有的 Invoke-Pester 配置以及 issue 中描述的 PesterObject CodeCoverage.CommandsMissed 输出,然后确定应如何集成所提议的命令以及 Type、Name 和 AddSource 参数。当所请求的未覆盖、已执行和已筛选 coverage 结果可通过所提议的 CLI 命令获得时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Details of the scenario you tried and the problem that is occurring
It is very complicated to get the code coverage for a certan function or class through CLI. Suggest adding a command that can make it less difficult:
Invoke-PesterWithCodeCoverage: runs Pester with required configuration and returns a PesterObject. The command should take an optional PesterConfiguration parameter, but use default if not specified.
Get-CodeCoverageResult: The command should take the parameters:
PesterObject (mandatory)
Name (optional, array of class and function names being tested)
AddSource (optional, only applicable when built module using ModuleBuilder)
Type (optional, either Missed, Executed or All - defaults to Missed only)
Should add a new property Type to the resulting objects with Missed or Executed
Returns the CommandsMissed
$config = New-PesterConfiguration
$config.Run.Path = @('<test paths>')
$config.CodeCoverage.Enabled = $true
$config.CodeCoverage.Path = @('./output/builtModule/<ModuleName>')
$config.CodeCoverage.CoveragePercentTarget = 0
$config.Output.Verbosity = 'None'
$config.Run.PassThru = $true
$result = Invoke-Pester -Configuration $config
# After running above, get all commands that was missed with a reference to the SourceLineNumber in SourceFile.
$result.CodeCoverage.CommandsMissed | Where-Object { $_.Function -eq '<FunctionName>' -or $_.Class -eq '<ClassName>' } | Convert-LineNumber -PassThru | Select-Object Class, Function, Command, SourceLineNumber, SourceFile
Steps to reproduce the problem
Expected behavior
Current behavior
Suggested solution to the issue
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the module that was used
- 主要语言
- PowerShell
- 星标
- 6
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dsccommunity/DscResource.Test 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 38/100
dsccommunity/DscResource.Test#175 · 2 条评论 ·
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 45/100
dsccommunity/DscResource.Test#171 ·
-
enhancement help wanted
难度 3/5 1-2 天 新手友好度 35/100
dsccommunity/DscResource.Test#168 ·
-
enhancement help wanted
难度 4/5 3-5 天 新手友好度 35/100
dsccommunity/DscResource.Test#160 · 7 条评论 ·
-
documentation help wanted
难度 4/5 3-5 天 新手友好度 15/100
dsccommunity/DscResource.Test#146 ·
查看 dsccommunity/DscResource.Test 的全部 Issue
相似的 Issue
-
agent-self
难度 1/5 1 小时以内 新手友好度 88/100
yologdev/yoyo-evolve#1154 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
discobox-ai/discobox#860 ·
维护者通常 1 天内回复
-
size: S
难度 2/5 1-3 小时 新手友好度 76/100
fells-code/seamless-glance#165 ·
维护者通常 1 天内回复
-
b4b usability
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
maziggy/bambuddy#3485 · 1 条评论 ·
维护者通常 2 天内回复