Skip to content

Fix xUnit tests #1005

Closed
Closed

Description

They're now disabled. Not sure why the runner started failing.

Activity

  1. added
    WG-Quality-Test
    on May 19, 2016
  2. andyleejordan commented on May 20, 2016

    @andyleejordan
    MemberAuthor

    The last merge from Source Depot, #1001, caused the following xUnit test failures:

    • PSTests.FileSystemProviderTests.TestGetProperty
    • PSTests.FileSystemProviderTests.TestSetProperty
    • PSTests.FileSystemProviderTests.TestClearProperty
    • PSTests.FileSystemProviderTests.TestGetContentReader
    • PSTests.FileSystemProviderTests.TestGetContentWriter
    • PSTests.FileSystemProviderTests.TestClearContent
    • PSTests.RunspaceTests.TestRunspaceWithPipeline
    • PSTests.RunspaceTests.TestRunspaceWithPowerShell

    These are, of course, from our xUnit tests.

    /cc James Truher (@JamesWTruher) sergei (@vors)

  3. andyleejordan commented on May 20, 2016

    @andyleejordan
    MemberAuthor

    The xUnit test runner isn't being very friendly with respect to reporting failing tests. Filed dotnet/cli/issues/3173.

  4. andyleejordan commented on May 20, 2016

    @andyleejordan
    MemberAuthor
  5. andyleejordan commented on Jun 1, 2016

    @andyleejordan
    MemberAuthor

    sergei (@vors) Start-PSxUnit should be usable now per #1065.

  6. vors commented on Jun 10, 2016

    @vors
    Collaborator

    Exception details

    Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Runspaces.RunspaceFactory' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'api-ms-win-eventing-provider-l1-1-0.dll': The specified module could not be found.
     (Exception from HRESULT: 0x8007007E)
       at System.Management.Automation.Tracing.EtwActivity.UnsafeNativeMethods.EventActivityIdControl(ActivityControlCode controlCode, Guid& activityId)
       at System.Management.Automation.Tracing.EtwActivity.GetActivityId()
       at System.Management.Automation.Runspaces.RunspaceFactory..cctor()
       --- End of inner exception stack trace ---
       at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace()
    
  7. vors commented on Jun 10, 2016

    @vors
    Collaborator

    So essentially NOETW define is not used, when compiled SMA for xUnit tests and it tries to load win-only libs.

  8. vors commented on Jun 10, 2016

    @vors
    Collaborator

    Ups, sorry I run dotnet run without --configuration Linux and that's why it happened
    The real exception is

    Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at System.Management.Automation.ClrFacade.Load(AssemblyName assembly)
       at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadMshSnapinAssembly(PSSnapInInfo mshsnapinInfo)
       at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
       at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIns(Collection`1 mshsnapinInfos, PSConsoleLoadException& warning)
       at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadConsole(PSConsoleLoadException& warning)
       at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration()
       at System.Management.Automation.Runspaces.RunspaceConfiguration.Create()
       at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(PSHost host)
       at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace()
       at PSTests.RunspaceTests.DoTest()
       at PSTests.RunspaceTests.Main(String[] args)
    
    
  9. vors commented on Jun 10, 2016

    @vors
    Collaborator

    ok, another red-hearing
    I just didn't include

    PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext
    

    in my test app

  10. vors commented on Jun 10, 2016

    @vors
    Collaborator

    ok, so we are trying to load snap-in Microsoft.PowerShell.Diagnostics (which corresponds to dll Microsoft.PowerShell.Commands.Diagnostics).

    We are failing badly (maybe same segfault as #1058 )

    Issue for porting this dll is #1042

  11. vors commented on Jun 10, 2016

    @vors
    Collaborator

    Started make changes in vors/xunit branch Basically A (@ealexjordan) already found the problem: removed #if !CORECLR guards in default snapins list.

  12. vors commented on Jun 10, 2016

    @vors
    Collaborator

    One test (TestRunspaceWithPowerShellAndInitialSessionState) still fails https://travis-ci.com/PowerShell/PowerShell/jobs/42210737

    No segfault fortunately
    Doesn't repro locally

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

Metadata

Metadata

Assignees

Labels

WG-Quality-Test

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions