-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude duplicate files for Run.Path and CodeCoverage.Path #2535
Conversation
# Deduplicate files if overlapping -Path values | ||
$uniquePaths = [System.Collections.Generic.HashSet[string]]::new(@($files).Count) | ||
$uniqueFiles = foreach ($f in $files) { if ($uniquePaths.Add($f.FullName)) { $f } } | ||
Filter-Excluded -Files $uniqueFiles -ExcludePath $ExcludePath | & $SafeCommands['Where-Object'] { $_ } |
Check notice
Code scanning / PSScriptAnalyzer
The built-in *-Object-cmdlets are slow compared to alternatives in .NET. To fix a violation of this rule, consider using an alternative like foreach/for-keyword etc.`. Note
@nohwnd CI disabled in AzDO? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/backport to rel/5.6.x |
Started backporting to rel/5.6.x: https://github.com/pester/Pester/actions/runs/9879992903 |
PR Summary
Updates
Find-File
andGet-CodeCoverageFilePaths
internal functions to exclude duplicate files when provided overlappingPath
values to search in. This affects:-Path / Run.Path
-CodeCoverage / CodeCoverage.Path
New-PesterContainer -Path ..
Data
(parameters)PR also:
Get-CodeCoverageFilePaths
to useGet-ChildItem -File -Recurse
for increased performance.New-PesterContainer
to avoid multiple filesystem searches when provided array of Data for increased performance.Fix #2530
PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready.