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

dotnet7 xunit template throws System.NotSupportedException on ppc64le #277

Closed
Sapana-Khemkar opened this issue Jan 13, 2023 · 1 comment
Closed

Comments

@Sapana-Khemkar
Copy link

Details

On ppc64le machine with dotnet7 installed create xunit template project using command dotnet new xunit and built it successfully using dotnet build
Run tests using dotnet test fails with following error

# dotnet test
  Determining projects to restore...
  All projects are up-to-date for restore.
  xunit_sample -> /root/sapana/xunit_sample/bin/Debug/net7.0/xunit_sample.dll
Test run for /root/sapana/xunit_sample/bin/Debug/net7.0/xunit_sample.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.4.0+c02ece877c62577810f893c44279ce79af820112 (ppc64le)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestPlatform.ObjectModel.Constants' threw an exception.
 ---> System.NotSupportedException: Specified method is not supported.
   at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformEnvironment.get_Architecture()
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.XmlRunSettingsUtilities.get_OSArchitecture()
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.Constants..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.FromXml(XmlReader reader)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.XmlRunSettingsUtilities.GetNodeValue[RunConfiguration](String settingsXml, String nodeName, Func`2 nodeParser)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.XmlRunSettingsUtilities.GetRunConfigurationNode(String settingsXml)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests..ctor(IRequestData requestData, String package, String runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, IInternalTestRunEventsHandler testRunEventsHandler, ITestPlatformEventSource testPlatformEventSource, ITestEventsPublisher testEventsPublisher, IThread platformThread, IDataSerializer dataSerializer)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests..ctor(IRequestData requestData, String package, String runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, IInternalTestRunEventsHandler testRunEventsHandler, ITestPlatformEventSource testPlatformEventSource)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources..ctor(IRequestData requestData, Dictionary`2 adapterSourceMap, String package, String runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, IInternalTestRunEventsHandler testRunEventsHandler, Dictionary`2 executorUriVsSourceList)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources..ctor(IRequestData requestData, Dictionary`2 adapterSourceMap, String package, String runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, IInternalTestRunEventsHandler testRunEventsHandler)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.ExecutionManager.StartTestRun(Dictionary`2 adapterSourceMap, String package, String runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, IInternalTestRunEventsHandler runEventsHandler)

Test Run Aborted.

Expected Behavior

One test case should pass as below
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: < 1 ms - xunit_sample.dll (net7.0)

Known Workaround

Go to .csproj file and change "Microsoft.NET.Test.Sdk" version from 17.3.2 to 17.4.0 as below
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />

@Evangelink
Copy link
Member

@Sapana-Khemkar the test SDK was bumped so I will move forward with closing this issue. Let me know if you are still facing some issue.

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

No branches or pull requests

2 participants