Skip to content

Commit

Permalink
chore(performance): Parallel testinit (#2894)
Browse files Browse the repository at this point in the history
* Add parallel for initial testrun

* Throw inner exception

---------

Co-authored-by: Richard Werkman <richard.werkman@infosupport.com>
  • Loading branch information
richardwerkman and Richard Werkman authored Mar 29, 2024
1 parent 0ab0ab3 commit d77ddb3
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Stryker.Core.Exceptions;
using Stryker.Core.Initialisation.Buildalyzer;
Expand Down Expand Up @@ -101,17 +102,21 @@ public void BuildProjects(StrykerOptions options, IEnumerable<SourceProjectInfo>
public IReadOnlyCollection<MutationTestInput> GetMutationTestInputs(StrykerOptions options, IReadOnlyCollection<SourceProjectInfo> projects, ITestRunner runner)
{
var result = new List<MutationTestInput>();
foreach (var info in projects)
try
{
result.Add(new MutationTestInput
Parallel.ForEach(projects, projectInfo => result.Add(new MutationTestInput
{
SourceProjectInfo = info,
TestProjectsInfo = info.TestProjectsInfo,
SourceProjectInfo = projectInfo,
TestProjectsInfo = projectInfo.TestProjectsInfo,
TestRunner = runner,
InitialTestRun = InitialTest(options, info, runner, projects.Count==1)
});
InitialTestRun = InitialTest(options, projectInfo, runner, projects.Count == 1)
})
);
}
catch (AggregateException ex)
{
throw ex.InnerException;
}

return result;
}

Expand Down

0 comments on commit d77ddb3

Please sign in to comment.