TerminalAppLocalTests failing when running unit tests locally #4943

Closed
opened 2026-01-31 00:01:15 +00:00 by claunia · 4 comments
Owner

Originally created by @j4james on GitHub (Nov 12, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Environment

Windows build number: Version 10.0.18362.356
Windows Terminal version (if applicable): commit e2994ff890

Any other software?
Visual Studio Community 2019 Version 16.3.8

Steps to reproduce

  1. Checkout a recent version of the Terminal.
  2. Build the code.
  3. Execute runut in the tools directory.

Expected behavior

I'm used to having a few failures in the TerminalInputModifierKeyTests, and I know a couple of TabTests are blocked, but the rest of the tests I would usually expected to pass.

Actual behavior

Recently I've been getting failures in TerminalAppLocalTests that I've never had before:

TerminalAppLocalTests::SettingsTests::TryCreateWinRTType [Failed]
TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction [Failed]
TerminalAppLocalTests::KeyBindingsTests::LayerKeybindings [Failed]
TerminalAppLocalTests::KeyBindingsTests::UnbindKeybindings [Failed]

The TryCreateWinRTType test is failing because it's throwing an unidentified C++ exception (I think in the TerminalSettings constructor):

StartGroup: TerminalAppLocalTests::SettingsTests::TryCreateWinRTType
Error: Caught an unidentified C++ exception
EndGroup: TerminalAppLocalTests::SettingsTests::TryCreateWinRTType [Failed]

The KeyBindingsTests are failing because the KeyChordSerialization::FromString method is throwing an exception for all of the key chords, so nothing gets added to the appKeyBindings in the LayerJson call. The test output isn't particularly informative, but here's an example of one of them:

StartGroup: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction
Verify: IsTrue(parseResult)
Verify: IsTrue(parseResult)
Verify: IsTrue(parseResult)
Verify: IsNotNull(appKeyBindings)
Verify: AreEqual(0u, appKeyBindings->_keyShortcuts.size())
Error: Verify: AreEqual(1u, appKeyBindings->_keyShortcuts.size()) - Values (1, 0) [File: C:\Users\James\CPP\terminal\src\cascadia\LocalTests_TerminalApp\KeyBindingsTests.cpp, Function: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction, Line: 63]
EndGroup: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction [Failed]

Are these failures expected when running the tests locally or is it just me?

Originally created by @j4james on GitHub (Nov 12, 2019). Originally assigned to: @zadjii-msft on GitHub. # Environment Windows build number: Version 10.0.18362.356 Windows Terminal version (if applicable): commit e2994ff8908f5a8418f24f2e2954a6c163f910b6 Any other software? Visual Studio Community 2019 Version 16.3.8 # Steps to reproduce 1. Checkout a recent version of the Terminal. 2. Build the code. 3. Execute `runut` in the tools directory. # Expected behavior I'm used to having a few failures in the `TerminalInputModifierKeyTests`, and I know a couple of `TabTests` are blocked, but the rest of the tests I would usually expected to pass. # Actual behavior Recently I've been getting failures in `TerminalAppLocalTests` that I've never had before: TerminalAppLocalTests::SettingsTests::TryCreateWinRTType [Failed] TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction [Failed] TerminalAppLocalTests::KeyBindingsTests::LayerKeybindings [Failed] TerminalAppLocalTests::KeyBindingsTests::UnbindKeybindings [Failed] The `TryCreateWinRTType` test is failing because it's throwing an unidentified C++ exception (I think in the `TerminalSettings` constructor): ``` StartGroup: TerminalAppLocalTests::SettingsTests::TryCreateWinRTType Error: Caught an unidentified C++ exception EndGroup: TerminalAppLocalTests::SettingsTests::TryCreateWinRTType [Failed] ``` The `KeyBindingsTests` are failing because the `KeyChordSerialization::FromString` method is throwing an exception for all of the key chords, so nothing gets added to the `appKeyBindings` in the `LayerJson` call. The test output isn't particularly informative, but here's an example of one of them: ``` StartGroup: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction Verify: IsTrue(parseResult) Verify: IsTrue(parseResult) Verify: IsTrue(parseResult) Verify: IsNotNull(appKeyBindings) Verify: AreEqual(0u, appKeyBindings->_keyShortcuts.size()) Error: Verify: AreEqual(1u, appKeyBindings->_keyShortcuts.size()) - Values (1, 0) [File: C:\Users\James\CPP\terminal\src\cascadia\LocalTests_TerminalApp\KeyBindingsTests.cpp, Function: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction, Line: 63] EndGroup: TerminalAppLocalTests::KeyBindingsTests::ManyKeysSameAction [Failed] ``` Are these failures expected when running the tests locally or is it just me?
Author
Owner

@zadjii-msft commented on GitHub (Nov 12, 2019):

These are absolutely not expected - only the TabTests should be failing #2472. I'll take a look.

@zadjii-msft commented on GitHub (Nov 12, 2019): These are absolutely _not_ expected - only the TabTests should be failing #2472. I'll take a look.
Author
Owner

@j4james commented on GitHub (Nov 12, 2019):

In case you care about the TerminalInputModifierKeyTests too, I think those are failing for me because I have a UK keyboard - the test dies on the VK_OEM_3 key. Here's a section of the test output where it fails:

Testing Key 0xc0
Expected, Buffer = "", ""
Verify: SUCCEEDED(StringCchLengthW(s_pwszInputExpected, STRSAFE_MAX_CCH, &cInputExpected))
Error: Verify: AreEqual(cInputExpected, records.size()): Verify expected and actual input array lengths matched. - Values (0, 1) [File: C:\Users\James\CPP\terminal\src\terminal\adapter\ut_adapter\inputTest.cpp, Function: Microsoft::Console::VirtualTerminal::InputTest::s_TerminalInputTestCallback, Line: 87]
TAEF: A crash with exception code 0xC0000409 occurred in module "ConAdapter.Unit.Tests.dll" in process "te.processhost.exe" (pid:13732).

This could be resolved by simply skipping that key the same way we skip VK_OEM_2, but it wouldn't surprise me if other international keyboards failed on other keys as well. I've been happy to accept that those are just expected failures for my particular setup.

@j4james commented on GitHub (Nov 12, 2019): In case you care about the `TerminalInputModifierKeyTests` too, I think those are failing for me because I have a UK keyboard - the test dies on the `VK_OEM_3` key. Here's a section of the test output where it fails: ``` Testing Key 0xc0 Expected, Buffer = "", "" Verify: SUCCEEDED(StringCchLengthW(s_pwszInputExpected, STRSAFE_MAX_CCH, &cInputExpected)) Error: Verify: AreEqual(cInputExpected, records.size()): Verify expected and actual input array lengths matched. - Values (0, 1) [File: C:\Users\James\CPP\terminal\src\terminal\adapter\ut_adapter\inputTest.cpp, Function: Microsoft::Console::VirtualTerminal::InputTest::s_TerminalInputTestCallback, Line: 87] TAEF: A crash with exception code 0xC0000409 occurred in module "ConAdapter.Unit.Tests.dll" in process "te.processhost.exe" (pid:13732). ``` This could be resolved by simply skipping that key the same way we skip `VK_OEM_2`, but it wouldn't surprise me if other international keyboards failed on other keys as well. I've been happy to accept that those are just expected failures for my particular setup.
Author
Owner

@zadjii-msft commented on GitHub (Nov 12, 2019):

@j4james Thanks for digging in on that TerminalInputModifierKeyTests test defect. IIRC we had a co-worker who used to use the Colemak keyboard layout, and he'd always have to switch before running those tests. We probably should do something to make them more robust, but let's move it to another thread for now.

EDIT: moved to #3543


Hmm, we seem to be failing to create the KeyChord winrt object:

    return winrt::Microsoft::Terminal::Settings::KeyChord{ modifiers, vkey };

I really doubt that this is because of any key-chord serialization recently. This might be one of the more build-system related changes that regressed this. Summoning @DHowett-MSFT anything you know of that would break this in an unpackaged context?

Maybe that CRT change that we didn't worry about because "the app never runs in an unpackaged context" but these tests run in an unpackaged context?

@zadjii-msft commented on GitHub (Nov 12, 2019): @j4james Thanks for digging in on that `TerminalInputModifierKeyTests` test defect. IIRC we had a co-worker who used to use the Colemak keyboard layout, and he'd always have to switch before running those tests. We probably should do something to make them more robust, but let's move it to another thread for now. EDIT: moved to #3543 <hr> Hmm, we seem to be failing to create the `KeyChord` winrt object: ```c++ return winrt::Microsoft::Terminal::Settings::KeyChord{ modifiers, vkey }; ``` I really doubt that this is because of any key-chord serialization recently. This might be one of the more build-system related changes that regressed this. Summoning @DHowett-MSFT anything you know of that would break this in an unpackaged context? Maybe that CRT change that we didn't worry about because "the app never runs in an unpackaged context" but _these tests run in an unpackaged context_?
Author
Owner

@zadjii-msft commented on GitHub (Nov 18, 2019):

So these horrifyingly broke because of #3474. That PR broke our unpackaged activation story, and our local tests run unpackaged. They can totally run in a packaged context though, and I know how to do that, I just need to take the time to fix them.


Unrelated note to self: In fact, with some of the work @miniksa is working on in #3236, I might actually be able to also fix the TabTests, by just making them a proper UWP test, not a centennial test.
@zadjii-msft commented on GitHub (Nov 18, 2019): So these horrifyingly broke because of #3474. That PR broke our unpackaged activation story, and our local tests run unpackaged. They can totally run in a packaged context though, and I know how to do that, I just need to take the time to fix them. <hr> Unrelated note to self: In fact, with some of the work @miniksa is working on in #3236, I might actually be able to also fix the TabTests, by just making them a proper UWP test, not a centennial test.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4943