Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

PSVersionTable.Tests.ps1 handles certain builds incorrectly.

Đang mở Phù hợp với người mới
#27,503 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
powershell
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu trong test/powershell/Host/PSVersionTable.Tests.ps1, đặc biệt là các assertion GitCommitId quanh dòng 55, và so sánh chúng với định dạng GitCommitId được mô tả trong PSVersionInfoGenerator.cs. Cập nhật pattern hoặc giá trị kỳ vọng của test để giá trị được báo cáo 7.6.2-0-g... được xử lý chính xác, sau đó chạy các test PSVersionTable và xác nhận rằng bản build với tag sạch không tạo ra lỗi.

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

Mô tả

Needs-Triage
Prerequisites
Steps to reproduce

Affected version: All up to trunk.

There's a logic mismatch in PSVersionTable.Tests.ps1. More specifically, it tests here whether or not a commit build matches "^(\d+\.\d+\.\d+)(-.+)?" - and the issue is that GitCommitId absolutely can look like that and will indeed. See the comments here in PSVersionInfoGenerator.cs about how such a GitCommitId can look - but most importantly, it's ALWAYS prefixed by the version - and thus always matching the string it should not match.

As you can see, my GitCommitId after a clean build from the 7.6.2 git tag is 7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19. This matches of course.

Expected behavior
No error.
Actual behavior
[-] GitCommitId property 3ms
      Expected regular expression '^(\d+\.\d+\.\d+)(-.+)?-(\d+)-g(.+)$' to not match '7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19', but it did match.
      55:        $PSVersionTable.GitCommitId | Should -Not -Match $unexpectectGitCommitIdPattern
      at <ScriptBlock>, /home/aurutils/.cache/aurutils/sync/powershell/src/PowerShell/test/powershell/Host/PSVersionTable.Tests.ps1: line 55
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.6.2
PSEdition                      Core
GitCommitId                    7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19
OS                             Arch Linux
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

Ngôn ngữ chính
C#
Star
55.5k
Fork
8.5k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
97

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.

Issue khác của PowerShell/PowerShell

Tất cả issue của PowerShell/PowerShell

Issue tương tự

Thêm issue về C#

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.