How can I run unity unit tests from Rider-EAP? It works fine from Unity.
I get this error when I try to run the tests:
Error:null: /Users/xxx/NavigationTest.sln : error :
Target named 'Assembly-CSharp-Editor' not found in the project.
But I can build solution in Rider-EAP.
sln file from Unity:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2008
Project("{6394337E-A760-107E-A1B5-972965181127}") = "NavigationTest", "Assembly-CSharp.csproj", "{09AAC607-4433-B8FC-AE7F-1AD11A119684}"
EndProject
Project("{6394337E-A760-107E-A1B5-972965181127}") = "NavigationTest", "Assembly-CSharp-Editor.csproj", "{E38ED05D-5652-068C-C70B-013EED402A29}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09AAC607-4433-B8FC-AE7F-1AD11A119684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09AAC607-4433-B8FC-AE7F-1AD11A119684}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09AAC607-4433-B8FC-AE7F-1AD11A119684}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09AAC607-4433-B8FC-AE7F-1AD11A119684}.Release|Any CPU.Build.0 = Release|Any CPU
{E38ED05D-5652-068C-C70B-013EED402A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E38ED05D-5652-068C-C70B-013EED402A29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E38ED05D-5652-068C-C70B-013EED402A29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E38ED05D-5652-068C-C70B-013EED402A29}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
EndGlobalSection
EndGlobal
Right-click your solution and click "Jump to source", or double-click the error to show the same thing. You'll get something like this:
The issue seems to be related to PROJECTNAME not equalling the project name. Rename the two PROJECTNAME entries to match their project:
Then you might be able to run your tests.
This issue is discussed on GitHub and tracked by Jetbrains.
I did encounter this issue after applying this workaround, but as the issue suggests, running the tests a second time worked fine.