-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 .NET Core project tests #32122
Fix .NET Core project tests #32122
Conversation
Closes dotnet#18996 Closes dotnet#19090 Closes dotnet#19091
Integration tests now ignore error list entries not associated with a project, since these entries should have been cleared when the solution closed. This workaround should be removed when dotnet#32121 is resolved.
@@ -32,73 +32,145 @@ public void WaitForNoErrorsInErrorList() | |||
|
|||
public void NavigateToErrorListItem(int itemIndex) | |||
{ | |||
var errorItems = GetErrorItems().AsEnumerable(); | |||
var errorItems = GetErrorItems().AsEnumerable().ToArray(); | |||
if (itemIndex > errorItems.Count()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Don't need to use linq here or below for count. I thought we had an analyzer to catch these..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but I'm fine with leaving this so we can move the PR forward more efficiently and it's only test code.
|
||
public static string GetFileName(this IVsTaskItem item) | ||
{ | ||
ErrorHandler.ThrowOnFailure(item.Document(out var fileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this return an empty string for error list items without document name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. It's the pattern I used in the test harness experiment and it worked for all the tests we have today. We can always adjust it if we need to test a new scenario and we haven't completed the switch to Apex yet.
=> ExecuteCommand(WellKnownCommandNames.ProjectAndSolutionContextMenus_Solution_RestoreNuGetPackages); | ||
public bool RestoreNuGetPackages(string projectName) | ||
{ | ||
var solutionRestoreService = InvokeOnUIThread(() => GetComponentModel().GetExtensions<IVsSolutionRestoreService2>().Single()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much more sane!
@jaredpar for approval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #18996
Closes #19090
Closes #19091
Implements a workaround for #32121.