-
Notifications
You must be signed in to change notification settings - Fork 31
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
StaTheory is not supported in Visual Studio Runner #30
Comments
What version are you using? When I open the xunit.stafact solution itself, it defines several StaTheory tests and they all run in the Test Explorer. |
I am running into the same issue with MaterialDesignInXaml. xunit 2.4.1 Microsoft Visual Studio Enterprise 2019 Installed Version: Enterprise Visual C++ 2019 00435-60000-00000-AA592 ASP.NET and Web Tools 2019 16.3.283.64955 ASP.NET Web Frameworks and Tools 2019 16.3.283.64955 Azure App Service Tools v3.0.0 16.3.283.64955 Azure Functions and Web Jobs Tools 16.3.283.64955 C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Common Azure Tools 1.10 Extensibility Message Bus 1.2.0 (d16-2@8b56e20) GitHub.VisualStudio 2.10.6.8105 IntelliCode Extension 1.0 Microsoft Azure Tools 2.9 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Microsoft JVM Debugger 1.0 Microsoft Library Manager 2.0.83+gbc8a4b23ec Microsoft MI-Based Debugger 1.0 Microsoft Visual C++ Wizards 1.0 Microsoft Visual Studio Tools for Containers 1.1 Microsoft Visual Studio VC Package 1.0 Mono Debugging for Visual Studio 16.3.7 (9d260c5) NuGet Package Manager 5.3.0 Project System Tools 1.0 ProjectServicesPackage Extension 1.0 Snapshot Debugging Extension 1.0 SQL Server Data Tools 16.0.61908.27190 TypeScript Tools 16.0.10821.2002 Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Visual Studio Code Debug Adapter Host Package 1.0 Visual Studio Tools for Containers 1.0 VisualStudio.Mac 1.0 Xamarin 16.3.0.274 (d16-3@06531f8) Xamarin Designer 16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670) Xamarin Templates 16.3.565 (27e9746) Xamarin.Android SDK 10.0.0.43 (d16-3/8af1ca8) Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208) Diagnostic output as well: [9/29/2019 9:33:23.847 PM Diagnostic] Operation Dequeue : 'RunSelectedOperation' |
This consistently reproduces in https://github.com/dotnet/winforms
|
@RussKie I tried your repro, but couldn't get the solution to build. I get these errors:
|
Are you doing it from a cli or from VS?
Please try starting it from build-local.ps1
…On Sat, Oct 5, 2019, 1:08 AM Andrew Arnott ***@***.***> wrote:
@RussKie <https://github.com/RussKie> I tried your repro, but couldn't
get the solution to build. I get these errors:
1>------ Skipped Build: Project: Accessibility-version ------
1>
2>------ Skipped Build: Project: InternalUtilitiesForTests ------
2>
3>------ Skipped Build: Project: Microsoft.Dotnet.Winforms.ProjectTemplates ------
3>
4>------ Skipped Build: Project: Accessibility (src\Accessibility\Accessibility) ------
4>
5>------ Skipped Build: Project: System.Windows.Forms ------
5>
6>------ Skipped Build: Project: System.Windows.Forms.Design.Editors ------
6>
7>------ Build started: Project: System.Windows.Forms.IntegrationTests.Common, Configuration: Debug Any CPU ------
8>------ Skipped Build: Project: System.Windows.Forms.Tests ------
8>
9>------ Build started: Project: AccessibilityTests, Configuration: Debug Any CPU ------
10>------ Skipped Build: Project: System.Windows.Forms.Design ------
10>
11>------ Skipped Build: Project: System.Drawing.Design.Facade ------
11>
12>------ Skipped Build: Project: System.Windows.Forms.Design.Editors.Tests ------
12>
13>------ Skipped Build: Project: System.Design.Facade ------
13>
14>------ Skipped Build: Project: System.Drawing.Facade ------
14>
15>------ Skipped Build: Project: System.Windows.Forms.Design.Tests ------
15>
16>------ Skipped Build: Project: Microsoft.Private.Winforms ------
16>
7>CSC : error CS0006: Metadata file 'D:\git\winforms\artifacts\bin\Accessibility\Debug\netcoreapp5.0\Accessibility.dll' could not be found
7>CSC : error CS0006: Metadata file 'D:\git\winforms\artifacts\bin\System.Windows.Forms\Debug\netcoreapp5.0\ref\System.Windows.Forms.dll' could not be found
7>Done building project "System.Windows.Forms.IntegrationTests.Common.csproj" -- FAILED.
17>------ Skipped Build: Project: WinformsControlsTest ------
17>
18>------ Skipped Build: Project: MauiButtonTests ------
18>
19>------ Build started: Project: MauiComboBoxTests, Configuration: Debug Any CPU ------
20>------ Skipped Build: Project: System.Windows.Forms.IntegrationTests ------
20>
19>CSC : error CS0006: Metadata file 'D:\git\winforms\artifacts\bin\Accessibility\Debug\netcoreapp5.0\Accessibility.dll' could not be found
19>CSC : error CS0006: Metadata file 'D:\git\winforms\artifacts\bin\System.Windows.Forms\Debug\netcoreapp5.0\ref\System.Windows.Forms.dll' could not be found
19>CSC : error CS0006: Metadata file 'D:\git\winforms\artifacts\bin\System.Windows.Forms.IntegrationTests.Common\Debug\netcoreapp5.0\System.Windows.Forms.IntegrationTests.Common.dll' could not be found
19>Done building project "MauiComboBoxTests.csproj" -- FAILED.
21>------ Skipped Build: Project: System.Windows.Forms.Maui.IntegrationTests ------
21>
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: The "GenerateResource" task failed unexpectedly.
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.ProcessResourceFiles.get_HaveSystemResourcesExtensionsReference()
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.ProcessResourceFiles.WriteBinaryResources(ReaderInfo reader, String filename)
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(ReaderInfo reader, String filename)
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFileOrDir)
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List`1 inputs, List`1 satelliteInputs, List`1 outputs, Boolean sourcePath, Boolean usePreserializedResources, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass, Boolean extractingResWFiles, String resWOutputDirectory)
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.Tasks.GenerateResource.Execute()
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
9>C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3056,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
9>Done building project "AccessibilityTests.csproj" -- FAILED.
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 18 skipped ==========
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30?email_source=notifications&email_token=ABBTEXVKA2FDG3XROPKE4IDQM5L7BA5CNFSM4IZP65VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAL6QAY#issuecomment-538437635>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBTEXWBJCTXJK7DDDJIBCDQM5L7BANCNFSM4IZP65VA>
.
|
I was doing it from VS. Isn't that what the repro claims is failing? Are the tests not running within VS or from the command line? Anyway, I'll try your script. |
You need to run the script to make it compilable from VS.
It creates a symlink for VS to the local .dotnet folder, else VS can't find
the sdk.
…On Sat, Oct 5, 2019, 12:44 PM Andrew Arnott ***@***.***> wrote:
I was doing it from VS. Isn't that what the repro claims is failing? Are
the tests not running within VS or from the command line?
Anyway, I'll try your script.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30?email_source=notifications&email_token=ABBTEXQ7J6VRRSG7V3GTFB3QM75QRA5CNFSM4IZP65VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEANIQHA#issuecomment-538609692>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBTEXRGMLBRFDGJV6MSROTQM75QRANCNFSM4IZP65VA>
.
|
I installed the SDK already. And I am not fond of the fact that the script requires elevation. The problem with the build errors above isn't the lack of an SDK--it looks like build ordering to me. Is there any way the winforms repo can be fixed up so that it builds first time in VS without special steps? IMO nearly every .NET Core SDK based repo ought to be able to restore, build and test without elevation. I have this working, including .NET Core SDK installation in a user-location, over at https://github.com/aarnott/library.template. |
So I cloned the repo in a Windows Sandbox VM, installed the SDK and VS per your repro steps, and ran the build-local.ps1 script, which immediately failed.
|
Ironically, following that up with just Good news: I can repro the problem. :) |
So far we couldn't find a good way. VS uses an sdk from the global dotnet folder, but we need a specific sdk installed locally (hence the elevation to create a symlink). |
I think UITheoryTestCase is not usable in VS because it must be made serializable by implementing serialize and deserialize methods in addition to a adding a parameterless constructor? |
The following test would not be executable: public class WebBrowserTests { public static IEnumerable<object[]> TestData() { yield return new object[] { null }; yield return new object[] { new object() }; } [StaTheory] [MemberData(nameof(TestData))] public void TheoryTest(object parent) { Assert.Null(parent); } } The error message indicates that the test cannot be deserialised: Test case WebBrowserTests failed to deserialize: Test case deserialization failure: System.InvalidOperationException: Could not de-serialize type 'Xunit.Sdk.UITheoryTestCase' because it lacks a parameterless constructor. at Xunit.Serialization.XunitSerializationInfo.DeserializeSerializable(Type type, String serializedValue) at Xunit.Serialization.XunitSerializationInfo.Deserialize(Type type, String serializedValue) at Xunit.Sdk.SerializationHelper.Deserialize[T](String serializedValue) at Xunit.Sdk.XunitTestFrameworkExecutor.Deserialize(String value) at Xunit.Sdk.TestCaseBulkDeserializer.Deserialize(ITestFrameworkDiscoverer discoverer, ITestFrameworkExecutor executor, String serialization) Add serialisation plumbing to fix the issue. Fixes AArnott#30
Thank you @weltkante, I believe your suggestion is right on the money - I was able to run WinForms' tests in VS with a little change. |
Example
The text was updated successfully, but these errors were encountered: