Unit testing improvements in Rider 2017.3

In the latest Rider 2017.3 EAP builds, we have been hard at work improving the test runner experience. We’ve added a couple of new actions to re-run failed tests and repeat tests until failure. The Tests menu is now a separate menu entry, featuring all test runner actions. Filters are now visible based on context. Various UI improvements were made, making the test runner tool window nicer to work with.

Several bugs were fixed as well: when a filter is set (e.g. “show only failed tests”), unit test actions now use this filter. Some problems with NUnit on Linux and macOS were resolved as well.

Let’s look at a few of the unit test runner improvements!

New actions: Rerun Failed Tests / Repeat Tests Until Failure

When a test fails, we typically want to be able to quickly run it again after making a code change, to see if it passes. Both the toolbar as well as the Unit Testing quick list (Shift+Alt+U in Visual Studio keyboard scheme) now allow to Rerun Failed Tests (Ctrl+U, F).
Re-run failed unit tests in Rider

Imagine having a test that is green and passes 99.9% of the time, but every now and then fails – a so-called “flaky test”. Instead of having to manually re-run the test over and over again, Rider 2017.3 now comes with a new action Repeat Tests Until Failure which lets us continuously run a given test session until one of the tests fails. This helps in reproducing the “red test” situation locally and checking out the logs.
Run tests until failure

UI improvements and keyboard shortcuts

A number of improvements were made to the unit tests tool window UI. For example, the filter panel now only displays filters that are applicable. In other words: there will not be a “show only failed tests” filter when all tests succeeded:
Unit test runner context-aware filters

We have moved the Tests menu from Tools to its own top-level menu. Context menu entries have been re-ordered and extended: actions for Show source and Copy are now available.
New actions in context menu

We also made various small UI fixes, such as removing of unnecessary toolbar buttons (e.g. rename test session which is now only available from the context menu), double borders, etc.

The Unit Testing quick list (Shift+Alt+U in Visual Studio keyboard scheme) is now also context-aware and displays different entries when invoked from the editor or from the unit test tool window.
Unit testing quick list

Note that the available actions can be configured from Rider’s settings under Keymap, then Tests | Unit Tests Tool Window Actions.

Several keyboard shortcuts were added to the unit test tool window. When browsing a unit test session, we can now use the Delete key to remove a test from the current session, Shift+Enter will run selected tests and Ctrl+D (Command+D on Mac) will debug selected tests.

Also when browsing a unit test tree, we can just start typing to search for a given unit test. Rider will now search in all nodes, even when they are not expanded.
Search tests tool window

Give Rider 2017.3 EAP a try! We’d love to hear your thoughts and comments.

About Maarten Balliauw

Maarten Balliauw is a Developer Advocate at JetBrains, working on .NET tools. He focuses on .NET, Azure, web technologies and application performance. Maarten is a frequent speaker at various national and international events. In his free time, he brews his own beer. Follow him on Twitter or check his personal blog.
This entry was posted in How-To's and tagged , , , , . Bookmark the permalink.

6 Responses to Unit testing improvements in Rider 2017.3

  1. Timothy Liu says:

    This is awesome!

  2. Dev says:

    C# 7.2 has been released like a week ago. How do I make squiggly error lines go away in ReSharper? Maybe pause Rider development for a bit to focus on that?

  3. Vladimir says:

    Hi guys,

    First of all thank you for the great product, but can I request a bit more attention to the testing? I’m using NUnit + Unity3D.

    1. Go to Test doesn’t work complitely, even if test class marked as TestFixture(TypeOf).
    2. You have integration with Unity3D (like debugger, for example) and it’s awesome! However many tests couldn’t be run without editor. https://docs.unity3d.com/Manual/testing-editortestsrunner.html
    Is it possible to add integration between Unity test runner and Rider UI?

Leave a Reply

Your email address will not be published. Required fields are marked *