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

Issue with report with Linux file paths when updating from 23.7.1 to 23.7.2 #1196

Closed
jairbubbles opened this issue Apr 22, 2024 · 7 comments · Fixed by #1208
Closed

Issue with report with Linux file paths when updating from 23.7.1 to 23.7.2 #1196

jairbubbles opened this issue Apr 22, 2024 · 7 comments · Fixed by #1208

Comments

@jairbubbles
Copy link
Contributor

Hello,

Updating from 23.7.1 to 23.7.2 is breaking my CI. I'm building my application on a Windows machine and executing the tests on a Linux one.

In the CI log we can see:

VerifyException : Directory: D:\b\0\2091\Source\Macros\Tests\Source\Scripting/D:\b\0\2091\Source\Macros\Tests\Source\Scripting
New:
  - Received: D:\b\0\2091\Source\Macros\Tests\Source\Scripting/D:\b\0\2091\Source\Macros\Tests\Source\Scripting/Test_Generate_Project_Is_Deterministic.net60.LINUX.DotNet6_0.received.txt
    Verified: D:\b\0\2091\Source\Macros\Tests\Source\Scripting/D:\b\0\2091\Source\Macros\Tests\Source\Scripting/Test_Generate_Project_Is_Deterministic.net60.LINUX.verified.txt

When looking closely we can see that the path is concatenated twice:

D:\b\0\2091\Source\Macros\Tests\Source\Scripting/D:\b\0\2091\Source\Macros\Tests\Source\Scripting/

The settings are set like that:

        private VerifySettings GetVerifySettings([CallerMemberName] string methodName = null)
        {
            var settings = new VerifySettings();
            settings.DisableRequireUniquePrefix();

            string fileName;
#if NET472
            fileName = $"{methodName}.net472";
#else
            fileName = $"{methodName}.net60";
#endif
            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                fileName += ".OSX";
            else if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                fileName += ".LINUX";

            settings.UseFileName(fileName);
            return settings;
        }

I quickly looked at the diff and I can see some changes regarding path concatenation that might explain the regression.

(the issue is also present with version 24.1.0)

@SimonCropp
Copy link
Member

can u share a repro

@SimonCropp
Copy link
Member

bump

@jairbubbles
Copy link
Contributor Author

Hi @SimonCropp, the original repository is on an internal GitLab instance. As it also relies on specific build infrastructure I don't really see how can I share something meaningful.

Also, I don't think there's anything special about my test except that it's being built on Windows and the test ran on another Linux machine.

@jairbubbles
Copy link
Contributor Author

I'll try to reproduce it with a sample and WSL.

@jairbubbles
Copy link
Contributor Author

Here you go:
TestVerify.zip

To repro:

  • Run on Windows: dotnet test
  • Then execute on Linux (through WSL): wsl dotnet test --no-build

I get the output:

Test run for /mnt/c/Users/jrichard/RiderProjects/TestVerify/TestVerify/bin/Debug/net8.0/TestVerify.dll (.NETCoreApp,Version=v8.0)
Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
  Failed CrossPlatformTest [1 s]
  Error Message:
   VerifyException : Directory: C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/C:\Users\jrichard\RiderProjects\TestVerify\TestVerify
NotEqual:
  - Received: C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/CrossPlatformTest.net60.LINUX.received.txt
    Verified: C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/CrossPlatformTest.net60.LINUX.verified.txt

FileContent:

NotEqual:

Received: C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/CrossPlatformTest.net60.LINUX.received.txt
test
Verified: C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/C:\Users\jrichard\RiderProjects\TestVerify\TestVerify/CrossPlatformTest.net60.LINUX.verified.txt



  Stack Trace:

Failed!  - Failed:     1, Passed:     0, Skipped:     0, Total:     1, Duration: 1 s - TestVerify.dll (net8.0)

@SimonCropp
Copy link
Member

i am having rouble finding the time to dedicate to this. do you want to have a go at submitting a PR that fixes it?

@jairbubbles
Copy link
Contributor Author

Sure @SimonCropp I can take a look.

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

Successfully merging a pull request may close this issue.

2 participants