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
Unit test fixes for Windows #1804
Conversation
@dotnet-policy-service agree |
} | ||
|
||
} | ||
"; | ||
|
||
var expectedCode = @" | ||
// Hack for Windows: StyleCop uses the Environment NewLine for its replacement, |
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.
Tagging @sharwell to comment on this.
Windows tests runs are timing out here. Also seeing a warning in the test project: |
Not sure why these changes would be necessary. |
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.
In general this isn't the approach we'd want to go with for normalizing the tests. I'll need to review the variety of changes individually to discuss the resolution plan.
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 suspect the author of this pull request might have not set core.autocrlf=true
on a Windows machine, which would lead to expected failures. Prior to any fixes, please verify that the local configuration is correct.
@@ -86,21 +87,26 @@ void M() | |||
|
|||
int count = 5; | |||
|
|||
|
|||
count = 6; |
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 was this added?
@@ -163,6 +169,9 @@ void M() | |||
|
|||
// Prefer using. IDISP017 | |||
["dotnet_diagnostic.IDISP017.severity"] = "error", | |||
|
|||
// We expect new line as end_of_line in this test | |||
["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption("\n"), |
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 was this added?
@@ -210,6 +219,9 @@ void M() | |||
|
|||
// Prefer using. IDISP017 | |||
["dotnet_diagnostic.IDISP017.severity"] = "error", | |||
|
|||
// We expect new line as end_of_line in this test | |||
["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption("\n"), |
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 was this added? This test has expectedCode
that relies on the environment newline, and the default end_of_line
value would be the same. This test wouldn't have been failing before this change, provided the user on Windows checked out the code with the required core.autocrlf=true
configuration.
sb.Append("Greeter.Greet() -> void"); | ||
sb.Append(Environment.NewLine); | ||
sb.Append("Greeter.Greeter() -> void"); | ||
var expectedPublicApi = sb.ToString(); |
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 was this changed?
@@ -41,7 +41,7 @@ class C | |||
|
|||
var editorConfig = new Dictionary<string, string>() | |||
{ | |||
["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption(Environment.NewLine), | |||
["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption("\n"), |
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 was this changed? Applies to all instances of this in the file.
Closing as 9.x development has moved into the dotnet/sdk repo. |
I've made some changes to the unit tests, so that they are all working with windows.
Almost all changes regarded the end-of-line problem between Windows and Linux/Mac.