PSVersionTable.Tests.ps1 handles certain builds incorrectly.
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- powershell
- Domain
- testing-qa
Research direction
Start in test/powershell/Host/PSVersionTable.Tests.ps1, especially the GitCommitId assertions around line 55, and compare them with the GitCommitId format described in PSVersionInfoGenerator.cs. Update the test's pattern or expectation so the reported 7.6.2-0-g... value is handled correctly, then run the PSVersionTable tests and confirm the clean-tag build produces no error.
Written by the indexing model from the issue text.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
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
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 86
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PowerShell
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
PowerShell/PowerShell#28037 ·
-
Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PowerShell/PowerShell#27973 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PowerShell#27720 ·
-
Issue-Bug Up-for-Grabs WG-Cmdlets WG-Reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PowerShell/PowerShell#27670 · 3 comments ·
-
Issue-Bug Up-for-Grabs WG-Reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
PowerShell/PowerShell#27656 · 2 comments ·
All issues in PowerShell/PowerShell
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·