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 .NET Core project tests #32122

Merged
merged 3 commits into from
Jan 3, 2019
Merged

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Jan 3, 2019

Closes #18996
Closes #19090
Closes #19091

Implements a workaround for #32121.

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.
@sharwell sharwell added Area-IDE Integration-Test Test failures in roslyn-integration-CI labels Jan 3, 2019
@sharwell sharwell added this to the 16.0.P2 milestone Jan 3, 2019
@sharwell sharwell requested a review from a team as a code owner January 3, 2019 07:27
@@ -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())
Copy link
Contributor

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..

Copy link
Member Author

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));
Copy link
Contributor

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?

Copy link
Member Author

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());
Copy link
Contributor

Choose a reason for hiding this comment

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

Much more sane!

@sharwell
Copy link
Member Author

sharwell commented Jan 3, 2019

@jaredpar for approval

Copy link
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

:shipit:

@sharwell sharwell merged commit e876295 into dotnet:master Jan 3, 2019
@sharwell sharwell deleted the fix-netcore-tests branch January 3, 2019 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Integration-Test Test failures in roslyn-integration-CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants