Skip to content
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

Print active filters in Detailed/Diagnostic output #1727

Merged
merged 2 commits into from
Oct 25, 2020

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented Oct 23, 2020

1. General summary of the pull request

This PR enables Pester to print enabled filters during a run when using Detailed or Diagnostic output level.
The filters are shown at the start of discovery. Example:

Discovery: Starting test discovery in 2 test containers.

Starting discovery in 2 files.
Filter 'Tag' set to ('Function').
Filter 'ExcludeTag' set to ('Ignore', 'Stuff').
Filter 'Line' set to ('C:\tests\file1.Tests.ps1:37', 'C:\tests\file12.Tests.ps1:371').

Discovery: Discovering tests in /workspaces/Pester/demo.ps1
Discovering in /workspaces/Pester/demo.ps1.
Found 3 tests. 13ms
Discovery: Found 3 tests in 17 ms
Discovery: Processing discovery result objects, to set root, parents, filters etc.
Filter: ('Set-BuildRunToCI' Unit Tests) There is 'Ignore, Stuff' exclude tag filter.
...

Known issue: It might be confusing to the user that filters are shown before "Found 3 tests" as that number is before processing/filtering. Moving the output after that message would require invoking a new plugin-step in Discover-Test

Fix #1721

src/functions/Output.ps1 Outdated Show resolved Hide resolved
@nohwnd nohwnd merged commit a562407 into pester:v5.0 Oct 25, 2020
@fflaten fflaten deleted the printfilter branch October 25, 2020 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print out the filter that is being used
2 participants