-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add unit test for 3rd party fixer formatting #896
Conversation
|
||
Build.Framework.ILogger? binlog = null; | ||
if (createBinaryLog) | ||
await s_guard.WaitAsync(); |
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 is needed because tests run in parallel but msbuild won't
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.
Still don't quite understand this. Why can't each test create their own workspace?
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.
Since the CodeFormatterTests is creating MSBuildWorkspaces and now we are creating a MSBuildWorkspace here, there is an InvalidOperationException "Cannot start a new build while a build is in progress", since they are running parallel.
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.
Could we create a WorspaceFact
that controls this intead of changing product code?
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.
Took a stab at this in #899
|
||
namespace Microsoft.CodeAnalysis.Tools.Tests.Analyzers | ||
{ | ||
public class CodeStyleAnalyzerFormatterTests : CSharpFormatterTests | ||
{ | ||
private protected override ICodeFormatter Formatter => AnalyzerFormatter.CodeStyleFormatter; | ||
|
||
public CodeStyleAnalyzerFormatterTests(ITestOutputHelper output) | ||
{ | ||
TestOutputHelper = output; |
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.
On failure of any tests in the class, the formatter log will be written to the test output.
Adds infrastructure for testing that 3rd party fixes are applied during formatting.
Part of the work for #717