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

Test exploration #2454

Closed
wants to merge 6 commits into from
Closed

Test exploration #2454

wants to merge 6 commits into from

Conversation

michaelcfanning
Copy link
Member

No description provided.

@@ -30,6 +30,8 @@ public abstract class MultithreadedAnalyzeCommandBase<TContext, TOptions> : Plug
internal ConsoleLogger _consoleLogger;
internal ConcurrentDictionary<string, IAnalysisLogger> _analysisLoggerCache;

internal static int? s_numberOfThreadsForTesting;
Copy link
Member Author

@michaelcfanning michaelcfanning Feb 14, 2022

Choose a reason for hiding this comment

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

s_numberOfThreadsForTesting

Remove this and use options.Threads. #Closed

Copy link
Collaborator

Choose a reason for hiding this comment

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

removed.

}

private const string AnalyzerName = TestRuleId + "." + nameof(TestRule);

public static PerLanguageOption<uint> ErrorsCount { get; } =
new PerLanguageOption<uint>(
AnalyzerName, nameof(ErrorsCount), defaultValue: () => { return 15; });
Copy link
Member Author

@michaelcfanning michaelcfanning Feb 14, 2022

Choose a reason for hiding this comment

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

15

Restore this to 1, that was the previous behavior. Or provide a justification for the updated value. #Closed

@@ -676,6 +676,54 @@ public void AnalyzeCommandBase_EndToEndAnalysisWithPostUri()
PostUriTestHelper(@"https://host.does.not.exist", TestAnalyzeCommand.FAILURE, RuntimeConditions.ExceptionPostingLogFile);
}

[Fact]
public void MultithreadedAnalyzeCommandBase_EndToEndMultithreadedAnalysis()
Copy link
Member Author

Choose a reason for hiding this comment

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

MultithreadedAnalyzeCommandBase_EndToEndMultithreadedAnalysis

Provide a context object in this test that overrides the error count default.


for (int i = 0; i < 100; i++)
{
var options = new TestAnalyzeOptions
Copy link
Member Author

Choose a reason for hiding this comment

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

TestAnalyzeOptions

Add an option here for configuration, 'Options.xml'. Update the Mock object to return a string representation that has your option. Find a clean way to create a config file with just this option.

@@ -592,7 +596,7 @@ internal AggregatingLogger InitializeLogger(AnalyzeOptionsBase analyzeOptions)

if (filePath != null)
{
context.TargetUri = new Uri(filePath);
context.TargetUri = new Uri(filePath, UriKind.RelativeOrAbsolute);
Copy link
Member Author

@michaelcfanning michaelcfanning Feb 14, 2022

Choose a reason for hiding this comment

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

UriKind.RelativeOrAbsolute

File an issue, add a test? What happened here is that the mock object provided something like "File1.txt" and this code path didn't like it.

@eddynaka
Copy link
Collaborator

Closing this since we merged this pr in the following:
#2447

@eddynaka eddynaka closed this Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants