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

Add Reqnroll.Microsoft.Extensions.Logging.ReqnrollPlugin #321

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

StefH
Copy link

@StefH StefH commented Nov 8, 2024

🤔 What's changed?

As discussed here #247
I've created a new projects which cn be used to forward the logging from an ILogger to IReqnrollOutputHelper.

⚡️ What's your motivation?

#247

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Initial code, please provide feedback.
And should this be called a "Plugin" because it does not actually implement IRuntimePlugin.

📋 Checklist:

  • I've changed the behaviour of the code
  • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Users should know about my change
  • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

@clrudolphi
Copy link
Contributor

Interesting idea. I'd like your thoughts on a related effort. We're considering adding use of Microsoft Logging internal to Reqnroll, to be used by Reqnroll maintainers and developers of Plugins, to obtain Trace and Debug-level output. This would be used to understand what's going on within the Reqnroll engine. The idea, though, is to steer such output away from the Test Framework's output stream (aka, avoid calling IReqnrollOutputHelper) so that the internal debug output doesn't interfere with the usual output of the Tests themselves.

With that description, would you think your approach for this plugin would need to be different?
How should we approach using and configuring MS Logging so that two use cases remain separated and don't intermix their log outputs?

@StefH
Copy link
Author

StefH commented Nov 9, 2024

Hello @Tiberriver256 and @gasparnagy,

The idea for this PR is based on this project:

And I use this in my project to view the logging directly in the testoutput when running my tests locally, but specifically when running in Azure DevOps.


I think that your approach of adding Microsoft Logging to Reqnroll is the other way around.

@gasparnagy
Copy link
Contributor

This is definitely useful. I will have a busy week, so I can play with it only in the week after. I would like to keep this open until then. (So if we need further hotfix for v2.2 we can easier apply.)

@gasparnagy
Copy link
Contributor

For using it internally the challenge is to have a specific version of Microsoft.Extensions.Logging.Abstractions bound to Reqnroll.

E.g. If the project that is being tested uses Microsoft.Extensions.Logging.Abstractions 6.0, how much trouble we will cause if we force it to be 8.0.

@StefH Do you know other tool similar to Reqnroll that use it internally and hence influence the dependencies of the product being tested?

@StefH
Copy link
Author

StefH commented Nov 9, 2024

This is definitely useful. I will have a busy week, so I can play with it only in the week after. I would like to keep this open until then. (So if we need further hotfix for v2.2 we can easier apply.)

That's ok.
Note that for now it's still a draft PR because I'm not sure if the code + tests conform to this project. If you have time you can already add some comments on my code.

@StefH
Copy link
Author

StefH commented Nov 9, 2024

For using it internally the challenge is to have a specific version of Microsoft.Extensions.Logging.Abstractions bound to Reqnroll.

E.g. If the project that is being tested uses Microsoft.Extensions.Logging.Abstractions 6.0, how much trouble we will cause if we force it to be 8.0.

@StefH Do you know other tool similar to Reqnroll that use it internally and hence influence the dependencies of the product being tested?

In case you really want be most compatible, add the .NET 8.0 also as a framework and in that case use Microsoft.Extensions.Logging.Abstractions version 8.
Else use version 6.
For an example see: 7abaf11


But I've another question:
Why do you use custom .nuspec files instead of defining everything in the .csproj?
To my opinion, custom .nuspec files are more difficult to maintain, especially when targeting multiple frameworks.

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