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

Integration tests: BoxSelection, CSharpInteractiveDirectives, CSharpInteractiveFormsAndWpf, CSharpReplClassification #18137

Merged
merged 50 commits into from
Mar 29, 2017

Conversation

ivanbasov
Copy link
Contributor

@dotnet/roslyn-ide

ivanbasov and others added 30 commits March 13, 2017 16:43
@jasonmalinowski jasonmalinowski self-requested a review March 24, 2017 18:32
@ivanbasov
Copy link
Contributor Author

ivanbasov commented Mar 27, 2017

Ping. Please review. #Closed

@ivanbasov ivanbasov requested a review from jmarolf March 28, 2017 01:06
Copy link
Contributor

@jmarolf jmarolf left a comment

Choose a reason for hiding this comment

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

Looks like things were merged incorrectly

@@ -78,5 +73,258 @@ protected void SetUpEditor(string markupCode)
VisualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, originalValue);
}
}

Copy link
Contributor

@jmarolf jmarolf Mar 28, 2017

Choose a reason for hiding this comment

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

this looks like a bad marge. These should be in extension methods #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thank you! Removed all methods below SetUpEditor because they are already in extension methods. #Closed

@@ -47,5 +51,140 @@ protected KeyPress Shift(VirtualKey virtualKey)

protected KeyPress Alt(VirtualKey virtualKey)
=> new KeyPress(virtualKey, ShiftState.Alt);

Copy link
Contributor

@jmarolf jmarolf Mar 28, 2017

Choose a reason for hiding this comment

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

this looks like a bad marge. These should be in extension methods #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thank you! Removed everything below the Alt method and merged new callers. #Closed

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

Many comments so far. There are many tests that still have commented out bodies that make me thing this isn't quite ready for review yet. You'll also need to chat with @jmarolf as we just discussed how we might want to be refactoring some stuff.

namespace Roslyn.VisualStudio.IntegrationTests.CSharp
{
[Collection(nameof(SharedIntegrationHostFixture))]
public class BoxSelection : AbstractInteractiveWindowTest
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

If this is all interactive window testing, call it InteractiveWindowBoxSelection? #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Agree. Thanks! #Closed

this.ExecuteCommand("Edit.LineDown");
this.ExecuteCommand("Edit.Paste");
this.ExecuteCommand("Edit.Paste");
ExecuteCommand(WellKnownCommandNames.Edit_LineStart);
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

This series of command executions seems really fishy. What is this test actually asserting? #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

There can be differences in commands available between the editor and the interactive.
The test verifies that commands mentioned are available in the interactive window. #Closed

Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

Does it though? If every command silently fails, this test passes? #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thank you! I see your point.

If it fails silently, then we do not catch it here. We get an error the following cases:

  1. If a command is not available
  2. If a command failed and threw an exception

This is the scope of the original test.

Let me add couple more verification in the end here. #Closed

{
SubmitText("#foo");
this.WaitForLastReplOutput("(1,2): error CS1024: Preprocessor directive expected");
// TODO implement GetErrorListErrorCount: https://github.com/dotnet/roslyn/issues/18035
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

The TODO confuses me -- is this a new TODO or something that's being ported? #ByDesign

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

There is a difference between error count in the interactive and in the editor. Error count in editor is displayed in the errors windows and we can build and then see errors there. Editors tests follow this pattern.

However, as far as I can see, we cannot follow this patter for interactive solution. We should find errors in the interactive (scripting) window, I could not find an easy way to do so. I would prefer to solve this problem with a separate code review. That is why I created a new issue and added TODOs for it. I think that the priority of this verification is low because we already verify error messages within those tests.

Please let me know if you prefer to arrange this other way. #Closed

this.WaitForLastReplOutputContains("CS7010: Quoted file name expected");
}

// [Fact]
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

Why a commented out test to start? #Resolved


namespace Microsoft.VisualStudio.IntegrationTest.Utilities
{
public class WellKnowTagNames
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

"Known". #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thank you! #Closed

}
}

protected void VerifyTextDoesNotContain(string expectedText)
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

I think we're trying to get rid of "verify methods that just call assert in the most trivial of ways". #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

not sure I understand the comment. just verified that this method is not used and was removed. Likely, @jmarolf already removed it before and I restored it by a bad merge. Removed it now. #Closed

Assert.DoesNotContain(expectedText, editorText);
}

protected void VerifyCompletionItemDoesNotExist(params string[] expectedItems)
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

VerifyCompletionItemsDoNotExist. #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thank you! #Closed


namespace Roslyn.VisualStudio.IntegrationTests.CSharp
{

Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

Blank line. #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Thanks! #Closed

base.Dispose();
}

// https://github.com/dotnet/roslyn/issues/801
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

Use Skip to track the test, don't comment out Facts ever. #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Makes sense. Thank you! #Closed

public void VerifyCodeActionsAvailableInCurrentSubmission()
{
InsertCode("Directory.Exists(\"foo\");");
// <VerifyCodeActions ApplyFix = "using System.IO;" >
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

Hmm? #Resolved

Copy link
Contributor Author

@ivanbasov ivanbasov Mar 28, 2017

Choose a reason for hiding this comment

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

Code Actions are available in Interactive. If one opens Visual Studio, actions described in the original test can be performed.

However, the Visual Studio instance we use for tests does not support these code actions (set a break point during an integration test to see the difference).

So, I migrated this test (that was commented out in the original Tao test set) but have to keep it disabled. Please let me know if you see a better solution for this. #Closed

Copy link
Member

@jasonmalinowski jasonmalinowski Mar 28, 2017

Choose a reason for hiding this comment

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

I thought we had disabled code actions in interactive, which might be why this test was commented out. You'll probably have to spelunk through source history to figure out what happened.

In any case my bigger confusion was "commented out random XML with no explanation of where it came from" will definitely get a "hmm?" from me. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!

  1. I migrated some more disabled tests.
  2. There are 2 tests with "XML". Both seem to be reasonable to keep but not reasonable to migrate right now.
  3. Now I migrated all tests with CodeActions. However, they are disabled due to open issues. I can verify CodeActions scenarios in standalone VisualStudio but not in integration tests. Will sync with Jonathon tomorrow.

In reply to: 108558613 [](ancestors = 108558613)

@ivanbasov ivanbasov requested a review from dpoeschl March 28, 2017 20:23
@jasonmalinowski jasonmalinowski dismissed their stale review March 28, 2017 23:06

Dismiss since I'm going on vacation but @jmarolf can take it from here.

@ivanbasov ivanbasov merged commit 85b4b11 into dotnet:master Mar 29, 2017
@ivanbasov ivanbasov deleted the MoreIntegrationTests branch March 29, 2017 02:11
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.

4 participants