GithubHelp home page GithubHelp logo

Comments (5)

BryanWilhite avatar BryanWilhite commented on June 2, 2024

the culprit might be around the treatment of Assembly.CodeBase and Assembly.Location in AssemblyExtensions.GetPathFromAssembly πŸ”

var proposedLocation = (string.IsNullOrEmpty(assembly.CodeBase))
    ? assembly.Location
    : assembly.CodeBase
        .Replace("file:///", string.Empty);

from songhaycore.

BryanWilhite avatar BryanWilhite commented on June 2, 2024

this test πŸ”¬ on Ubuntu Linux:

[Fact]
public void ProposedLocationTest()
{
    var assembly = this.GetType().Assembly;
    var proposedLocation = (string.IsNullOrEmpty(assembly.CodeBase))
              ? assembly.Location
              : assembly.CodeBase
                  .Replace("file:///", string.Empty);
    this._testOutputHelper.WriteLine($"{nameof(assembly.Location)}: {assembly.Location}");
    this._testOutputHelper.WriteLine($"{nameof(assembly.CodeBase)}: {assembly.CodeBase}");
    this._testOutputHelper.WriteLine($"{nameof(proposedLocation)}: {proposedLocation}");
}

produces this output:

[xUnit.net 00:00:01.57]   Finished:    SonghayCore.xUnit.Tests
----- Test Execution Summary -----

Songhay.Tests.FrameworkAssemblyUtilityTests.ProposedLocationTest:
    Outcome: Passed
    Standard Output Messages:
    Location: /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/SonghayCore.xUnit.Tests.dll
CodeBase: file:///home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/SonghayCore.xUnit.Tests.dll
proposedLocation: home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/SonghayCore.xUnit.Tests.dll

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0

from songhaycore.

BryanWilhite avatar BryanWilhite commented on June 2, 2024

this appears to be the way to go:

var proposedLocation = (!string.IsNullOrEmpty(assembly.CodeBase) &&
        !FrameworkFileUtility.IsForwardSlashSystem()) ?
    assembly.CodeBase.Replace("file:///", string.Empty) :
    assembly.Location;

from songhaycore.

BryanWilhite avatar BryanWilhite commented on June 2, 2024

i have decided to run the entire Core test suites on Ubuntu and am seeing errors:

[xUnit.net 00:00:04.43]     Songhay.Tests.AssemblyExtensionsTests.GetPathFromAssembly_Test [FAIL]                     
[xUnit.net 00:00:04.47]       Assert.True() Failure                                                                   
[xUnit.net 00:00:04.47]       Expected: True                                                                          
[xUnit.net 00:00:04.47]       Actual:   False                                                                         
[xUnit.net 00:00:04.47]       Stack Trace:                                                                            
[xUnit.net 00:00:04.47]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/AssemblyExtensionsTests.cs(16,0): at Songhay.Tests.AssemblyExtensionsTests.GetPathFromAssembly_Test()
[xUnit.net 00:00:04.48]     Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(expectedPath: "../../../json/hello.json") [FAIL]
[xUnit.net 00:00:04.49]       Assert.True() Failure                                                                   
[xUnit.net 00:00:04.49]       Expected: True                                                                          
[xUnit.net 00:00:04.49]       Actual:   False                                                                         
[xUnit.net 00:00:04.49]       Stack Trace:                                                                            
[xUnit.net 00:00:04.49]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/DirectoryInfoExtensionsTests.cs(57,0): at Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(String expectedPath)
[xUnit.net 00:00:04.49]       Output:                                                                                 
[xUnit.net 00:00:04.49]         path from assembly: home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1
[xUnit.net 00:00:04.49]         directory levels: 3                                                                   
[xUnit.net 00:00:04.49]         path 3 levels above assembly: /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests

...

X Songhay.Tests.AssemblyExtensionsTests.GetPathFromAssembly_Test [1ms]                                              
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at Songhay.Tests.AssemblyExtensionsTests.GetPathFromAssembly_Test() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/AssemblyExtensionsTests.cs:line 16

...

X Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(expectedPath: "../../../json/hello.json") [1ms]    
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(String expectedPath) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/DirectoryInfoExtensionsTests.cs:line 57
  Standard Output Messages:
 path from assembly: home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1
 directory levels: 3
 path 3 levels above assembly: /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests


[xUnit.net 00:00:04.50]     Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(expectedPath: "..\\..\\..\\json/hello.json") [FAIL]
[xUnit.net 00:00:04.50]       Assert.True() Failure                                                                   
[xUnit.net 00:00:04.50]       Expected: True                                                                          
[xUnit.net 00:00:04.50]       Actual:   False                                                                         
[xUnit.net 00:00:04.50]       Stack Trace:                                                                            
[xUnit.net 00:00:04.50]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/DirectoryInfoExtensionsTests.cs(57,0): at Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(String expectedPath)
[xUnit.net 00:00:04.50]       Output:                                                                                 
[xUnit.net 00:00:04.50]         path from assembly: home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1
[xUnit.net 00:00:04.50]         directory levels: 3                                                                   
[xUnit.net 00:00:04.50]         path 3 levels above assembly: /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests
  X Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(expectedPath: "..\\..\\..\\json/hello.json") [1ms] 
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at Songhay.Tests.DirectoryInfoExtensionsTests.ToCombinedPath_Test(String expectedPath) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/DirectoryInfoExtensionsTests.cs:line 57
  Standard Output Messages:
 path from assembly: home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1
 directory levels: 3
 path 3 levels above assembly: /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1/home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests

...

[xUnit.net 00:00:06.05]     Songhay.Tests.ProjectFileDataAttributeTests.ShouldLoadLicenseFile [FAIL]                  
[xUnit.net 00:00:06.05]       The expected directory, home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1, is not here.
[xUnit.net 00:00:06.05]       Expected: True                                                                          
[xUnit.net 00:00:06.05]       Actual:   False                                                                         
[xUnit.net 00:00:06.05]       Stack Trace:                                                                            
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs(19,0): at Songhay.Tests.Extensions.DataAttributeExtensions.FindDirectory(DataAttribute attribute, String path)
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs(34,0): at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyDirectoryInfo(DataAttribute attribute, Type typeInAssembly)
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs(46,0): at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyParentDirectory(DataAttribute attribute, Type typeInAssembly, Int32 levels)
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs(59,0): at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyParentDirectoryInfo(DataAttribute attribute, Type typeInAssembly, Int32 expectedLevels)
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs(69,0): at Songhay.Tests.ProjectFileDataAttribute.<GetDataForFiles>b__3_1(KeyValuePair`2 pair)
[xUnit.net 00:00:06.05]            at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()                    
[xUnit.net 00:00:06.05]            at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()   
[xUnit.net 00:00:06.05]            at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)    
[xUnit.net 00:00:06.05]            at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)   
[xUnit.net 00:00:06.05]            at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)                   
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs(79,0): at Songhay.Tests.ProjectFileDataAttribute.GetDataForFiles()
[xUnit.net 00:00:06.05]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs(56,0): at Songhay.Tests.ProjectFileDataAttribute.GetData(MethodInfo testMethod)

...

X Songhay.Tests.ProjectFileDataAttributeTests.ShouldLoadLicenseFile [1ms]                                           
  Error Message:
   The expected directory, home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/bin/Debug/netcoreapp2.1, is not here.
Expected: True
Actual:   False
  Stack Trace:
     at Songhay.Tests.Extensions.DataAttributeExtensions.FindDirectory(DataAttribute attribute, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs:line 19
   at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyDirectoryInfo(DataAttribute attribute, Type typeInAssembly) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs:line 34
   at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyParentDirectory(DataAttribute attribute, Type typeInAssembly, Int32 levels) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs:line 46
   at Songhay.Tests.Extensions.DataAttributeExtensions.GetAssemblyParentDirectoryInfo(DataAttribute attribute, Type typeInAssembly, Int32 expectedLevels) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/Extensions/DataAttributeExtensions.cs:line 59
   at Songhay.Tests.ProjectFileDataAttribute.<GetDataForFiles>b__3_1(KeyValuePair`2 pair) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs:line 69
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Songhay.Tests.ProjectFileDataAttribute.GetDataForFiles() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs:line 79
   at Songhay.Tests.ProjectFileDataAttribute.GetData(MethodInfo testMethod) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit/ProjectFileDataAttribute.cs:line 56

...

[xUnit.net 00:00:06.13]     Songhay.Tests.FrameworkFileUtilityTests.TrimLeadingDirectorySeparatorChars_Test(expectedPath: "foo\\bar\\my-file.json", path: "/\\foo\\bar\\my-file.json") [FAIL]
[xUnit.net 00:00:06.13]       Assert.Equal() Failure                                                                  
[xUnit.net 00:00:06.13]                 ↓ (pos 0)                                                                     
[xUnit.net 00:00:06.13]       Expected: foo\bar\my-file.json                                                          
[xUnit.net 00:00:06.13]       Actual:   \foo\bar\my-file.json                                                         
[xUnit.net 00:00:06.13]                 ↑ (pos 0)                                                                     
[xUnit.net 00:00:06.13]       Stack Trace:                                                                            
[xUnit.net 00:00:06.13]         /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/FrameworkFileUtilityTests.cs(28,0): at Songhay.Tests.FrameworkFileUtilityTests.TrimLeadingDirectorySeparatorChars_Test(String expectedPath, String path)
[xUnit.net 00:00:06.18]   Finished:    SonghayCore.xUnit.Tests 

...

X Songhay.Tests.FrameworkFileUtilityTests.TrimLeadingDirectorySeparatorChars_Test(expectedPath: "foo\\bar\\my-file.json", path: "/\\foo\\bar\\my-file.json") [1ms]
  Error Message:
   Assert.Equal() Failure
          ↓ (pos 0)
Expected: foo\bar\my-file.json
Actual:   \foo\bar\my-file.json
          ↑ (pos 0)
  Stack Trace:
     at Songhay.Tests.FrameworkFileUtilityTests.TrimLeadingDirectorySeparatorChars_Test(String expectedPath, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.xUnit.Tests/FrameworkFileUtilityTests.cs:line 28

There xUnit suite has five failures. Most of them appear to be related to the file system.

from songhaycore.

BryanWilhite avatar BryanWilhite commented on June 2, 2024

The MS Test suite has four failures:

X ShouldFilterCategory [42ms]                                                                                                  
  Error Message:
   Assert.IsTrue failed. The expected file, /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlFromInfoPath.xml, is not here.
  Stack Trace:
     at Songhay.Extensions.TestContextExtensions.ShouldFindFile(TestContext context, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.MSTest/Extensions/TestContextExtensions.IO.cs:line 22
   at Songhay.Tests.OpmlTest.ShouldFilterCategory() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models/OpmlTest.cs:line 35

...

X ShouldLoadCategoriesAndResources [2ms]                                                                                       
  Error Message:
   Assert.IsTrue failed. The expected file, /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlTest.opml, is not here.
  Stack Trace:
     at Songhay.Extensions.TestContextExtensions.ShouldFindFile(TestContext context, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.MSTest/Extensions/TestContextExtensions.IO.cs:line 22
   at Songhay.Tests.OpmlTest.ShouldLoadCategoriesAndResources() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models/OpmlTest.cs:line 56

...

X ShouldLoadDocument [1ms]                                                                                                     
  Error Message:
   Assert.IsTrue failed. The expected file, /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlFromInfoPath.xml, is not here.
  Stack Trace:
     at Songhay.Extensions.TestContextExtensions.ShouldFindFile(TestContext context, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.MSTest/Extensions/TestContextExtensions.IO.cs:line 22
   at Songhay.Tests.OpmlTest.ShouldLoadDocument() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models/OpmlTest.cs:line 89

  Standard Output Messages:
 
 
 TestContext Messages:
 Finding directory: /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/bin/Debug/netcoreapp2.1...
 Finding file: /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlFromInfoPath.xml...


  X ShouldWriteDateModified [1ms]                                                                                                
  Error Message:
   Assert.IsTrue failed. The expected file, /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlTest.opml, is not here.
  Stack Trace:
     at Songhay.Extensions.TestContextExtensions.ShouldFindFile(TestContext context, String path) in /home/rasx/sourceRoot/SonghayCore/SonghayCore.MSTest/Extensions/TestContextExtensions.IO.cs:line 22
   at Songhay.Tests.OpmlTest.ShouldWriteDateModified() in /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models/OpmlTest.cs:line 117

  Standard Output Messages:
 
 
 TestContext Messages:
 Finding directory: /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/bin/Debug/netcoreapp2.1...
 Finding file: /home/rasx/sourceRoot/SonghayCore/SonghayCore.Tests/Models\OpmlTest.opml...

from songhaycore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.