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

Reduce console output when running tests and update more tests to use ITestOutputHelper #5901

Merged
merged 3 commits into from
Jul 3, 2024

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Jul 3, 2024

Description

A couple of .NET test runs execute code paths that end up calling Console.WriteLine() which I find confusing when looking at a test run's output:

  The given project `ProjectA` has no vulnerable packages given the current sources.
  The given project `ProjectB` has no vulnerable packages given the current sources.
  Specify --help for a list of available options and commands.
  Specify --help for a list of available options and commands.
  Specify --help for a list of available options and commands.
  Specify --help for a list of available options and commands.
  Error processing request: The decryption operation failed, see inner exception.
  Error processing request: The decryption operation failed, see inner exception.
  Error processing request: The decryption operation failed, see inner exception.
  Error processing request: The decryption operation failed, see inner exception.
  Error processing request: The decryption operation failed, see inner exception.
  Error processing request: The decryption operation failed, see inner exception.

The "Error processing request" is coming from SelfSignedCertificateMockServer so I updated it to use ITestOutputHelper. I also updated more tests that weren't logging command output to ITestOutputHelper that @donnie-msft had reported.

Another change is to ListPackageConsoleRenderer to allow tests to capture its output instead of it writing to Console.Out.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue. N/A

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@jeffkl jeffkl added the Engineering Changes related to the build infrastructure of the repo and that do not change product code label Jul 3, 2024
@jeffkl jeffkl self-assigned this Jul 3, 2024
@jeffkl jeffkl requested a review from a team as a code owner July 3, 2024 17:08
Nigusu-Allehu
Nigusu-Allehu previously approved these changes Jul 3, 2024
donnie-msft
donnie-msft previously approved these changes Jul 3, 2024
Copy link
Contributor

@donnie-msft donnie-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! More of these to come!
I wonder if implementing an attribute ctor pattern would make it simpler to add these.

@jeffkl jeffkl dismissed stale reviews from donnie-msft and Nigusu-Allehu via 9cd9b28 July 3, 2024 19:18
@jeffkl jeffkl enabled auto-merge (squash) July 3, 2024 20:30
@jeffkl jeffkl merged commit a4acf48 into dev Jul 3, 2024
27 of 28 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-more-test-output branch July 3, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Changes related to the build infrastructure of the repo and that do not change product code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants