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

Show details about test duration #1137

Open
rowo360 opened this issue Oct 12, 2024 · 6 comments
Open

Show details about test duration #1137

rowo360 opened this issue Oct 12, 2024 · 6 comments
Assignees

Comments

@rowo360
Copy link
Contributor

rowo360 commented Oct 12, 2024

Describe the bug
It's currently possible to group all tests 'By Duration', so that the user get some insights about slow running tests. That's already fine!

It would be even more helpful for the user if can view the exact test duration somehow. So that he can identify some bottleneeks easily and and knows where to start an improvement.

The test duration is already provided by NUnit, but it's not visualized so far.

Expected behavior
The test duration is shown for each test case and test fixture in the test tree.

Environment (please complete the following information):

  • TestCentric Version - latest developer build
  • OS: Windows 11
@rowo360 rowo360 self-assigned this Oct 12, 2024
@rowo360
Copy link
Contributor Author

rowo360 commented Oct 12, 2024

I suggest adding the test duration to the end of the texts of the treenodes. Here's a screenshot:

The test duration is available for TestFixture and TestCase nodes.
When switching between the tree Display strategies or groupings, the entire tree will be rebuild, so that the tree node names will be set again.

Overall, I had the impression that this solution will work and is beneficial.
However when I tried out this solution for a while, I asked myself why it's limited to the 'Duration' grouping at all. Isn't it beneficial for the user to get insights to the test duration in whatever strategy/grouping?

So, I came up with an idea to add a new context menu item:

As a result the test duration can be viewed in (for example) the NUnit tree too!

In this view the test duration is also available for the 'Namespace' nodes - but that's also fine!
If you like the idea about showing the test duraction in all kind of strategies/grouping + the context menu approach, I will continue to work out this solution.

@CharliePoole
Copy link
Contributor

I like the idea. Two thoughts...

  1. Is this a context menu item or a setting? Context menu items were intended to be transient, i.e. till you close the app. Settings were intended to be sticky. I think we have blurred that distinction somewhat by use of visual state, but let's think about it anyway.

  2. Do we need a feature to sort the nunit tree by duration? I.e. a new top-level sort menu item?

Some of this will take a while to work out. So go ahead with it but don't do a PR till after the beta6 release, which is unfortunately taking me longer than I thought it would.

Celebrating my 82nd birthday today, so I'll be back on Sunday. :-)

@rowo360
Copy link
Contributor Author

rowo360 commented Oct 13, 2024

Congratulations on your birthday! Enjoy the day and celebrate!

@rowo360
Copy link
Contributor Author

rowo360 commented Oct 13, 2024

I came up with the context menu idea just because it seems to be simple for the user to enable/disable it. (In contrast to some setting in the settings dialog - which must be found first of all and must be opened to enable/disable it.)

But we can actually decide whether and where this setting should be saved. I think I wasn't that strict in my mind so far that the context menu settings are always transient - therefore I prefer to save it in the settings. So when you restart TestCentric you will continue to work with your last configuration. The user enabled this settings at some point in time in the past, so he can disable it again, if he doesn't want this feature anymore.
Another option is to save it in the VisualState file. That means that this setting can be individually controlled for each test assembly. I think that's not required for the start. The test durations will be displayed anyway only after a test run, not right away after loading a test assembly. Moreover the user can activate 'Show test duration' at some point after a test run and the durations will be shown immediately (starting a new test run is not required).

So saving this in the settings seems to be fine for me.

The option to sort by test duration is certainly helpful. This means that users do not have to search hard for the slowest test theirself, but just start sorting. And if we start to support sorting, we can then do the alphabetical sorting at the same time. So a new feature is a good idea.

@rowo360
Copy link
Contributor Author

rowo360 commented Oct 17, 2024

@CharliePoole :
I continued to work on this issue and I have now reached a point where I'm confident about the solution.
So either I can create a PR or start to discuss it...
However you mentioned that you prefer to place this behind the beta6 release - that's fine! Just give me a hint when it fits best to continue with the next step.

@CharliePoole
Copy link
Contributor

@rowo360 The release is out. Check for an email I sent you.

I'd say go ahead with the PR. I'll take a look at it in the morning.

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

No branches or pull requests

2 participants