psake / psake/PowerShellBuild

Add support for passing a PesterConfiguration object to PowerShellBuild

Đang mở
#83 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement
Ngôn ngữ chính
PowerShell
Star
145
Fork
27
Merge trung bình
10 giờ 16 phút
Pull request đã merge (30 ngày)
34

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi cách PowerShellBuild gọi Pester và cách các tùy chọn $PSBPreference.Test hiện có được áp dụng. Xem xét giá trị $PSBPreference.Test.Configuration được đề xuất và các ví dụ về PesterConfiguration, sau đó xác định thứ tự ưu tiên cho các đường dẫn và các cài đặt khác. Công việc được xem là hoàn tất khi người dùng có thể cung cấp một cấu hình và hành vi kiểm thử mặc định dự kiến vẫn rõ ràng và được bao quát.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
powershell
Lĩnh vực
testing
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.