fluentassertions icon indicating copy to clipboard operation
fluentassertions copied to clipboard

Subject identification not working on remote desktop

Open 0lks opened this issue 1 year ago • 6 comments

Description

I have not been able to get the subject identification component of FluentAssertions working on either of our two remote testing desktops and build configurations don't seem to be the cause of the issue for me.

I don't imagine my use case is that uncommon, so I'm hoping this is just a simple configuration issue, however I'm unable to find information about what to look for to troubleshoot this. The documentation mentions using the debug build configuration as the only requirement, but there seem to be more that go unmentioned?

Reproduction Steps

I can easily reproduce the issue in a fresh (SpecFlow) testing project.

After setting up a new testing project...

  1. Build the following test in debug mode:
    string test = "true";
    test.Should().Be("false");
  1. Run it with "dotnet test [YourTestAssemblyName].dll"
  2. See 'Expected behavior'
  3. Move all the build files to a remote desktop (including .pdb files)
  4. Run the command from '2)' on the remote desktop
  5. See 'Actual behavior'

Expected behavior

Expecting to receive the following error on both machines: "Expected test to be "false" with a length of 5, but "true" has a length of 4, differs near "tru" (index 0)."

Actual behavior

The expected error only appears when running the test script on the local PC (same one where tests were built)

On the remote desktop I receive the error without subject identification: "Expected string to be "false" with a length of 5, but "true" has a length of 4, differs near "tru" (index 0)."

Regression?

For me the subject identification has never worked on any PC other than the one I build on.

Known Workarounds

No response

Configuration

FluentAssertions v. 6.11 .NET 5 and .NET 6

Other information

No response

Are you willing to help with a pull-request?

No

0lks avatar Nov 27 '23 11:11 0lks

What OS runs on the remote desktop?

Can you please verify following:

  1. clone this repo
  2. run ./build.sh (for unix) or .\build.ps1 (for windows) and check if all tests pass
  3. If not, check if the test cases have the same issue you described

IT-VBFK avatar Nov 27 '23 16:11 IT-VBFK

All the machines have Windows.

I ran the build on the remote desktop and all tests passed.

0lks avatar Nov 28 '23 09:11 0lks

Ok.

I thought something related to #2368

IT-VBFK avatar Nov 29 '23 21:11 IT-VBFK

4. Move all the build files to a remote desktop (including .pdb files)

Do you mean that you only move the binaries to the new machine? Or did you also copy over the binaries? Because by default, dotnet test will rebuild the test project.

dennisdoomen avatar Nov 30 '23 06:11 dennisdoomen

I copy over all the binaries, yes. Everything from the bin folder is carried over. Then I run the dotnet test command on the remote machine exactly as I would run it locally. The command is given the dll containing my tests as the argument and because it's a dll it doesn't attempt to rebuild.

0lks avatar Dec 05 '23 13:12 0lks

  1. Try adding --configuration Debug to make sure it's not optimizing the DLL.
  2. Copy the binaries from your dev machine to a different folder on your dev machine and try the same thing
  3. Use a tool like DotPeek to verify that those binaries are really not optimized.

dennisdoomen avatar Dec 05 '23 18:12 dennisdoomen