-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
Ping. Please review. #Closed |
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.
Looks like things were merged incorrectly
@@ -78,5 +73,258 @@ protected void SetUpEditor(string markupCode) | |||
VisualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, originalValue); | |||
} | |||
} | |||
|
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.
this looks like a bad marge. These should be in extension methods #Resolved
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.
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); | |||
|
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.
this looks like a bad marge. These should be in extension methods #Resolved
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.
Thank you! Removed everything below the Alt method and merged new callers. #Closed
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.
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 |
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.
If this is all interactive window testing, call it InteractiveWindowBoxSelection? #Resolved
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. Thanks! #Closed
this.ExecuteCommand("Edit.LineDown"); | ||
this.ExecuteCommand("Edit.Paste"); | ||
this.ExecuteCommand("Edit.Paste"); | ||
ExecuteCommand(WellKnownCommandNames.Edit_LineStart); |
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.
This series of command executions seems really fishy. What is this test actually asserting? #Resolved
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.
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
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 it though? If every command silently fails, this test passes? #Resolved
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.
Thank you! I see your point.
If it fails silently, then we do not catch it here. We get an error the following cases:
- If a command is not available
- 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 |
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.
The TODO confuses me -- is this a new TODO or something that's being ported? #ByDesign
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.
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] |
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.
Why a commented out test to start? #Resolved
|
||
namespace Microsoft.VisualStudio.IntegrationTest.Utilities | ||
{ | ||
public class WellKnowTagNames |
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.
"Known". #Resolved
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.
Thank you! #Closed
} | ||
} | ||
|
||
protected void VerifyTextDoesNotContain(string expectedText) |
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 think we're trying to get rid of "verify methods that just call assert in the most trivial of ways". #Resolved
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.
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) |
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.
VerifyCompletionItemsDoNotExist. #Resolved
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.
Thank you! #Closed
|
||
namespace Roslyn.VisualStudio.IntegrationTests.CSharp | ||
{ | ||
|
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.
Blank line. #Resolved
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.
Thanks! #Closed
base.Dispose(); | ||
} | ||
|
||
// https://github.com/dotnet/roslyn/issues/801 |
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.
Use Skip to track the test, don't comment out Facts ever. #Resolved
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.
Makes sense. Thank you! #Closed
public void VerifyCodeActionsAvailableInCurrentSubmission() | ||
{ | ||
InsertCode("Directory.Exists(\"foo\");"); | ||
// <VerifyCodeActions ApplyFix = "using System.IO;" > |
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.
Hmm? #Resolved
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.
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
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 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
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.
Thank you!
- I migrated some more disabled tests.
- There are 2 tests with "XML". Both seem to be reasonable to keep but not reasonable to migrate right now.
- 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)
Dismiss since I'm going on vacation but @jmarolf can take it from here.
@dotnet/roslyn-ide