-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Adding the ability to redirect system.Console output to test ou…
…tput. (#9023) ### Description The PR adds the ability to redirect `system.Console` output to test output. The implementation requires a test to opt-in to this functionality so that existing tests will not change functionality by default. ***Why not just use `ITestOutputHelper ` or the `BaseTest` built in `WriteX(...)`?*** Because the process tests make use of several other classes that are writing console logs from within their functions. In order to use `ITestOutputHelper ` we would need to inject this object into those classes. While this is possible, it adds extra code that is unrelated to what the sample is demonstrating and increases the cognitive load on people using the samples to learn. fixes #9009 After this change, running Step01_Processes produces the following test output: <img width="751" alt="image" src="https://github.com/user-attachments/assets/d1aab358-213e-4d98-9e67-c9bf4d564853"> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Ben Thomas <[email protected]> Co-authored-by: Chris <[email protected]>
- Loading branch information
1 parent
c20f0fc
commit 2724f34
Showing
3 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters