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

Fix unittesting our .xaml classes #4105

Merged
21 commits merged into from
Jan 10, 2020
Merged

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Jan 3, 2020

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

NuGet.Config Outdated Show resolved Hide resolved
OpenConsole.sln Outdated Show resolved Hide resolved
src/cascadia/LocalTests_TerminalApp/pch.h Outdated Show resolved Hide 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 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
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
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.

Copy link
Member Author

@zadjii-msft zadjii-msft Jan 7, 2020

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:

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
< }
---
> }

tools/runut.cmd Outdated Show resolved Hide 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
Copy link
Member

@miniksa miniksa left a comment

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 @DHowett-MSFT is the other signer on this because he has a few outstanding threads left still open.

@DHowett-MSFT DHowett-MSFT self-assigned this Jan 9, 2020
…is-is-unittesting

# Conflicts:
#	OpenConsole.sln
@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 10, 2020
@ghost
Copy link

ghost commented Jan 10, 2020

Hello @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