Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,12 @@ internal static void SetSettingsFromConfig(IConfiguration configuration, IMessag

if (configuration["mstest:parallelism:workers"] is string workers)
{
settings.ParallelizationWorkers = int.TryParse(workers, out int parallelWorkers)
? parallelWorkers == 0
? Environment.ProcessorCount
: parallelWorkers > 0
? parallelWorkers
: throw new AdapterSettingsException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidParallelWorkersValue, workers))
: throw new AdapterSettingsException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidParallelWorkersValue, workers));
if (!int.TryParse(workers, out int parallelWorkers) || parallelWorkers < 0)
{
throw new AdapterSettingsException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidParallelWorkersValue, workers));
}

settings.ParallelizationWorkers = parallelWorkers == 0 ? Environment.ProcessorCount : parallelWorkers;
}

if (configuration["mstest:parallelism:scope"] is string value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ public VideoRecorderSessionHandler(
_options = options;

_enabled = commandLineOptions.IsOptionSet(VideoRecorderCommandLineProvider.EnableOptionName);
if (!_enabled)
if (_enabled)
{
_persistMode = options.PersistMode;
_granularity = options.Granularity;
return;
ApplyCommandLineOverrides(options, commandLineOptions);
}

ApplyCommandLineOverrides(options, commandLineOptions);
_persistMode = options.PersistMode;
_granularity = options.Granularity;

if (!_enabled)
{
return;
}

string outputDirectory = options.OutputDirectory
?? Path.Combine(configuration.GetTestResultDirectory(), "VideoRecordings");

Expand Down
Loading