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 the TabTests! #3833

Merged
15 commits merged into from
Dec 6, 2019
Merged

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Dec 4, 2019

Summary of the Pull Request

Fix the TabTests, and enable testing of types with XAML content. The TabTests were written many, many moons ago. they were intended to be our tests of XAML-like content within the Terminal app, so we could have unittests of Tabs, Panes, etc. Between their initial authoring and the day they were checked in, we had a bunch of build changes come in and break them irreperably.

We've gotten them fixed now with one weird trick doctors hate me. As long as there isn't an App.xbf in the test's output directory, then the tests will deploy just fine.

We also needed a bit of magic, cribbed straight from TAEF, to enable running test code synchronously on the UI thread. Hence, CppwinrtTailored.h.

References

PR Checklist

Validation Steps Performed

image

  This helper doesn't solve our problems, but it's there.
  1. Make TerminalAppLib _not_ build App.xaml. I moved it to
     TerminalApp.vcxproj, so only the DLL builds it. No idea if that actually
     builds the DLL, package correctly, I'm just trying to get the XAML test to
     work.

  2. This causes weird bugs trying to import the TerminalAppLib project, for
     whatever reason. Unfortunately, it causes the TerminalApp types to not
     appear in the final manifest, so I think we'll need to reference that winmd
     manually.

  3. Make sure to include the `("UAP:Host", "Xaml")` bit in the test metadata.

  4. Now, the `RunOnUIThread` test actually passes. It won't work with our
     types, but _progress_
  I need to revert the App.xaml->TerminalApp change, because that's going to
  totally mess up the build. Full stop, that needs to happen.

  The problem we're running into now is that
  _ConsoleGenerateAdditionalWinmdManifests doesn't generate a .manifest for
  TerminalAppLib, so it never gets included into the Appxmanifest.

  I could try manually adding the TerminalApp types to the manifest prototype
  again. That's an option. But since I'll need to revert the App change anyways,
  idk if that'll matter. Maybe if we manually _don't_ include App.xbf in the
  output, and TerminalApp.App in the manifest?
  Just don't include the App.xbf and it magic works?

  Somewhere after we create the TermControl we crash, but that's _so_ good man.
  We're so close.
@zadjii-msft
Copy link
Member Author

(draft PRs don't run the CI but treat this as a draft)

@zadjii-msft zadjii-msft marked this pull request as ready for review December 4, 2019 18:55
  They didn't work, and won't till we get an updated TAEF
@zadjii-msft zadjii-msft added Area-Build Issues pertaining to the build system, CI, infrastructure, meta Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Product-Terminal The new Windows Terminal. labels Dec 4, 2019
@zadjii-msft
Copy link
Member Author

(this guy is ready for review now)

@zadjii-msft zadjii-msft changed the title Fix the TabTests? Fix the TabTests! Dec 4, 2019
@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Dec 6, 2019
@miniksa
Copy link
Member

miniksa commented Dec 6, 2019

image
image
image

I love these commit messages.

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.

Couple of questions before I sign.

@zadjii-msft
Copy link
Member Author

@miniksa @carlos-zamora @DHowett-MSFT @leonMSFT

Heads up, if you want to run the LocalTests after merging this - you'll need to manually delete the old App.xbf out of the bin\x64\Debug\LocalTests_TerminalApp directory. It won't get cleaned up automatically, and if it's there, the TabTests will fail. Fortunately the rest of the tests will still pass.

@@ -77,7 +76,7 @@
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>User32.lib;WindowsApp.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, wait, if this is using the cppwinrt pre props you don't even need the link block at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦

Copy link
Member Author

Choose a reason for hiding this comment

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

wait no though I do?

Copy link
Member Author

Choose a reason for hiding this comment

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

The cppwinrt preprops only was WindowsApp.lib...

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Dec 6, 2019
@ghost
Copy link

ghost commented Dec 6, 2019

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.

@ghost ghost merged commit 9145903 into master Dec 6, 2019
@ghost ghost deleted the dev/migrie/b/fix-tab-tests-harder-better-faster-stronger branch December 6, 2019 20:45
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-Build Issues pertaining to the build system, CI, infrastructure, meta 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 Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
4 participants