Rhino.Testing fails for Rhino 8.25

Hi,

We were testing Rhino 8.25 and came across an issue with the Rhino.Testing library. Somewhere between Rhino 8.19 and Rhino 8.25 the RhinoSetupFixture started to fail.

If you build the attached project you’ll see that it works just fine if you update the nuget packages to 8.19 and have that version installed locally. However, if you switch it to 8.25 it will fail all the tests and you’ll get an error message like the one below.

The root cause seems to be the RhinoSetupFixture. If you comment out the code below it works just fine in 8.25 as well.

    [SetUpFixture]
    public class RhinoFixture : RhinoSetupFixture
    {


        public override void OneTimeSetup()
        {
            base.OneTimeSetup();
        }

        public override void OneTimeTearDown()
        {
            base.OneTimeTearDown();
        }

    }

This is a bit of a problem for us since we use the fixtures to load the GH plugins we want to test. So currently all our Rhino tests are failing for 8.25. It also happens in the Github Action we use for running the tests remotely.

I’m still investigating and trying to find a workaround. Figured I post it here in case anyone knows how to deal with it.

RhinoTestProject1.zip (1.5 MB)

Do you see any difference between using the base class of RhinoSetupFixture and the [RhinoTestFixture] attribute?

If I comment out the RhinoFixture class and add the [RhinoTestFixture] attribute to the test class it is undiscoverable for the test runner in Visual Studio Professional. Chances are that there is a lower lever failure that isn’t showing up in the output for the tests.

I’ve managed to repro the issue in 8.25 and can see that 8.19 works.

Another thought I have is that Rhino 8 uses dotnet 8.0 by default as of 8.20 and I wonder if that might be a part of it.

I’ll keep investigating.

Debugging the Rhino.Testing project shows that it fails to load the RhinoDoc during setup in RhinoCoreLoader.LoadCore.

Figured it out. The Rhino nugets were not getting filtered out correctly from the bin folder. Changing the project properties to this solved it.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
  </PropertyGroup>

  <ItemGroup>
	  <PackageReference Include="coverlet.collector" Version="6.0.2" />
	  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
	  <PackageReference Include="NUnit" Version="4.4.0" />
	  <PackageReference Include="NUnit.Analyzers" Version="4.11.2" />
	  <PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
	  <PackageReference Include="Rhino.Testing" Version="8.0.28-beta" />
	  <PackageReference Include="RhinoCommon" Version="8.25.25314.11001" >
		  <PrivateAssets>all</PrivateAssets>
		  <ExcludeAssets>runtime</ExcludeAssets>
	  </PackageReference>
	  <PackageReference Include="Grasshopper" Version="8.25.25314.11001" >
		  <PrivateAssets>all</PrivateAssets>
		  <ExcludeAssets>runtime</ExcludeAssets>
	  </PackageReference>
  </ItemGroup>

  <ItemGroup>
    <Using Include="NUnit.Framework" />
  </ItemGroup>

  <ItemGroup>
    <None Update="Rhino.Testing.Configs.xml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

As to why it worked before but not in Rhino 8.25 I’m not entirely sure. Chances are that there are subtle changes in the sequence of assembly resolution between these versions.

Attached the updated project in case other people come across this issue.

RhinoTestProject2.zip (2.2 MB)

2 Likes