Skip to content

Add debug output option for Pester #2670

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

Merged
merged 3 commits into from
May 12, 2020

Conversation

nohwnd
Copy link
Contributor

@nohwnd nohwnd commented Apr 29, 2020

PR Summary

Add an option to Pester section to print different level of output when test or a block is debugged, and set that to Diagnostic. This allows me to print a more verbose output from Discovery, Skip, Filter, and especially Mock with information that is helpful when debugging, but too verbose for normal usage.

This only affects Pester 5, in Pester 4 we fall back to the Normal output.

This change will ship in Pester 5.0.0-rc6 which will be released before tomorrow evening.

mock-diag2

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@nohwnd
Copy link
Contributor Author

nohwnd commented May 11, 2020

@rjmholt @TylerLeonhardt Review please. Will release v5 soon and would like this to be already released by then if possible :)

@TylerLeonhardt
Copy link
Member

Is there a reason you think debugging should be noisier than just running by default? I would think that they should just be the same verbosity.

@nohwnd
Copy link
Contributor Author

nohwnd commented May 12, 2020

The extended logging is very useful, and I find myself leaning on it every time I debug a problem, especially with Mock. Using the Diagnostic output as the default makes the users aware of that feature, and does not require them to go to settings and switch it themselves. While they can still set it back to Minimal / Normal if they don't like the output.

I can make the Minimal output the default, but I would definitely recommend that you'd try using it for a bit, it really is nice. And I am trying to keep the logs just verbose enough to be practical, but I don't log everything there is in this diagnostic view.

@TylerLeonhardt
Copy link
Member

My only concern is that it could be scary for newcomers to Pester or even folks that just aren't as technical or familiar with Pester intricacies.

Ultimately, I'll defer that judgment to you as I'm assuming you know your customer a bit more than I... But it's something I was thinking about when I saw this PR.

@TylerLeonhardt
Copy link
Member

talked it over with @SydneyhSmith and @rjmholt - we can merge this in and get feedback.

@TylerLeonhardt TylerLeonhardt merged commit e2541cd into PowerShell:master May 12, 2020
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.

3 participants