Add support for passing a PesterConfiguration object to PowerShellBuild
还没有人认领这个 Issue。
- 主要语言
- PowerShell
- 星标
- 145
- 派生
- 27
- 平均合并
- 10 小时 16 分钟
- 30 天内合并 PR
- 34
描述
Currently PowerShellBuild accepts several options to control how Pester is invoked through the $PSBPreference variable. However, there are more Pester options available if you go the "advanced" route and pass in a [PesterConfiguration] object.
You can generate a configuration a few different ways...
$config = New-PesterConfiguration
$config = [PesterConfiguration]::Default
$config = [PesterConfiguration]::new()
We could support all Pester options in an easier way than implementing $PSBPreference settings for each of them individually by allowing users to provide their own Pester configuration like so...
# file: psakeFile.ps1
Properties {
$PSBPreference.Test.Configuration = New-PesterConfiguration -Hashtable @{
# Change defaults as needed. For example...
Run = @{
SkipRemainingOnFailure = 'Run'
}
}
}
There are some considerations though. For example, the advanced option allows providing multiple paths. Should PowerShellBuild be opinionated and aim to maintain the current test behavior by default? If PowerShellBuild overrides properties like Run.Path, should the user be allowed to change that? How so?
Maybe other values from $PSBPreference.Test should be used to override the user-supplied [PesterConfiguration] and if they want to override those defaults, they should do it by updating the corresponding $PSBPreference.Test.* property?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 PowerShellBuild 如何调用 Pester,以及现有的 $PSBPreference.Test 选项如何应用。查看提议的 $PSBPreference.Test.Configuration 值和 PesterConfiguration 示例,然后确定路径及其他设置的优先级。用户可以提供配置,并且预期的默认测试行为仍然清晰且有覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell
- 领域
- testing
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100