Skip to content

Fix unittesting our .xaml classes - #4105

Merged
21 commits merged into
masterfrom
dev/migrie/f/now-this-is-unittesting
Jan 10, 2020
Merged

21 commits merged into
masterfrom
dev/migrie/f/now-this-is-unittesting

Conversation

@zadjii-msft

@zadjii-msft Mike Griese (zadjii-msft) commented Jan 3, 2020 •

Copy link
Copy Markdown
Member

Summary of the Pull Request

New year, new unittests.

This PR introduces a new project, TestHostApp. This project is largely taken from the TAEF samples, and allows us to easily construct a helper executable and resources.pri for running TerminalApp unittests.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Unittesting for the TerminalApp project has been a horrifying process to try getting everything pieced together just right. Dependencies need to get added to manifests, binplaced correctly, and XAML resources need to get compiled together as well. In addition, using a MUX Application (as opposed to the Windows.UI.Xaml Application) has led to additional problems.

This was always a horrifying house of cards for us. Turns out, the reason this was so horrible is that the test infrastructure for doing what we're doing literally didn't exist when I started doing all that work last year.

So, with help from the TAEF team, I was able to get rid of our entire house of cards, and use a much simpler project to build and run the tests.

Unfortunately, the latest TAEF release has a minor bug in it's build rules, and only publishes the x86 version of a dll we need from them. But, the rest of this PR works for x86, and I'll bump this when that updated version is available. We should be able to review this even in the state it's in.

Validation Steps Performed

ran the tests yo

Comment thread NuGet.Config Resolved
Comment thread OpenConsole.sln Resolved
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 3, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 7, 2020
@zadjii-msft Mike Griese (zadjii-msft) added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Product-Terminal The new Windows Terminal. labels Jan 7, 2020
// NOTE: 03-Jan-2020
// This class is horrifyingly defined in CX, _NOT_ CppWinrt. It was largely
// taken straight from the TAEF sample code. However, it does _work_, and it's
// not about to be changed ever, so it's not worth the effort to try and port it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the .vssettings file to make sure the C++/CLI workload is actually installed ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, requested. otherwise, people will not be able to build our solution.

@zadjii-msft Mike Griese (zadjii-msft) Jan 7, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just dumped my own .vsconfig, and I didn't see anything that looked like it. From diff --color .vsconfig ../../../Documents/.vsconfig:

Details
6,9c6
<     "Microsoft.VisualStudio.Workload.Universal",
<     "Microsoft.VisualStudio.Workload.NativeDesktop",
<     "Microsoft.VisualStudio.Workload.ManagedDesktop",
<     "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
---
>     "Microsoft.NetCore.Component.SDK",
10a8
>     "Microsoft.Net.Component.4.6.1.TargetingPack",
12a11,18
>     "Microsoft.VisualStudio.Component.FSharp",
>     "Microsoft.NetCore.Component.DevelopmentTools",
>     "Microsoft.VisualStudio.Component.FSharp.WebTemplates",
>     "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
>     "Microsoft.VisualStudio.Component.DockerTools",
>     "Microsoft.NetCore.Component.Web",
>     "Microsoft.Net.Component.4.8.SDK",
>     "Microsoft.Net.Component.4.7.2.TargetingPack",
13a20,22
>     "Microsoft.VisualStudio.Component.TypeScript.3.7",
>     "Microsoft.VisualStudio.Component.JavaScript.TypeScript",
>     "Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
14a24,32
>     "Microsoft.VisualStudio.Component.TextTemplating",
>     "Component.Microsoft.VisualStudio.RazorExtension",
>     "Microsoft.VisualStudio.Component.IISExpress",
>     "Microsoft.VisualStudio.Component.SQL.ADAL",
>     "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime",
>     "Microsoft.VisualStudio.Component.Common.Azure.Tools",
>     "Microsoft.VisualStudio.Component.SQL.CLR",
>     "Microsoft.VisualStudio.Component.MSODBC.SQL",
>     "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils",
16c34
<     "Microsoft.Net.Component.4.TargetingPack",
---
>     "Microsoft.Net.Component.4.5.2.TargetingPack",
17a36,51
>     "Microsoft.VisualStudio.Component.SQL.SSDT",
>     "Microsoft.VisualStudio.Component.SQL.DataSources",
>     "Component.Microsoft.Web.LibraryManager",
>     "Microsoft.VisualStudio.ComponentGroup.Web",
>     "Microsoft.VisualStudio.Component.Web",
>     "Microsoft.VisualStudio.Component.IntelliCode",
>     "Microsoft.Net.Component.4.TargetingPack",
>     "Microsoft.Net.Component.4.5.1.TargetingPack",
>     "Microsoft.Net.Component.4.6.TargetingPack",
>     "Microsoft.Net.ComponentGroup.TargetingPacks.Common",
>     "Microsoft.Net.Core.Component.SDK.2.1",
>     "Microsoft.VisualStudio.Component.Azure.Compute.Emulator",
>     "Microsoft.VisualStudio.Component.Azure.ClientLibs",
>     "Microsoft.VisualStudio.Component.Azure.AuthoringTools",
>     "Microsoft.VisualStudio.Component.Debugger.TimeTravel",
>     "Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd",
19,21c53,63
<     "Microsoft.VisualStudio.Component.Debugger.JustInTime",
<     "Microsoft.VisualStudio.Component.Windows10SDK.18362",
<     "Microsoft.VisualStudio.ComponentGroup.UWP.Support",
---
>     "Microsoft.VisualStudio.Component.EntityFramework",
>     "Microsoft.VisualStudio.Component.LiveUnitTesting",
>     "Microsoft.VisualStudio.Component.AppInsights.Tools",
>     "Microsoft.VisualStudio.Component.WebDeploy",
>     "Component.Microsoft.VisualStudio.LiveShare",
>     "Microsoft.VisualStudio.Component.ClassDesigner",
>     "Microsoft.VisualStudio.Component.GraphDocument",
>     "Microsoft.VisualStudio.Component.CodeMap",
>     "Microsoft.Component.PythonTools",
>     "Microsoft.Component.PythonTools.Miniconda",
>     "Microsoft.Component.PythonTools.Web",
22a65,78
>     "Microsoft.VisualStudio.Component.Windows10SDK",
>     "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
>     "Microsoft.VisualStudio.Component.Graphics.Tools",
>     "Microsoft.VisualStudio.Component.VC.DiagnosticTools",
>     "Microsoft.VisualStudio.Component.Windows10SDK.18362",
>     "Component.CPython3.x64",
>     "Microsoft.VisualStudio.Workload.Python",
>     "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
>     "Microsoft.ComponentGroup.Blend",
>     "Microsoft.VisualStudio.Component.Debugger.JustInTime",
>     "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
>     "Microsoft.VisualStudio.Workload.ManagedDesktop",
>     "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
>     "Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native",
23a80,89
>     "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
>     "Microsoft.VisualStudio.Component.VC.CMake.Project",
>     "Microsoft.VisualStudio.Component.VC.ATL",
>     "Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
>     "Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
>     "Microsoft.VisualStudio.Component.Windows10SDK.17763",
>     "Microsoft.Component.VC.Runtime.UCRTSDK",
>     "Microsoft.VisualStudio.Workload.NativeDesktop",
>     "Microsoft.Component.NetFX.Native",
>     "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard",
25,26c91,92
<     "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
<     "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
---
>     "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin",
>     "Microsoft.VisualStudio.ComponentGroup.UWP.Support",
28,29c94,95
<     "Microsoft.VisualStudio.Component.VC.v142.x86.x64",
<     "Microsoft.VisualStudio.Component.VC.v142.ARM64",
---
>     "Microsoft.VisualStudio.Component.UWP.VC.ARM64",
>     "Microsoft.VisualStudio.Component.VC.Tools.ARM",
31,32c97,101
<     "Microsoft.VisualStudio.ComponentGroup.UWP.VC.v142",
<     "Microsoft.VisualStudio.Component.UWP.VC.ARM64"
---
>     "Microsoft.VisualStudio.Workload.Universal",
>     "Microsoft.VisualStudio.Workload.NetCoreTools",
>     "Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.1",
>     "Microsoft.NetCore.ComponentGroup.Web.2.1",
>     "Microsoft.Net.Component.4.7.2.SDK"
34c103
< }
---
> }

Comment thread tools/runut.cmd Resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 7, 2020

@miniksa Michael Niksa (miniksa) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything else to really complain about here, but please make sure Dustin L. Howett (MSFT) (@DHowett-MSFT) is the other signer on this because he has a few outstanding threads left still open.

…is-is-unittesting

# Conflicts:
#	OpenConsole.sln
Comment thread tools/runut.cmd Resolved
@zadjii-msft Mike Griese (zadjii-msft) added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 10, 2020
@ghost

Copy link
Copy Markdown

Hello Mike Griese (@zadjii-msft)!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. AutoMerge Marked for automatic merge by the bot when requirements are met Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out how to test our .xaml classes

3 participants