pester / Pester

Pester is the ubiquitous test and mock framework for PowerShell.
https://pester.dev/
Other
3.11k stars 473 forks source link

Unable to run Profiler on Pester tests with CodeCoverage #2185

Closed fflaten closed 1 year ago

fflaten commented 2 years ago

Checklist

What is the issue?

Running Pester's own tests inside Profiler fails.

Failing tests:

Expected Behavior

All tests pass so I'm able to fully profile Pester's tests.

Steps To Reproduce

No response

Describe your environment

Pester version : 5.3.3 /workspaces/Pester/bin/Pester.psm1
PowerShell version : 7.2.1 OS version : Unix 5.10.102.1

Profiler version: 3.1.1

Possible Solution?

Not sure what's happening with the failed test in Pester.Mock.RSpec.ts.ps1.

For the Coverage-tests: Add missing overloads for Trace() in CodeCoverageTracer.cs that's compatible with Profiler 3 ExternalTraceAdapter and Profiler 4 ExternalTraceAdapter

fflaten commented 2 years ago

https://github.com/nohwnd/Profiler/blob/34f09a97b7859618dd97feb7b691204df05ff9bf/csharp/Profiler/ExternalTracerAdapter.cs#L13-L23

Is this correct in Profiler 4? It looks for Trace(IScriptExtent, ScriptBlock, int, string) but it invokes Trace(IScriptExtent, ScriptBlock, int) in _traceMethod.

Update: Registered as issue in Profiler-repo