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

Have code action tests run in OOP mode by default #73372

Merged
merged 12 commits into from
May 8, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented May 7, 2024

This is the mode users run in, and we want to verify that any work they do that involves communicating with OOP are tested by our standard unit tests.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 7, 2024
internal partial class SerializerService
{
[DebuggerDisplay("{" + nameof(Display) + ",nq}")]
private sealed class SerializedMetadataReference : PortableExecutableReference, ISupportTemporaryStorage
Copy link
Member Author

Choose a reason for hiding this comment

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

just an extrac of a class. no changes to it at all.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review May 7, 2024 20:58
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 7, 2024 20:58
@CyrusNajmabadi CyrusNajmabadi requested a review from ToddGrun May 7, 2024 21:08
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

if (analyzer != null)
{
Contract.ThrowIfTrue(parameters.testHost == TestHost.OutOfProcess, $"Out-of-proc testing is not supported since {analyzer} can't be serialized.");
Copy link
Member Author

Choose a reason for hiding this comment

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

instead of asserting and not allowing this. We just make it so AnalyzerImageReference do work in OOP when in test scenarios.

@@ -102,24 +103,21 @@ internal override Task<CodeRefactoring> GetCodeRefactoringAsync(TestWorkspace wo

protected static void AddAnalyzerToWorkspace(Workspace workspace, DiagnosticAnalyzer analyzer, TestParameters parameters)
Copy link
Member Author

Choose a reason for hiding this comment

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

no clue why this method is duplicated. not interested in fixing that right now :)

@@ -166,7 +166,7 @@ public InProcRemoteServices(SolutionServices workspaceServices, TraceListener? t
{
var remoteLogger = new TraceSource("InProcRemoteClient")
{
Switch = { Level = SourceLevels.Verbose },
Switch = { Level = SourceLevels.Off },
Copy link
Member Author

Choose a reason for hiding this comment

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

needed to change this because the amount of cost of this logging, over the stdout pipe which xunit captures, was actually slowing down tests too much! =-o

var guid = reader.ReadGuid();
lock (s_analyzerImageReferenceMapGate)
{
Contract.ThrowIfFalse(s_analyzerImageReferenceMap.TryGetKey(guid, out var analyzerImageReference));
Copy link
Contributor

Choose a reason for hiding this comment

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

Contract.ThrowIfFalse(s_analyzerImageReferenceMap.TryGetKey(guid, out var analyzerImageReference));

nit: might be nice to have this be a method similar to what was done for TryGetValue

Copy link
Member Author

Choose a reason for hiding this comment

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

will do!

Copy link
Member Author

Choose a reason for hiding this comment

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

done in e035fc7

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge May 8, 2024 01:14
@CyrusNajmabadi CyrusNajmabadi merged commit 2882436 into dotnet:main May 8, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the runOopByDefault branch May 8, 2024 02:12
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 8, 2024
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski For review when you get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants