devlooped / dotnet-trx

Pretty-print test results from trx files
MIT License
33 stars 1 forks source link

Include className in output #14

Open AlexZeitler opened 2 months ago

AlexZeitler commented 2 months ago

Thanks for creating this project, it makes test results much more readable.

I'm using NUnit this way:

namespace SomeTests;

[TestFixture]
public class When_something_is_done() {
  [Test]
  public void something_should_happen() { }
}

The <TestMethod> output for this looks like this:

<TestMethod codeBase="/path/to/Some.Tests.dll"
                        adapterTypeName="executor://nunit3testexecutor/" 
                        className="SomeTests.When_something_is_done"
                        name="something_should_happen"/>

It would be great if there was an option to include className (maybe without the namespace) in the report and group tests from within the class.

I didn't do any work related to TRX so far but I would be willing to send a PR if you don't want to do it but are open to it in general.

Back this issue Back this issue

kzu commented 1 month ago

I'm totally open, yeah! Thanks for chiming in. I think grouping would be great. In the console, we could use a treeview from SpectreConsole with a root node for the assembly name (just filename, I'd say), then class name, finally test name. And make it smart by default such that:

This would by default render the shortest entry at each level. The assembly name perhaps should also be just a relative path like I render now via relative links to file paths...

AlexZeitler commented 1 month ago

Yes, that sounds good!

AlexZeitler commented 1 month ago

Just to make sure we’re on the same page: I’ll send you a PR?

kzu commented 1 month ago

Yeah, go ahead! I made some changes in the past couple days, but mostly just for GH reporting, not the main console output.