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

Add just the test infrastructure bits from #4354 #4382

Merged
3 commits merged into from
Jan 29, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

#4354 is a pretty complicated PR. It's got a bunch of conpty changes, but what it also has was some critical improvements to the roundtrip test suite. I'm working on some other bugfixes in the same area currently, and need these tests enhancements in those branches now. The rest of #4354 is complex enough that I don't trust it will get merged soon (if ever). However, these fixes should be in regardless.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This is four main changes:

  • Enable conpty to be fully enabled in unittests. Just setting up a VT renderer isn't enough to trick the host into being in conpty mode - it also needs to have some other flags set.
  • Some minor changes to CommonState to better configure the common test state for conpty
  • Move some of the verify helpers from ConptyRoundtripTests into their own helper class, to be shared in multiple tests
  • Add a TerminalBufferTests class, for testing the Terminal buffer directly (without conpty).

This change is really easier than
image
would suggest, I promise.

@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. labels Jan 28, 2020
@zadjii-msft
Copy link
Member Author

zadjii-msft commented Jan 28, 2020

/azp run

I really don't think I affected the CanMoveByWord_NonEmptyBuffer tests, so I'm just re-running. Curious that the failure here is different than the #4344 failure that's usually hitting.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miniksa
Copy link
Member

miniksa commented Jan 28, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miniksa
Copy link
Member

miniksa commented Jan 28, 2020

If this succeeds, it might just be the solution to #4384

@miniksa
Copy link
Member

miniksa commented Jan 28, 2020

OK it succeeded twice. I think this might solve the x64 unit test failures then. Reading it fully now. @DHowett-MSFT

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.

This does indeed look straightforward. I don't super like the "fools the console into being in pty mode" defines sprayed around, but I don't have a better idea without either changing the entire initialization pipeline or something of that ilk. (Going to guess that you had the same mental debate and settled on this.) So I approve. Especially because it looks like this fixes the x64 unit test hang.


VERIFY_ARE_EQUAL(first.length(), cch);
VERIFY_ARE_EQUAL(first, actualString);
Log::Comment(NoThrowString().Format(L"Expected =\t\"%hs\"", first.c_str()));
Copy link
Contributor

Choose a reason for hiding this comment

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

will this print raw escapes, or escape them?

Copy link
Contributor

Choose a reason for hiding this comment

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

should we replace 0x1b with 0x241b?


VERIFY_ARE_EQUAL(first.length(), cch);
VERIFY_ARE_EQUAL(first, actualString);
Log::Comment(NoThrowString().Format(L"Expected =\t\"%hs\"", first.c_str()));
Copy link
Contributor

Choose a reason for hiding this comment

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

should we replace 0x1b with 0x241b?

@zadjii-msft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 29, 2020
@ghost
Copy link

ghost commented Jan 29, 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.

@zadjii-msft
Copy link
Member Author

For the record, the manual run I did above was just to give us more data if this does in fact fix #4344. The tests did pass, so it seems to be looking good. I don't know what I did, but if this next run passes too, lets just close #4344 as well.

@zadjii-msft
Copy link
Member Author

zadjii-msft commented Jan 29, 2020

WELP

/azp run

EDIT: why can't I just slap that into a comment and have it work? I want to be able to say something and also trigger a build ;__:

@zadjii-msft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zadjii-msft
Copy link
Member Author

Well https://dev.azure.com/ms/Terminal/_build/results?buildId=60592&view=logs&j=e7365288-57d7-5349-8dfa-9c195127bd77 is curious.

The x86 test pass already has errors with UiaTextRangeTests::CanMoveByWord_NonEmptyBuffer and UiaTextRangeTests::CanMoveEndpointByUnitWord. But it kept on chugging along till it got to the roundtrip/output tests, where it got stuck again, in x86 this time though. x64 already passed.

@zadjii-msft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost ghost merged commit 685720a into master Jan 29, 2020
@ghost ghost deleted the dev/migrie/b/just-conpty-test-fixes branch January 29, 2020 16:33
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.

3 participants