Skip to content

Port more tests#59783

Merged
sharwell merged 6 commits intodotnet:mainfrom
sharwell:port-more-tests
Mar 1, 2022
Merged

Port more tests#59783
sharwell merged 6 commits intodotnet:mainfrom
sharwell:port-more-tests

Conversation

@sharwell
Copy link
Copy Markdown
Contributor

  • Port CSharpGoToImplementation and BasicGoToImplementation
  • Port CSharpAddMissingReference
  • Various test cleanup

Review commit-by-commit recommended

@sharwell sharwell requested a review from a team as a code owner February 25, 2022 22:33
@ghost ghost added the Area-Infrastructure label Feb 25, 2022
Comment on lines +94 to +95
var dirtyModifier = await TestServices.Editor.GetDirtyIndicatorAsync(HangMitigatingCancellationToken);
Assert.Equal($"FileImplementation.cs{dirtyModifier}", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There isn't a way to check the dirty modifier and base name separately?

Copy link
Copy Markdown
Contributor Author

@sharwell sharwell Feb 25, 2022

Choose a reason for hiding this comment

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

One could be created. There are several different approaches that would work, but for now this one seemed like the least amount of thinking work. 😂

public async Task<string> GetDirtyIndicatorAsync(CancellationToken cancellationToken)
{
var version = await TestServices.Shell.GetVersionAsync(cancellationToken);
if (version < Version.Parse("17.2.32224.407"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it looks like the PR added an option - to be resilient in case they change the default values for it, should we just have a helper that asserts the name is either dot or star?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Interesting, this is a user-visible option too:
image

Visual Studio can take a long time to start, which causes test runs to
fail spuriously.
@sharwell sharwell requested a review from a team as a code owner March 1, 2022 17:22
Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Approving especially to get the 25 minute timeout bump done.

}

builder.Append(" --blame-crash --blame-hang-dump-type full --blame-hang-timeout 15minutes");
builder.Append(" --blame-crash --blame-hang-dump-type full --blame-hang-timeout 25minutes");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a request (but not in this PR, so we don't hold it up), let's get a comment here linking to a bug to track the slow starts. I'm thinking it might be always good that there's more or less a comment here pointing to what the "slow test" is if ever we needed to drop this; in hindsight I should have done that to start.

Comment on lines +895 to +897
await TestServices.Workspace.WaitForAllAsyncOperationsAsync(
new[] { FeatureAttribute.Workspace, FeatureAttribute.NavigateTo },
cancellationToken);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why the workspace wait after the command but not before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was accounting for the possibility that navigation may be asynchronous. It may be possible to remove this; I'm not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Specifically, this was my new replacement for the following old code:

if (expectedNavigateWindowName is not null)
{
_editorInProc.WaitForActiveWindow(expectedNavigateWindowName);
}


public async Task GoToImplementationAsync(CancellationToken cancellationToken)
{
await TestServices.Shell.ExecuteCommandAsync(WellKnownCommands.Edit.GoToImplementation, cancellationToken);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this method switch to main thread first thing as the existing GoToBaseAsync does?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same Q for the GoToDefinitionAsync method above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

➡️ No, these methods don't do any work with UI thread affinity that the caller is responsible for

@sharwell sharwell merged commit d254f00 into dotnet:main Mar 1, 2022
@ghost ghost added this to the Next milestone Mar 1, 2022
@sharwell sharwell deleted the port-more-tests branch March 1, 2022 20:42
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants