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

Clicking on unit test state filters gives unhelpful prompt #87

Open
tjhleeds opened this issue Dec 7, 2021 · 3 comments
Open

Clicking on unit test state filters gives unhelpful prompt #87

tjhleeds opened this issue Dec 7, 2021 · 3 comments
Assignees

Comments

@tjhleeds
Copy link

tjhleeds commented Dec 7, 2021

Describe the bug
When I click on the unit test state filters, I am prompted to create shortcuts repeatedly based on the number of unit tests in a given state.

To Reproduce
Steps to reproduce the behaviour:

  1. Open the Unit Tests window.
  2. Run some tests.
  3. The Unit Tests window shows the number of tests in each state (e.g. successful, failed, etc.)
  4. Click on one of the states (this filters the tests to those in the selected state).
  5. At this point a prompt is shown to create a shortcut, but it seems to be based on the number of tests rather than the state.

Expected behaviour
Ideally, prompt for a shortcut for the different test states (e.g. All Tests, Successful Tests, etc.) regardless of the number of tests within each state. If that's not possible, I think it would be better to not prompt at all for those buttons, rather than prompting for each different number of tests.

Screenshots
image

Please also provide:

  • Windows
  • Rider 2021.2.2
  • Key Promoter X 2021.2
@halirutan
Copy link
Owner

It's impossible for me to debug this since I rarely use Rider, let alone with projects having unit tests. If you like, you could turn on internal mode for Rider that allows you to see exactly what IntelliJ Action is behind the state filters.

Open Tools | Internal Tools | UI Debugger, select the "Actions" tab (probably clear it first), and hit one of these state buttons.
If you copy the responsible line for the action invoked, I might be able to look at the code and see if I can silence these messages. One of such an invoked action information looks like that:

2022-02-06 03:17:48,414 id=UiDebugger; shortcuts:; class: com.intellij.ui.debugger.ShowUiDebuggerAction

@tjhleeds
Copy link
Author

tjhleeds commented Feb 7, 2022

Ah that's a useful little tool, thanks for flagging that up. There are a few unit test filters, they come through as follows:

2022-02-07 08:57:28,632 id=RiderUnitTestPendingTestsFilterAction; shortcuts:; class: com.jetbrains.rider.unitTesting.actions.RiderUnitTestPendingTestsFilterAction
2022-02-07 08:57:31,825 id=RiderUnitTestRunningTestsFilterAction; shortcuts:; class: com.jetbrains.rider.unitTesting.actions.RiderUnitTestRunningTestsFilterAction
2022-02-07 08:57:35,006 id=RiderUnitTestSuccessTestsFilterAction; shortcuts:; class: com.jetbrains.rider.unitTesting.actions.RiderUnitTestSuccessTestsFilterAction
2022-02-07 08:57:42,563 id=RiderUnitTestAllTestsFilterAction; shortcuts:; class: com.jetbrains.rider.unitTesting.actions.RiderUnitTestAllTestsFilterAction
2022-02-07 08:58:30,180 id=RiderUnitTestBrokenTestsFilterAction; shortcuts:; class: com.jetbrains.rider.unitTesting.actions.RiderUnitTestBrokenTestsFilterAction

I've also had a look in C:\Users\{user}\AppData\Roaming\JetBrains\Rider2021.3\options\KeyPromoterXStatistic.xml and have found various statistics which I've suppressed that are formatted like this:

<Statistic Action="14">
  <Item>
    <IdeaActionID>RiderUnitTestAllTestsFilterAction</IdeaActionID>
    <Description>14</Description>
  </Item>
</Statistic>
<Statistic Action="3">
  <Item>
    <IdeaActionID>RiderUnitTestBrokenTestsFilterAction</IdeaActionID>
    <Description>3</Description>
  </Item>
</Statistic>
<Statistic Action="6">
  <Item>
    <IdeaActionID>RiderUnitTestIgnoredTestsFilterAction</IdeaActionID>
    <Description>6</Description>
  </Item>
</Statistic>

As you can see the IdeaActionID is meaningful, whereas the Description is the number of tests which happened to be in that state at the time, which is irrelevant.

Looking at the keymap settings, there are a number of other filters that I didn't manage to trigger above. This screenshot may be helpful:

2022-02-07_09-06-43_rider64_FFsfk4ESr1

I hope this helps. I think the ideal behaviour would be to prompt the user to add a shortcut (or remind them of the existing shortcut) for the actions, but I think suppression would be better than using the number of tests as the description of the action shown to the user.

(Just for the sake of completeness, I've updated to Rider 2021.3 since originally opening this issue.)

@halirutan
Copy link
Owner

I looked into that in more detail. The way to go here is to create a blacklist for some actions so that the KPX doesn't show or store anything about particular actions. We already have this when you suppress a notification (Disable notification for this) but since the name of the action is always different, this wouldn't work here.

However, I'm confident that I filter out RiderUnitTestPendingTestsFilterAction and similar things before it actually reaches the notification system. I don't see a different way for these kinds of things.

I'll work on that for the next release and keep the issue open until it's fixed. Thanks a lot for the detailed report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants