Different unit test results between Windows and Linux #362

Closed
opened 2026-01-29 14:34:56 +00:00 by claunia · 4 comments
Owner

Originally created by @mlaily on GitHub (Apr 26, 2020).

Running dotnet test on Windows and on Ubuntu (WSL2) with the same dotnet sdk does not yield the same result. Some tests related to relative and absolute uris don't pass on Linux!

(Tests on a clean 0.20.0 working directory (3ef1d735d5))

Windows:

D:\Data\Dev\Archival-Mess\markdig\src>dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.201
 Commit:    b1768b4ae7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.201\

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8

.NET Core SDKs installed:
  1.0.0 [C:\Program Files\dotnet\sdk]
  1.0.3 [C:\Program Files\dotnet\sdk]
  1.0.4 [C:\Program Files\dotnet\sdk]
  1.1.0 [C:\Program Files\dotnet\sdk]
  2.0.0 [C:\Program Files\dotnet\sdk]
  2.0.2 [C:\Program Files\dotnet\sdk]
  2.1.4 [C:\Program Files\dotnet\sdk]
  2.1.200 [C:\Program Files\dotnet\sdk]
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.302 [C:\Program Files\dotnet\sdk]
  2.1.400 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]
  2.1.503 [C:\Program Files\dotnet\sdk]
  2.1.504 [C:\Program Files\dotnet\sdk]
  2.1.602 [C:\Program Files\dotnet\sdk]
  2.1.700 [C:\Program Files\dotnet\sdk]
  2.1.701 [C:\Program Files\dotnet\sdk]
  2.1.801 [C:\Program Files\dotnet\sdk]
  3.1.201 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

D:\Data\Dev\Archival-Mess\markdig\src>dotnet test
Test run for D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\bin\Debug\netcoreapp2.1\Markdig.Tests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
  ! ListUnorderedLooseTop
  X EnsureSpecsAreUpToDate [86ms]
  Error Message:
     Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file.
  Expected: less than 2020-01-05 20:35:35.2518619
  But was:  2020-04-25 10:42:26.6789975

  Stack Trace:
     at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\TestParser.cs:line 42


Test Run Failed.
Total tests: 1247
     Passed: 1245
     Failed: 1
    Skipped: 1
 Total time: 2.2883 Seconds
Test run for D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\bin\Debug\netcoreapp3.1\Markdig.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
  ! ListUnorderedLooseTop [< 1ms]
  X EnsureSpecsAreUpToDate [43ms]
  Error Message:
     Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file.
  Expected: less than 2020-01-05 20:35:35.2518619
  But was:  2020-04-25 10:42:26.6789975

  Stack Trace:
     at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\TestParser.cs:line 42


Test Run Failed.
Total tests: 1247
     Passed: 1245
     Failed: 1
    Skipped: 1
 Total time: 1.9502 Seconds

Ubuntu (WSL2):

yaurthek@Tyr:/mnt/d/Data/Dev/Archival-Mess/markdig/src$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.201
 Commit:    b1768b4ae7

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.201/

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8

.NET Core SDKs installed:
  3.1.201 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
yaurthek@Tyr:/mnt/d/Data/Dev/Archival-Mess/markdig/src$ dotnet test
/usr/share/dotnet/sdk/3.1.201/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Benchmarks/Markdig.Benchmarks.csproj]
Test run for /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/bin/Debug/netcoreapp2.1/Markdig.Tests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
  - The following frameworks were found:
      3.1.3 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=ubuntu.18.04-x64
. Please check the diagnostic logs for more information.

Test Run Aborted.
Test run for /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/bin/Debug/netcoreapp3.1/Markdig.Tests.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
  ! ListUnorderedLooseTop [< 1ms]
  X EnsureSpecsAreUpToDate [35ms]
  Error Message:
     Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file.
  Expected: less than 2020-01-05 20:35:35.2518619
  But was:  2020-04-25 10:42:26.6789975

  Stack Trace:
     at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestParser.cs:line 42

  X ReplacesRelativeImageSources [< 1ms]
  Error Message:
     Expected: String containing "="https://example.com/image.jpg""
  But was:  "<p>Image: <img src="/image.jpg" alt="alt text" /></p>
"

  Stack Trace:
     at Markdig.Tests.TestRelativeUrlReplacement.TestSpec(String baseUrl, String markdown, String expectedLink) in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 45
   at Markdig.Tests.TestRelativeUrlReplacement.ReplacesRelativeImageSources() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 26

  X ReplacesRelativeLinks [< 1ms]
  Error Message:
     Expected: String containing "="https://example.com/relative.jpg""
  But was:  "<p>Link: <a href="/relative.jpg">hello</a></p>
"

  Stack Trace:
     at Markdig.Tests.TestRelativeUrlReplacement.TestSpec(String baseUrl, String markdown, String expectedLink) in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 45
   at Markdig.Tests.TestRelativeUrlReplacement.ReplacesRelativeLinks() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 14


Test Run Failed.
Total tests: 1247
     Passed: 1243
     Failed: 3
    Skipped: 1
 Total time: 1.7914 Seconds

I tried to debug the linux tests with VS Code and the Remote WSL extension but I didn't manage to make it work properly, so I didn't go much further...

Any idea why it does that? Should we worry?


Bonus question: what's the recommended way to run unit tests for Markdig? I installed the NUnit test runner, but tests still won't run inside Visual Studio, because of An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.. After some googling, it seems to be a recurring bug with NUnit... should I stick to dotnet test?

Originally created by @mlaily on GitHub (Apr 26, 2020). Running `dotnet test` on Windows and on Ubuntu (WSL2) with the same dotnet sdk does not yield the same result. Some tests related to relative and absolute uris don't pass on Linux! (Tests on a clean 0.20.0 working directory (3ef1d735d5b2eacc14e1fe7bd8ed70fbdee3a316)) Windows: ``` D:\Data\Dev\Archival-Mess\markdig\src>dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7 Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.201\ Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8 .NET Core SDKs installed: 1.0.0 [C:\Program Files\dotnet\sdk] 1.0.3 [C:\Program Files\dotnet\sdk] 1.0.4 [C:\Program Files\dotnet\sdk] 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.302 [C:\Program Files\dotnet\sdk] 2.1.400 [C:\Program Files\dotnet\sdk] 2.1.403 [C:\Program Files\dotnet\sdk] 2.1.503 [C:\Program Files\dotnet\sdk] 2.1.504 [C:\Program Files\dotnet\sdk] 2.1.602 [C:\Program Files\dotnet\sdk] 2.1.700 [C:\Program Files\dotnet\sdk] 2.1.701 [C:\Program Files\dotnet\sdk] 2.1.801 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download D:\Data\Dev\Archival-Mess\markdig\src>dotnet test Test run for D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\bin\Debug\netcoreapp2.1\Markdig.Tests.dll(.NETCoreApp,Version=v2.1) Microsoft (R) Test Execution Command Line Tool Version 16.5.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. ! ListUnorderedLooseTop X EnsureSpecsAreUpToDate [86ms] Error Message: Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file. Expected: less than 2020-01-05 20:35:35.2518619 But was: 2020-04-25 10:42:26.6789975 Stack Trace: at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\TestParser.cs:line 42 Test Run Failed. Total tests: 1247 Passed: 1245 Failed: 1 Skipped: 1 Total time: 2.2883 Seconds Test run for D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\bin\Debug\netcoreapp3.1\Markdig.Tests.dll(.NETCoreApp,Version=v3.1) Microsoft (R) Test Execution Command Line Tool Version 16.5.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. ! ListUnorderedLooseTop [< 1ms] X EnsureSpecsAreUpToDate [43ms] Error Message: Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file. Expected: less than 2020-01-05 20:35:35.2518619 But was: 2020-04-25 10:42:26.6789975 Stack Trace: at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in D:\Data\Dev\Archival-Mess\markdig\src\Markdig.Tests\TestParser.cs:line 42 Test Run Failed. Total tests: 1247 Passed: 1245 Failed: 1 Skipped: 1 Total time: 1.9502 Seconds ``` Ubuntu (WSL2): ``` yaurthek@Tyr:/mnt/d/Data/Dev/Archival-Mess/markdig/src$ dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7 Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.201/ Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8 .NET Core SDKs installed: 3.1.201 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download yaurthek@Tyr:/mnt/d/Data/Dev/Archival-Mess/markdig/src$ dotnet test /usr/share/dotnet/sdk/3.1.201/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Benchmarks/Markdig.Benchmarks.csproj] Test run for /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/bin/Debug/netcoreapp2.1/Markdig.Tests.dll(.NETCoreApp,Version=v2.1) Microsoft (R) Test Execution Command Line Tool Version 16.5.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. Testhost process exited with error: It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '2.1.0' was not found. - The following frameworks were found: 3.1.3 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] You can resolve the problem by installing the specified framework and/or SDK. The specified framework can be found at: - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=ubuntu.18.04-x64 . Please check the diagnostic logs for more information. Test Run Aborted. Test run for /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/bin/Debug/netcoreapp3.1/Markdig.Tests.dll(.NETCoreApp,Version=v3.1) Microsoft (R) Test Execution Command Line Tool Version 16.5.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. ! ListUnorderedLooseTop [< 1ms] X EnsureSpecsAreUpToDate [35ms] Error Message: Headings.md has been modified. Run SpecFileGen to regenerate the tests. If you have modified a specification file, but reverted all changes, ignore this error or revert the 'changed' timestamp metadata on the file. Expected: less than 2020-01-05 20:35:35.2518619 But was: 2020-04-25 10:42:26.6789975 Stack Trace: at Markdig.Tests.TestParser.EnsureSpecsAreUpToDate() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestParser.cs:line 42 X ReplacesRelativeImageSources [< 1ms] Error Message: Expected: String containing "="https://example.com/image.jpg"" But was: "<p>Image: <img src="/image.jpg" alt="alt text" /></p> " Stack Trace: at Markdig.Tests.TestRelativeUrlReplacement.TestSpec(String baseUrl, String markdown, String expectedLink) in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 45 at Markdig.Tests.TestRelativeUrlReplacement.ReplacesRelativeImageSources() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 26 X ReplacesRelativeLinks [< 1ms] Error Message: Expected: String containing "="https://example.com/relative.jpg"" But was: "<p>Link: <a href="/relative.jpg">hello</a></p> " Stack Trace: at Markdig.Tests.TestRelativeUrlReplacement.TestSpec(String baseUrl, String markdown, String expectedLink) in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 45 at Markdig.Tests.TestRelativeUrlReplacement.ReplacesRelativeLinks() in /mnt/d/Data/Dev/Archival-Mess/markdig/src/Markdig.Tests/TestRelativeUrlReplacement.cs:line 14 Test Run Failed. Total tests: 1247 Passed: 1243 Failed: 3 Skipped: 1 Total time: 1.7914 Seconds ``` I tried to debug the linux tests with VS Code and the [Remote WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) but I didn't manage to make it work properly, so I didn't go much further... Any idea why it does that? Should we worry? --- Bonus question: what's the recommended way to run unit tests for Markdig? I installed the NUnit test runner, but tests still won't run inside Visual Studio, because of `An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.`. After some googling, it seems to be a recurring bug with NUnit... should I stick to `dotnet test`?
Author
Owner

@mlaily commented on GitHub (Apr 26, 2020):

Ok, I found the cause. Uri cannot be trusted: it behaves differently on Windows and Unix -_-'

See https://github.com/dotnet/runtime/issues/22718

and the bug in markdig: 8acf5a548e/src/Markdig/Renderers/HtmlRenderer.cs (L208)

I'll try to make a PR...

@mlaily commented on GitHub (Apr 26, 2020): Ok, I found the cause. `Uri` cannot be trusted: it behaves differently on Windows and Unix -_-' See https://github.com/dotnet/runtime/issues/22718 and the bug in markdig: https://github.com/lunet-io/markdig/blob/8acf5a548edc200db81f805a78dec00552aa2051/src/Markdig/Renderers/HtmlRenderer.cs#L208 I'll try to make a PR...
Author
Owner

@mlaily commented on GitHub (Apr 26, 2020):

Thanks for the merge.

@xoofx @MihaZupan Could you also please answer my other question when you have two minutes? :)

Bonus question: what's the recommended way to run unit tests for Markdig?
I installed the NUnit test runner, but tests still won't run inside Visual Studio, because of An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed. After some googling, it seems to be a recurring bug with NUnit... should I stick to dotnet test?

@mlaily commented on GitHub (Apr 26, 2020): Thanks for the merge. @xoofx @MihaZupan Could you also please answer my other question when you have two minutes? :) > Bonus question: what's the recommended way to run unit tests for Markdig? >I installed the NUnit test runner, but tests still won't run inside Visual Studio, because of `An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.` After some googling, it seems to be a recurring bug with NUnit... should I stick to dotnet test?
Author
Owner

@MihaZupan commented on GitHub (Apr 26, 2020):

Tests used to work fine in VS, I don't know where it went wrong and I haven't looked into it. For peace of mind I run tests from the command line. It would be worth looking into what's actually happening with VS.

Interesting thing is that while the Text Explorer doesn't seem to work, the live code coverage in VS enterprise runs them just fine (after a minor tweak) 🤷‍♂️

@MihaZupan commented on GitHub (Apr 26, 2020): Tests used to work fine in VS, I don't know where it went wrong and I haven't looked into it. For peace of mind I run tests from the command line. It would be worth looking into what's actually happening with VS. Interesting thing is that while the Text Explorer doesn't seem to work, the live code coverage in VS enterprise runs them just fine (after a [minor tweak](https://github.com/lunet-io/markdig/commit/754d11fd444d1ab4a2aeb7774390e8f1e53014e5#diff-b772886f91144d33d75803e8f2e89532)) 🤷‍♂️
Author
Owner

@mlaily commented on GitHub (Apr 26, 2020):

Thanks, that's useful to know.

For what it's worth, executing individual tests seem to work properly too, but I can't run the whole batch at once...

I'll probably stick to the command line...

@mlaily commented on GitHub (Apr 26, 2020): Thanks, that's useful to know. For what it's worth, executing individual tests seem to work properly too, but I can't run the whole batch at once... I'll probably stick to the command line...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#362