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).
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.
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:
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.
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.
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.
Give Rider 2017.3 EAP a try! We’d love to hear your thoughts and comments.
Timothy Liu says:
December 12, 2017This is awesome!
Dev says:
December 13, 2017C# 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?
Maarten Balliauw says:
December 13, 2017A related issue was fixed in the newest EAP builds, where “latest” is now interpreted as C# 7.2 in VS 15.5 (see related issue https://youtrack.jetbrains.com/issue/RSRP-466616)
If you’re on R# 2017.3 EAP (https://www.jetbrains.com/resharper/eap/) and see any random squigglies, please log an issue at https://youtrack.jetbrains.com/issues/RSRP#newIssue with a screenshot if possible.
Vladimir says:
December 23, 2017Hi 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?
Maarten Balliauw says:
December 24, 2017Thanks for the suggestion! I created an entry in our issue tracker for this: https://youtrack.jetbrains.com/issue/RIDER-12346
Ivan Shakhov says:
December 24, 2017Please follow this issue https://github.com/JetBrains/resharper-unity/issues/96