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

System.Runtime.Extensions.Tests fails on iOS and tvOS #36896

Closed
mdh1418 opened this issue May 22, 2020 · 4 comments · Fixed by #57210
Closed

System.Runtime.Extensions.Tests fails on iOS and tvOS #36896

mdh1418 opened this issue May 22, 2020 · 4 comments · Fixed by #57210
Assignees
Labels
Milestone

Comments

@mdh1418
Copy link
Member

mdh1418 commented May 22, 2020

System.Runtime.Extensions.Tests
System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle - in PR
System.Tests.EnvironmentTests.GetFolderPath_Unix_PersonalIsHomeAndUserProfile - MacCatalyst only
System.Tests.EnvironmentUserName.UserName_Valid

System.Runtime.Extensions.Tests.dll   Failed: 21

Test collection for System.Tests.AppDomainTests
System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle(physicalFileName: \"AssemblyResolveTestApp.dll\", assemblyFile: \"assemblyresolvetestapp.dll\", type: \"assemblyresolvetestapp.publicclasssample\", returnedFullNameType: \"AssemblyResolveTestApp.PublicClassSample\", exceptionType: typeof(System.IO.FileNotFoundException))
    Assert.Throws() Failure\nExpected: typeof(System.IO.FileNotFoundException)\nActual:   typeof(System.TypeLoadException): Could not load type 'assemblyresolvetestapp.publicclasssample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.\n---- System.TypeLoadException : Could not load type 'assemblyresolvetestapp.publicclasssample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
       at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()
----- Inner Stack Trace -----
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()
System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle(physicalFileName: \"AssemblyResolveTestApp.dll\", assemblyFile: \"assemblyresolvetestapp.dll\", type: \"assemblyresolvetestapp.privateclasssample\", returnedFullNameType: \"AssemblyResolveTestApp.PrivateClassSample\", exceptionType: typeof(System.IO.FileNotFoundException))
    Assert.Throws() Failure\nExpected: typeof(System.IO.FileNotFoundException)\nActual:   typeof(System.TypeLoadException): Could not load type 'assemblyresolvetestapp.privateclasssample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.\n---- System.TypeLoadException : Could not load type 'assemblyresolvetestapp.privateclasssample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
       at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()
----- Inner Stack Trace -----
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()
System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle(physicalFileName: \"AssemblyResolveTestApp.dll\", assemblyFile: \"assemblyresolvetestapp.dll\", type: \"assemblyresolvetestapp.publicclassnodefaultconstru\"..., returnedFullNameType: \"AssemblyResolveTestApp.PublicClassNoDefaultConstru\"..., exceptionType: typeof(System.IO.FileNotFoundException))
    Assert.Throws() Failure\nExpected: typeof(System.IO.FileNotFoundException)\nActual:   typeof(System.TypeLoadException): Could not load type 'assemblyresolvetestapp.publicclassnodefaultconstructorsample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.\n---- System.TypeLoadException : Could not load type 'assemblyresolvetestapp.publicclassnodefaultconstructorsample' from assembly 'AssemblyResolveTestApp, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
       at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()
----- Inner Stack Trace -----
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.Tests.AppDomainTests.<>c__DisplayClass57_0.<TestingCreateInstanceFromObjectHandle>b__0()

Test collection for System.Tests.EnvironmentTests
System.Tests.EnvironmentTests.GetFolderPath_Unix_PersonalIsHomeAndUserProfile
    Assert.Equal() Failure\n                        ↓ (pos 14)\nExpected: /Users/mdhwang\nActual:   /Users/mdhwang/Documents\n                        ↑ (pos 14)
       at System.Tests.EnvironmentTests.GetFolderPath_Unix_PersonalIsHomeAndUserProfile()
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)


Test collection for System.Tests.EnvironmentUserName
System.Tests.EnvironmentUserName.UserName_Valid
    Assert.False() Failure\nExpected: False\nActual:   True
       at System.Tests.EnvironmentUserName.UserName_Valid()
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label May 22, 2020
@marek-safar marek-safar added this to the 6.0.0 milestone Jun 24, 2020
@joperezr joperezr removed the untriaged New issue has not been triaged by the area owner label Jul 3, 2020
@mdh1418 mdh1418 changed the title System.Runtime tests fail on iOS System.Runtime.Extensions.Tests fails on iOS Apr 15, 2021
@mdh1418 mdh1418 changed the title System.Runtime.Extensions.Tests fails on iOS System.Runtime.Extensions.Tests fails on iOS, crashes on tvOS Apr 15, 2021
@mdh1418 mdh1418 added the os-tvos Apple tvOS label Apr 15, 2021
@mdh1418 mdh1418 changed the title System.Runtime.Extensions.Tests fails on iOS, crashes on tvOS System.Runtime.Extensions.Tests fails on iOS and tvOS Apr 29, 2021
@filipnavara
Copy link
Member

System.Tests.EnvironmentTests.OSVersion_ParseVersion should be excluded (just as on macOS), it uses private reflection on API that doesn't exist

System.Tests.Environment_Exit.ExitCode_VoidMainAppReturnsSetValue should be excluded on iOS, tvOS (and possibly Mac Catalyst) because external processes cannot be launched

GetFolderPath_Unix_PersonalIsHomeAndUserProfile is not valid for iOS, tvOS

System.Tests.AppDomainTests are likely fixed by updated AppleAppBuilder now

@steveisok
Copy link
Member

@mdh1418 The AppDomainTests can be re-enabled as they should work.

@mdh1418
Copy link
Member Author

mdh1418 commented Aug 11, 2021

System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle Still fails on MacCatalyst, but System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandleFullSignature passes on all iOS, tvOS, MacCatalyst now. The other tests still fail and stand as is.

@mdh1418
Copy link
Member Author

mdh1418 commented Aug 13, 2021

Both System.Tests.EnvironmentUserName.UserName_Valid and System.Tests.EnvironmentTests.GetFolderPath_Unix_PersonalIsHomeAndUserProfile are failing on iOS and tvOS due to the values Environment.UserName being string.Empty and Environment.GetEnvironmentVariable("HOME") being null.

On MacCatalyst, the values are not empty or null.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 13, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants