Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subject identification not working on remote desktop #2481

Open
0lks opened this issue Nov 27, 2023 · 6 comments
Open

Subject identification not working on remote desktop #2481

0lks opened this issue Nov 27, 2023 · 6 comments

Comments

@0lks
Copy link

0lks commented Nov 27, 2023

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

@IT-VBFK
Copy link
Contributor

IT-VBFK commented Nov 27, 2023

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

@0lks
Copy link
Author

0lks commented Nov 28, 2023

All the machines have Windows.

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

@IT-VBFK
Copy link
Contributor

IT-VBFK commented Nov 29, 2023

Ok.

I thought something related to #2368

@dennisdoomen
Copy link
Member

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.

@0lks
Copy link
Author

0lks commented Dec 5, 2023

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.

@dennisdoomen
Copy link
Member

  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants