diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 868068850d..b0695a35eb 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -1,17 +1,22 @@ + + + + + diff --git a/src/Stryker.Abstractions/IMutant.cs b/src/Stryker.Abstractions/IMutant.cs index 771689f524..de99103fb1 100644 --- a/src/Stryker.Abstractions/IMutant.cs +++ b/src/Stryker.Abstractions/IMutant.cs @@ -1,7 +1,6 @@ -using Stryker.Abstractions.TestRunners; -using Stryker.Abstractions; +using Stryker.Abstractions.Testing; -namespace Stryker.Abstractions.Mutants; +namespace Stryker.Abstractions; public interface IMutant : IReadOnlyMutant { @@ -9,14 +8,14 @@ public interface IMutant : IReadOnlyMutant new Mutation Mutation { get; set; } new MutantStatus ResultStatus { get; set; } new string ResultStatusReason { get; set; } - new ITestGuids CoveringTests { get; set; } - new ITestGuids KillingTests { get; set; } - new ITestGuids AssessingTests { get; set; } + new ITestIdentifiers CoveringTests { get; set; } + new ITestIdentifiers KillingTests { get; set; } + new ITestIdentifiers AssessingTests { get; set; } new bool CountForStats { get; } new bool IsStaticValue { get; set; } string DisplayName { get; } bool MustBeTestedInIsolation { get; set; } - void AnalyzeTestRun(ITestGuids failedTests, ITestGuids resultRanTests, ITestGuids timedOutTests, bool sessionTimedOut); + void AnalyzeTestRun(ITestIdentifiers failedTests, ITestIdentifiers resultRanTests, ITestIdentifiers timedOutTests, bool sessionTimedOut); } diff --git a/src/Stryker.Abstractions/IMutator.cs b/src/Stryker.Abstractions/IMutator.cs index c80b589236..0562f82e08 100644 --- a/src/Stryker.Abstractions/IMutator.cs +++ b/src/Stryker.Abstractions/IMutator.cs @@ -1,9 +1,8 @@ using Microsoft.CodeAnalysis; using Stryker.Abstractions.Options; -using Stryker.Abstractions.Mutants; using System.Collections.Generic; -namespace Stryker.Abstractions.Mutators; +namespace Stryker.Abstractions; public interface IMutator { diff --git a/src/Stryker.Abstractions/IProjectAndTests.cs b/src/Stryker.Abstractions/IProjectAndTests.cs index 4afb59d1c2..780ead8fe8 100644 --- a/src/Stryker.Abstractions/IProjectAndTests.cs +++ b/src/Stryker.Abstractions/IProjectAndTests.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using Stryker.Abstractions.ProjectComponents; -namespace Stryker.Abstractions.Initialisation; +namespace Stryker.Abstractions; public interface IProjectAndTests { - ITestProjectsInfo TestProjectsInfo { get;} + ITestProjectsInfo TestProjectsInfo { get; } string HelperNamespace { get; } diff --git a/src/Stryker.Abstractions/IReadOnlyMutant.cs b/src/Stryker.Abstractions/IReadOnlyMutant.cs index 9a46090c2a..615211a9b6 100644 --- a/src/Stryker.Abstractions/IReadOnlyMutant.cs +++ b/src/Stryker.Abstractions/IReadOnlyMutant.cs @@ -1,5 +1,4 @@ -using Stryker.Abstractions.TestRunners; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions.Testing; namespace Stryker.Abstractions; @@ -12,9 +11,9 @@ public interface IReadOnlyMutant Mutation Mutation { get; } MutantStatus ResultStatus { get; } string ResultStatusReason { get; } - ITestGuids CoveringTests { get; } - ITestGuids KillingTests { get; } - ITestGuids AssessingTests { get; } + ITestIdentifiers CoveringTests { get; } + ITestIdentifiers KillingTests { get; } + ITestIdentifiers AssessingTests { get; } bool CountForStats { get; } bool IsStaticValue { get; } } diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/Language.cs b/src/Stryker.Abstractions/Language.cs similarity index 62% rename from src/Stryker.Core/Stryker.Core/Initialisation/Language.cs rename to src/Stryker.Abstractions/Language.cs index fb9950bb19..98cac20c9f 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/Language.cs +++ b/src/Stryker.Abstractions/Language.cs @@ -1,4 +1,4 @@ -namespace Stryker.Core.Initialisation; +namespace Stryker.Abstractions; public enum Language { diff --git a/src/Stryker.Abstractions/MutantStatus.cs b/src/Stryker.Abstractions/MutantStatus.cs index 6b5b35bcbf..e74d6d79db 100644 --- a/src/Stryker.Abstractions/MutantStatus.cs +++ b/src/Stryker.Abstractions/MutantStatus.cs @@ -1,4 +1,4 @@ -namespace Stryker.Abstractions.Mutants; +namespace Stryker.Abstractions; public enum MutantStatus { diff --git a/src/Stryker.Abstractions/Mutation.cs b/src/Stryker.Abstractions/Mutation.cs index a34be4672a..03737aaab7 100644 --- a/src/Stryker.Abstractions/Mutation.cs +++ b/src/Stryker.Abstractions/Mutation.cs @@ -1,7 +1,6 @@ using Microsoft.CodeAnalysis; -using Stryker.Abstractions.Mutators; -namespace Stryker.Abstractions.Mutants; +namespace Stryker.Abstractions; /// /// Represents a single mutation on code level diff --git a/src/Stryker.Abstractions/MutationLevel.cs b/src/Stryker.Abstractions/MutationLevel.cs index 675ebb4ec9..aa29ea3d58 100644 --- a/src/Stryker.Abstractions/MutationLevel.cs +++ b/src/Stryker.Abstractions/MutationLevel.cs @@ -1,4 +1,4 @@ -namespace Stryker.Abstractions.Mutators; +namespace Stryker.Abstractions; public enum MutationLevel { diff --git a/src/Stryker.Abstractions/Mutator.cs b/src/Stryker.Abstractions/Mutator.cs index 7080541a9d..7efbb31f3b 100644 --- a/src/Stryker.Abstractions/Mutator.cs +++ b/src/Stryker.Abstractions/Mutator.cs @@ -1,6 +1,4 @@ -using Stryker.Utilities.Attributes; - -namespace Stryker.Abstractions.Mutators; +namespace Stryker.Abstractions; public enum Mutator { diff --git a/src/Stryker.Utilities/Attributes/MutatorDescriptionAttribute.cs b/src/Stryker.Abstractions/MutatorDescriptionAttribute.cs similarity index 94% rename from src/Stryker.Utilities/Attributes/MutatorDescriptionAttribute.cs rename to src/Stryker.Abstractions/MutatorDescriptionAttribute.cs index 6b2da45779..5617aa7f74 100644 --- a/src/Stryker.Utilities/Attributes/MutatorDescriptionAttribute.cs +++ b/src/Stryker.Abstractions/MutatorDescriptionAttribute.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace Stryker.Utilities.Attributes; +namespace Stryker.Abstractions; [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] public class MutatorDescriptionAttribute : Attribute diff --git a/src/Stryker.Abstractions/Options/IStrykerOptions.cs b/src/Stryker.Abstractions/Options/IStrykerOptions.cs index a7492e8e77..7c7f21b66d 100644 --- a/src/Stryker.Abstractions/Options/IStrykerOptions.cs +++ b/src/Stryker.Abstractions/Options/IStrykerOptions.cs @@ -2,7 +2,6 @@ using System.Text.RegularExpressions; using Microsoft.CodeAnalysis.CSharp; using Stryker.Abstractions.Baseline; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.ProjectComponents; namespace Stryker.Abstractions.Options; diff --git a/src/Stryker.Abstractions/ProjectComponents/IProjectComponent.cs b/src/Stryker.Abstractions/ProjectComponents/IProjectComponent.cs index 3ad5e66eb4..6b74c430a4 100644 --- a/src/Stryker.Abstractions/ProjectComponents/IProjectComponent.cs +++ b/src/Stryker.Abstractions/ProjectComponents/IProjectComponent.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; namespace Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Abstractions/ProjectComponents/ITestCase.cs b/src/Stryker.Abstractions/ProjectComponents/ITestCase.cs index 0d56180144..1caede0d0c 100644 --- a/src/Stryker.Abstractions/ProjectComponents/ITestCase.cs +++ b/src/Stryker.Abstractions/ProjectComponents/ITestCase.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.CodeAnalysis; namespace Stryker.Abstractions.ProjectComponents; public interface ITestCase { - Guid Id { get; init; } + Testing.Identifier Id { get; init; } string Name { get; init; } SyntaxNode Node { get; init; } diff --git a/src/Stryker.Abstractions/ProjectComponents/ITestFile.cs b/src/Stryker.Abstractions/ProjectComponents/ITestFile.cs index 94bc3f2888..0b165503ec 100644 --- a/src/Stryker.Abstractions/ProjectComponents/ITestFile.cs +++ b/src/Stryker.Abstractions/ProjectComponents/ITestFile.cs @@ -1,6 +1,6 @@ -using System; using System.Collections.Generic; using Microsoft.CodeAnalysis; +using Stryker.Abstractions.Testing; namespace Stryker.Abstractions.ProjectComponents; @@ -11,7 +11,7 @@ public interface ITestFile SyntaxTree SyntaxTree { get; init; } IList Tests { get; } - void AddTest(Guid id, string name, SyntaxNode node); + void AddTest(Identifier id, string name, SyntaxNode node); bool Equals(object obj); bool Equals(ITestFile other); int GetHashCode(); diff --git a/src/Stryker.Abstractions/Stryker.Abstractions.csproj b/src/Stryker.Abstractions/Stryker.Abstractions.csproj index 32e3ce9345..e1707d231c 100644 --- a/src/Stryker.Abstractions/Stryker.Abstractions.csproj +++ b/src/Stryker.Abstractions/Stryker.Abstractions.csproj @@ -14,9 +14,4 @@ - - - - - diff --git a/src/Stryker.Abstractions/Testing/CoverageConfidence.cs b/src/Stryker.Abstractions/Testing/CoverageConfidence.cs new file mode 100644 index 0000000000..7889a55cc1 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/CoverageConfidence.cs @@ -0,0 +1,9 @@ +namespace Stryker.Abstractions.Testing; + +public enum CoverageConfidence +{ + Exact, + Normal, + Dubious, + UnexpectedCase +} diff --git a/src/Stryker.Abstractions/Testing/ICoverageRunResult.cs b/src/Stryker.Abstractions/Testing/ICoverageRunResult.cs new file mode 100644 index 0000000000..1d4cfdc217 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ICoverageRunResult.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace Stryker.Abstractions.Testing; + +public interface ICoverageRunResult +{ + Identifier TestId { get; } + Dictionary MutationFlags { get; } + IReadOnlyCollection MutationsCovered { get; } + MutationTestingRequirements this[int mutation] { get; } + CoverageConfidence Confidence { get; } + void Merge(ICoverageRunResult coverageRunResult); +} diff --git a/src/Stryker.Abstractions/Testing/IFrameworkTestDescription.cs b/src/Stryker.Abstractions/Testing/IFrameworkTestDescription.cs new file mode 100644 index 0000000000..c309f3bbd1 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/IFrameworkTestDescription.cs @@ -0,0 +1,24 @@ +using System; + +namespace Stryker.Abstractions.Testing; + +public interface IFrameworkTestDescription +{ + TestFrameworks Framework { get; } + + ITestDescription Description { get; } + + TimeSpan InitialRunTime { get; } + + Identifier Id { get; } + + int NbSubCases { get; } + + ITestCase Case { get; } + + void RegisterInitialTestResult(ITestResult result); + + void AddSubCase(); + + void ClearInitialResult(); +} diff --git a/src/Stryker.Abstractions/Testing/ITestCase.cs b/src/Stryker.Abstractions/Testing/ITestCase.cs new file mode 100644 index 0000000000..be1fb20fda --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestCase.cs @@ -0,0 +1,20 @@ +using System; + +namespace Stryker.Abstractions.Testing; + +public interface ITestCase +{ + Identifier Id { get; } + + string Name { get; } + + string Source { get; } + + string CodeFilePath { get; } + + string FullyQualifiedName { get; } + + Uri Uri { get; } + + int LineNumber { get; } +} diff --git a/src/Stryker.Abstractions/Testing/ITestDescription.cs b/src/Stryker.Abstractions/Testing/ITestDescription.cs new file mode 100644 index 0000000000..8f01dd2b54 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestDescription.cs @@ -0,0 +1,8 @@ +namespace Stryker.Abstractions.Testing; + +public interface ITestDescription +{ + Identifier Id { get; } + string Name { get; } + string TestFilePath { get; } +} diff --git a/src/Stryker.Abstractions/Testing/ITestGuids.cs b/src/Stryker.Abstractions/Testing/ITestGuids.cs index a64a11e1bc..5711550dc7 100644 --- a/src/Stryker.Abstractions/Testing/ITestGuids.cs +++ b/src/Stryker.Abstractions/Testing/ITestGuids.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Stryker.Abstractions.TestRunners; +namespace Stryker.Abstractions.Testing; // represents a simple list of test identifier with some properties public interface ITestGuids diff --git a/src/Stryker.Abstractions/Testing/ITestIdentifiers.cs b/src/Stryker.Abstractions/Testing/ITestIdentifiers.cs new file mode 100644 index 0000000000..5a6bfdd8cc --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestIdentifiers.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; + +namespace Stryker.Abstractions.Testing; + +public interface ITestIdentifiers +{ + IEnumerable GetIdentifiers(); + int Count { get; } + bool IsEmpty { get; } + bool IsEveryTest { get; } + ITestIdentifiers Merge(ITestIdentifiers other); + bool Contains(Identifier testId); + bool ContainsAny(ITestIdentifiers other); + bool IsIncludedIn(ITestIdentifiers other); + ITestIdentifiers Intersect(ITestIdentifiers other); + ITestIdentifiers Excluding(ITestIdentifiers testsToSkip); +} diff --git a/src/Stryker.Abstractions/Testing/ITestResult.cs b/src/Stryker.Abstractions/Testing/ITestResult.cs new file mode 100644 index 0000000000..b272fc564c --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestResult.cs @@ -0,0 +1,8 @@ +using System; + +namespace Stryker.Abstractions.Testing; + +public interface ITestResult +{ + TimeSpan Duration { get; } +} diff --git a/src/Stryker.Abstractions/Testing/ITestRunResult.cs b/src/Stryker.Abstractions/Testing/ITestRunResult.cs new file mode 100644 index 0000000000..bd26092a39 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestRunResult.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Stryker.Abstractions.Testing; + +public interface ITestRunResult +{ + TimeSpan Duration { get; } + ITestIdentifiers ExecutedTests { get; } + ITestIdentifiers FailingTests { get; } + IEnumerable Messages { get; } + string ResultMessage { get; } + bool SessionTimedOut { get; } + ITestIdentifiers TimedOutTests { get; } + IEnumerable TestDescriptions { get; } +} diff --git a/src/Stryker.Abstractions/Testing/ITestRunner.cs b/src/Stryker.Abstractions/Testing/ITestRunner.cs new file mode 100644 index 0000000000..e3eb3a1355 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestRunner.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using Stryker.Abstractions; + +namespace Stryker.Abstractions.Testing; + +public interface ITestRunner : IDisposable +{ + public delegate bool TestUpdateHandler(IReadOnlyList testedMutants, + ITestIdentifiers failedTests, + ITestIdentifiers ranTests, + ITestIdentifiers timedOutTests); + + bool DiscoverTests(string assembly); + + ITestSet GetTests(IProjectAndTests project); + + ITestRunResult InitialTest(IProjectAndTests project); + + IEnumerable CaptureCoverage(IProjectAndTests project); + + ITestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, TestUpdateHandler update); +} diff --git a/src/Stryker.Abstractions/Testing/ITestSet.cs b/src/Stryker.Abstractions/Testing/ITestSet.cs new file mode 100644 index 0000000000..a4a67c0e68 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/ITestSet.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace Stryker.Abstractions.Testing; + +public interface ITestSet +{ + int Count { get; } + ITestDescription this[Identifier id] { get; } + void RegisterTests(IEnumerable tests); + void RegisterTest(ITestDescription test); + IEnumerable Extract(IEnumerable ids); +} diff --git a/src/Stryker.Abstractions/Testing/Identifier.cs b/src/Stryker.Abstractions/Testing/Identifier.cs new file mode 100644 index 0000000000..4aa7e11f3d --- /dev/null +++ b/src/Stryker.Abstractions/Testing/Identifier.cs @@ -0,0 +1,34 @@ +using System; + +namespace Stryker.Abstractions.Testing; + +public class Identifier : IEquatable +{ + private readonly string _identifier; + + private Identifier(string identifier) => _identifier = identifier; + + public static Identifier Create(string identifier) => new(identifier); + + public static Identifier Create(Guid guid) => new(guid.ToString()); + + public static Identifier Empty => new(Guid.Empty.ToString()); + + public Guid ToGuid() + { + var isGuid = Guid.TryParse(_identifier, out var guid); + return isGuid ? guid : Guid.Empty; + } + + public override int GetHashCode() => _identifier.GetHashCode(); + + public override string ToString() => _identifier; + + public override bool Equals(object obj) => obj is Identifier identifier && Equals(identifier); + + public bool Equals(Identifier other) => _identifier == other?._identifier; + + public static bool operator ==(Identifier left, Identifier right) => Equals(left, right); + + public static bool operator !=(Identifier left, Identifier right) => !Equals(left, right); +} diff --git a/src/Stryker.Abstractions/Testing/MutationTestingRequirements.cs b/src/Stryker.Abstractions/Testing/MutationTestingRequirements.cs new file mode 100644 index 0000000000..0db2f8efc6 --- /dev/null +++ b/src/Stryker.Abstractions/Testing/MutationTestingRequirements.cs @@ -0,0 +1,19 @@ +using System; + +namespace Stryker.Abstractions.Testing; + +[Flags] +public enum MutationTestingRequirements +{ + None = 0, + // mutation is static or executed inside à static context + Static = 1, + // mutation is covered outside test (before or after) + CoveredOutsideTest = 2, + // mutation needs to be activated ASAP when tested + NeedEarlyActivation = 4, + // mutation needs to be run in 'all tests' mode + AgainstAllTests = 8, + // not covered + NotCovered = 256 +} diff --git a/src/Stryker.Core/Stryker.Core/Mutants/TestDescription.cs b/src/Stryker.Abstractions/Testing/TestDescription.cs similarity index 74% rename from src/Stryker.Core/Stryker.Core/Mutants/TestDescription.cs rename to src/Stryker.Abstractions/Testing/TestDescription.cs index 143f951e00..fdef636594 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/TestDescription.cs +++ b/src/Stryker.Abstractions/Testing/TestDescription.cs @@ -1,17 +1,15 @@ -using System; +namespace Stryker.Abstractions.Testing; -namespace Stryker.Core.Mutants; - -public sealed class TestDescription +public sealed class TestDescription : ITestDescription { - public TestDescription(Guid id, string name, string testFilePath) + public TestDescription(Identifier id, string name, string testFilePath) { Id = id; Name = name; TestFilePath = testFilePath; } - public Guid Id { get; } + public Identifier Id { get; } public string Name { get; } @@ -21,6 +19,7 @@ private bool Equals(TestDescription other) { return Id == other.Id; } + public override bool Equals(object obj) { if (obj is null) diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/TestFrameworks.cs b/src/Stryker.Abstractions/Testing/TestFrameworks.cs similarity index 71% rename from src/Stryker.Core/Stryker.Core/TestRunners/TestFrameworks.cs rename to src/Stryker.Abstractions/Testing/TestFrameworks.cs index 6868af07c4..213bca384c 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/TestFrameworks.cs +++ b/src/Stryker.Abstractions/Testing/TestFrameworks.cs @@ -1,6 +1,6 @@ using System; -namespace Stryker.Core.TestRunners; +namespace Stryker.Abstractions.Testing; [Flags] public enum TestFrameworks diff --git a/src/Stryker.Abstractions/packages.lock.json b/src/Stryker.Abstractions/packages.lock.json index a86329837e..b2129ecc0e 100644 --- a/src/Stryker.Abstractions/packages.lock.json +++ b/src/Stryker.Abstractions/packages.lock.json @@ -283,8 +283,10 @@ "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )" } }, "Microsoft.CodeAnalysis.Analyzers": { @@ -325,6 +327,12 @@ "System.Diagnostics.DiagnosticSource": "9.0.0" } }, + "Mono.Cecil": { + "type": "CentralTransitive", + "requested": "[0.11.6, )", + "resolved": "0.11.6", + "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" + }, "NuGet.Frameworks": { "type": "CentralTransitive", "requested": "[6.12.1, )", diff --git a/src/Stryker.CLI/Stryker.CLI.UnitTest/StrykerCLITests.cs b/src/Stryker.CLI/Stryker.CLI.UnitTest/StrykerCLITests.cs index eeb1b159f9..878a7ee57b 100644 --- a/src/Stryker.CLI/Stryker.CLI.UnitTest/StrykerCLITests.cs +++ b/src/Stryker.CLI/Stryker.CLI.UnitTest/StrykerCLITests.cs @@ -10,7 +10,6 @@ using Shouldly; using Spectre.Console.Testing; using Stryker.Abstractions; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.CLI.Clients; using Stryker.CLI.Logging; diff --git a/src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json b/src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json index 6430aec710..49617cfe41 100644 --- a/src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json +++ b/src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json @@ -289,11 +289,6 @@ "Microsoft.Testing.Platform": "1.5.0" } }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" - }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", "resolved": "1.5.0", @@ -333,15 +328,6 @@ "resolved": "3.7.0", "contentHash": "6cW8FWzz6gr5MArL8GDNrw5c+afJtOMRyntFEzAdbgPHgH8DuLGMAyz8g38k/LMquewk3tOmbXoDIL/IACLKjg==" }, - "MSTest.TestAdapter": { - "type": "Transitive", - "resolved": "3.7.0", - "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", - "Microsoft.Testing.Platform.MSBuild": "1.5.0" - } - }, "NETStandard.Library": { "type": "Transitive", "resolved": "2.0.0", @@ -859,6 +845,8 @@ "DotNet.Glob": "[3.1.3, )", "Grynwald.MarkdownGenerator": "[3.0.106, )", "LibGit2Sharp": "[0.31.0, )", + "MSTest.TestAdapter": "[3.7.0, )", + "MSTest.TestFramework": "[3.7.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.Extensions.Logging": "[9.0.0, )", @@ -866,22 +854,26 @@ "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Microsoft.TestPlatform.Portable": "[17.12.0, )", "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", "Microsoft.Web.LibraryManager.Build": "[2.1.175, )", "Mono.Cecil": "[0.11.6, )", "NuGet.Frameworks": "[6.12.1, )", - "ResXResourceReader.NetStandard": "[1.3.0, )", "Serilog": "[4.2.0, )", "Serilog.Extensions.Logging": "[9.0.0, )", "Serilog.Extensions.Logging.File": "[3.0.0, )", "Serilog.Sinks.Console": "[6.0.0, )", "ShellProgressBar": "[5.2.0, )", "Spectre.Console": "[0.49.1, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Configuration": "[4.4.1, )", - "Stryker.DataCollector": "[4.4.1, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Configuration": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", "Stryker.Regex.Parser": "[1.0.0, )", - "Stryker.RegexMutators": "[4.4.1, )", - "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + "Stryker.RegexMutators": "[1.0.0, )", + "Stryker.TestRunner.VsTest": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )", + "dnlib": "[4.4.0, )" } }, "stryker.abstractions": { @@ -893,7 +885,6 @@ "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Utilities": "[4.4.1, )", "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" } }, @@ -904,8 +895,8 @@ "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Utilities": "[4.4.1, )" + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" } }, "stryker.datacollector": { @@ -921,11 +912,40 @@ "Stryker.Regex.Parser": "[1.0.0, )" } }, + "stryker.testrunner": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "stryker.testrunner.vstest": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Microsoft.TestPlatform": "[17.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.TestPlatform.Portable": "[17.12.0, )", + "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", + "Stryker.TestRunner": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" + } + }, "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" } }, "Azure.Storage.Files.Shares": { @@ -955,6 +975,12 @@ "NuGet.Frameworks": "6.9.1" } }, + "dnlib": { + "type": "CentralTransitive", + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "cKHI720q+zfEEvzklWVGt6B0TH3AibAyJbpUJl4U6KvTP13tycfnqJpkGHRZ/oQ45BTIoIxIwltHIJVDN+iCqQ==" + }, "DotNet.Glob": { "type": "CentralTransitive", "requested": "[3.1.3, )", @@ -1038,6 +1064,22 @@ "System.Diagnostics.DiagnosticSource": "9.0.0" } }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, "Microsoft.TestPlatform": { "type": "CentralTransitive", "requested": "[17.12.0, )", @@ -1083,6 +1125,16 @@ "resolved": "0.11.6", "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" }, + "MSTest.TestAdapter": { + "type": "CentralTransitive", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", + "Microsoft.Testing.Platform.MSBuild": "1.5.0" + } + }, "MSTest.TestFramework": { "type": "CentralTransitive", "requested": "[3.7.0, )", diff --git a/src/Stryker.CLI/Stryker.CLI/packages.lock.json b/src/Stryker.CLI/Stryker.CLI/packages.lock.json index cd0c2c0518..07503e7a2e 100644 --- a/src/Stryker.CLI/Stryker.CLI/packages.lock.json +++ b/src/Stryker.CLI/Stryker.CLI/packages.lock.json @@ -66,6 +66,14 @@ "resolved": "2.0.323", "contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA==" }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "6.0.0", @@ -176,6 +184,43 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "G6XK8iLDMHIys55Fw7lIudRGrhNo3e/msIGkt6+Fckqggd9xl/nGTawy/4Avb8GFcuPfCwpQUuu8ESCPaxr08Q==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "3vMXWbqqy3rSXYlPshR7CPqG0bgGDOhasyhVtqhAOy2tMED6VKU/IbKNMUmEuqgPNjMkCaicDTfNdXsrJPKcsw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "lLb7JfTDdl6PUU3+Ia2O7+LekAqvyW3C5Rl94f+A/G16g+gxhynRDx73UuCBotjhn+8WGfEEH7Q81LsMCK/O4A==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.TestPlatform.ObjectModel": "17.12.0", + "Microsoft.Testing.Extensions.Telemetry": "1.5.0", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "D3mL4Tz0m6nDkbl0ZdTnHiyKMqxDc84mtDiFzM6HQgfLlc5OIdZgN+MCj6YD1CW/izQO566XHOFImTSxluiLIg==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, "MSBuild.StructuredLogger": { "type": "Transitive", "resolved": "2.2.158", @@ -193,6 +238,11 @@ "Microsoft.Build": "15.3.409" } }, + "MSTest.Analyzers": { + "type": "Transitive", + "resolved": "3.7.0", + "contentHash": "6cW8FWzz6gr5MArL8GDNrw5c+afJtOMRyntFEzAdbgPHgH8DuLGMAyz8g38k/LMquewk3tOmbXoDIL/IACLKjg==" + }, "NETStandard.Library": { "type": "Transitive", "resolved": "2.0.0", @@ -685,6 +735,8 @@ "DotNet.Glob": "[3.1.3, )", "Grynwald.MarkdownGenerator": "[3.0.106, )", "LibGit2Sharp": "[0.31.0, )", + "MSTest.TestAdapter": "[3.7.0, )", + "MSTest.TestFramework": "[3.7.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.Extensions.Logging": "[9.0.0, )", @@ -692,22 +744,26 @@ "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Microsoft.TestPlatform.Portable": "[17.12.0, )", "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", "Microsoft.Web.LibraryManager.Build": "[2.1.175, )", "Mono.Cecil": "[0.11.6, )", "NuGet.Frameworks": "[6.12.1, )", - "ResXResourceReader.NetStandard": "[1.3.0, )", "Serilog": "[4.2.0, )", "Serilog.Extensions.Logging": "[9.0.0, )", "Serilog.Extensions.Logging.File": "[3.0.0, )", "Serilog.Sinks.Console": "[6.0.0, )", "ShellProgressBar": "[5.2.0, )", "Spectre.Console": "[0.49.1, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Configuration": "[4.4.1, )", - "Stryker.DataCollector": "[4.4.1, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Configuration": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", "Stryker.Regex.Parser": "[1.0.0, )", - "Stryker.RegexMutators": "[4.4.1, )", - "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + "Stryker.RegexMutators": "[1.0.0, )", + "Stryker.TestRunner.VsTest": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )", + "dnlib": "[4.4.0, )" } }, "stryker.abstractions": { @@ -719,7 +775,6 @@ "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Utilities": "[4.4.1, )", "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" } }, @@ -730,8 +785,8 @@ "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Utilities": "[4.4.1, )" + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" } }, "stryker.datacollector": { @@ -747,11 +802,40 @@ "Stryker.Regex.Parser": "[1.0.0, )" } }, + "stryker.testrunner": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "stryker.testrunner.vstest": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Microsoft.TestPlatform": "[17.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.TestPlatform.Portable": "[17.12.0, )", + "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", + "Stryker.TestRunner": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" + } + }, "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" } }, "Azure.Storage.Files.Shares": { @@ -781,6 +865,12 @@ "NuGet.Frameworks": "6.9.1" } }, + "dnlib": { + "type": "CentralTransitive", + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "cKHI720q+zfEEvzklWVGt6B0TH3AibAyJbpUJl4U6KvTP13tycfnqJpkGHRZ/oQ45BTIoIxIwltHIJVDN+iCqQ==" + }, "DotNet.Glob": { "type": "CentralTransitive", "requested": "[3.1.3, )", @@ -855,6 +945,22 @@ "System.Diagnostics.DiagnosticSource": "9.0.0" } }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, "Microsoft.TestPlatform": { "type": "CentralTransitive", "requested": "[17.12.0, )", @@ -900,6 +1006,25 @@ "resolved": "0.11.6", "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" }, + "MSTest.TestAdapter": { + "type": "CentralTransitive", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", + "Microsoft.Testing.Platform.MSBuild": "1.5.0" + } + }, + "MSTest.TestFramework": { + "type": "CentralTransitive", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "CRHONroYbAaxhVILTNS84gIaI3uRRVmj8Qd3+Mpia1AVwSz2JiQy0LlTqtS8p+TYWgN+8zHG6j17OaTz/P/eHw==", + "dependencies": { + "MSTest.Analyzers": "3.7.0" + } + }, "NuGet.Frameworks": { "type": "CentralTransitive", "requested": "[6.12.1, )", diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Clients/DashboardClientsTest.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Clients/DashboardClientsTest.cs index 1fd231135e..cbeca87eb2 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Clients/DashboardClientsTest.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Clients/DashboardClientsTest.cs @@ -10,7 +10,6 @@ using Moq.Protected; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Core.Clients; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpCompilingProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpCompilingProcessTests.cs index 409dd9d5e3..172850410f 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpCompilingProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpCompilingProcessTests.cs @@ -13,15 +13,13 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; +using Stryker.Abstractions.Testing; using Stryker.Core.Compiling; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.TestRunners; namespace Stryker.Core.UnitTest.Compiling; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpRollbackProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpRollbackProcessTests.cs index f6f40a4c2e..a7d3e37730 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpRollbackProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Compiling/CSharpRollbackProcessTests.cs @@ -13,7 +13,6 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutators; using Stryker.Core.Compiling; using Stryker.Core.InjectedHelpers; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Helpers/VsTestHelperTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Helpers/VsTestHelperTests.cs index 567806bdb1..b7ecfb874e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Helpers/VsTestHelperTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Helpers/VsTestHelperTests.cs @@ -1,9 +1,8 @@ -using System; using System.IO; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Core.Helpers; +using Stryker.TetsRunner.VsTest.Helpers; namespace Stryker.Core.UnitTest.Helpers; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/BuildAnalyzerTestsBase.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/BuildAnalyzerTestsBase.cs index b22658e0fa..9cee5eda2e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/BuildAnalyzerTestsBase.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/BuildAnalyzerTestsBase.cs @@ -7,9 +7,8 @@ using Buildalyzer.Construction; using Buildalyzer.Environment; using Moq; -using Stryker.Core.Initialisation.Buildalyzer; using Stryker.Core.Testing; -using Stryker.Core.UnitTest; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.UnitTest.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/Buildalyzer/AnalyzerResultExtensionsTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/Buildalyzer/AnalyzerResultExtensionsTests.cs index ed16f488c2..e6e28f5886 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/Buildalyzer/AnalyzerResultExtensionsTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/Buildalyzer/AnalyzerResultExtensionsTests.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using Buildalyzer; using Microsoft.CodeAnalysis; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.UnitTest.Initialisation.Buildalyzer; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialTestProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialTestProcessTests.cs index d470bc4844..68c24cd0e1 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialTestProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialTestProcessTests.cs @@ -2,17 +2,15 @@ using System.Collections.Generic; using System.Linq; using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions; -using Stryker.Abstractions.TestRunners; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Stryker.Core.TestRunners; -using Stryker.Core.Mutants; -using Stryker.Core.TestRunners.VsTest; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; -using Stryker.Core.UnitTest; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialisationProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialisationProcessTests.cs index b415d08690..86a583f49a 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialisationProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InitialisationProcessTests.cs @@ -9,15 +9,15 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.ProjectComponents; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; -using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.Initialisation; @@ -118,7 +118,7 @@ public void InitialisationProcess_ShouldThrowIfHalfTestsAreFailing() var failedTest = Guid.NewGuid(); var ranTests = new TestGuidsList(failedTest, Guid.NewGuid()); var testSet = new TestSet(); - foreach (var ranTest in ranTests.GetGuids()) + foreach (var ranTest in ranTests.GetIdentifiers()) { testSet.RegisterTest(new TestDescription(ranTest, "test", "test.cpp")); } @@ -170,7 +170,7 @@ public void InitialisationProcess_ShouldThrowOnTestTestIfAskedFor(bool breakOnIn var failedTest = Guid.NewGuid(); var ranTests = new TestGuidsList(failedTest, Guid.NewGuid(), Guid.NewGuid()); var testSet = new TestSet(); - foreach (var ranTest in ranTests.GetGuids()) + foreach (var ranTest in ranTests.GetIdentifiers()) { testSet.RegisterTest(new TestDescription(ranTest, "test", "test.cpp")); } @@ -222,7 +222,7 @@ public void InitialisationProcess_ShouldRunTestSession() inputFileResolverMock.SetupGet(x => x.FileSystem).Returns(new FileSystem()); initialBuildProcessMock.Setup(x => x.InitialBuild(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), null)); var testSet = new TestSet(); - testSet.RegisterTest(new TestDescription(Guid.Empty, "test", "test.cs")); + testSet.RegisterTest(new TestDescription(Identifier.Empty, "test", "test.cs")); testRunnerMock.Setup(x => x.DiscoverTests(It.IsAny())).Returns(true); testRunnerMock.Setup(x => x.GetTests(It.IsAny())).Returns(testSet); initialTestProcessMock.Setup(x => x.InitialTest(It.IsAny(), It.IsAny(), It.IsAny())) diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InputFileResolverTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InputFileResolverTests.cs index 44f948355a..864cdb632e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InputFileResolverTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/InputFileResolverTests.cs @@ -15,7 +15,7 @@ using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Core.Initialisation; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Utilities.Buildalyzer; using Stryker.Core.ProjectComponents; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.TestProjects; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectMutatorTests.cs index 41948abb00..8053b98b77 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectMutatorTests.cs @@ -9,12 +9,12 @@ using Stryker.Abstractions; using Stryker.Abstractions.Reporting; using Stryker.Core.Initialisation; -using Stryker.Core.Mutants; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; -using VsTest = Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; +using TestCase = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase; namespace Stryker.Core.UnitTest.Initialisation; @@ -38,6 +38,12 @@ public void Test1() { // example test } + + [TestMethod] + public void Test2() + { + // example test + } } } "; @@ -53,7 +59,7 @@ public ProjectMutatorTests() TestProjects = new List { new(_fileSystemMock, TestHelper.SetupProjectAnalyzerResult( - sourceFiles: new string[] { _testFilePath }).Object) + sourceFiles: new [] { _testFilePath }).Object) } } }; @@ -65,19 +71,21 @@ public void ShouldInitializeEachProjectInSolution() // arrange var options = new StrykerOptions(); var target = new ProjectMutator(_mutationTestProcessMock.Object); - var testCase1 = new VsTest.TestCase("mytestname", new Uri(_testFilePath), _testFileContents) + var testCase1 = new VsTestCase(new TestCase("mytestname1", new Uri(_testFilePath), _testFileContents) { + Id = Guid.NewGuid(), CodeFilePath = _testFilePath, LineNumber = 7, - }; - var failedTest = testCase1.Id; - var testCase2 = new VsTest.TestCase("mytestname", new Uri(_testFilePath), _testFileContents) + }); + var failedTest = testCase1.Id.ToGuid(); + var testCase2 = new VsTestCase(new TestCase("mytestname2", new Uri(_testFilePath), _testFileContents) { + Id = Guid.NewGuid(), CodeFilePath = _testFilePath, - LineNumber = 7, - }; - var successfulTest = testCase2.Id; + LineNumber = 13, + }); + var successfulTest = testCase2.Id.ToGuid(); var tests = new List { new VsTestDescription(testCase1), new VsTestDescription(testCase2) }; var initialTestRunResult = new TestRunResult( vsTestDescriptions: tests, @@ -97,6 +105,6 @@ public void ShouldInitializeEachProjectInSolution() // assert result.ShouldNotBeNull(); var testFile = _mutationTestInput.TestProjectsInfo.TestFiles.ShouldHaveSingleItem(); - testFile.Tests.Count().ShouldBe(1); + testFile.Tests.ShouldHaveSingleItem(); } } diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectOrchestratorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectOrchestratorTests.cs index 619e5429bd..9e85cb8ae9 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectOrchestratorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Initialisation/ProjectOrchestratorTests.cs @@ -11,14 +11,14 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Reporting; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; -using Stryker.Core.Mutants; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents; -using Stryker.Core.TestRunners; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/BaselineMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/BaselineMutantFilterTests.cs index 2a6ab8705e..51e498754d 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/BaselineMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/BaselineMutantFilterTests.cs @@ -6,7 +6,6 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Baseline; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeFromCodeCoverageFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeFromCodeCoverageFilterTests.cs index 4bdfc9414b..68088b44dc 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeFromCodeCoverageFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeFromCodeCoverageFilterTests.cs @@ -4,7 +4,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeLinqExpressionFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeLinqExpressionFilterTests.cs index b14fa91a47..6dc9ae62ab 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeLinqExpressionFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeLinqExpressionFilterTests.cs @@ -6,7 +6,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; using Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeMutationMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeMutationMutantFilterTests.cs index 2c88bebb82..11ee23d35d 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeMutationMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/ExcludeMutationMutantFilterTests.cs @@ -1,8 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/FilePatternMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/FilePatternMutantFilterTests.cs index c9af4f8ab5..c739f3b933 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/FilePatternMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/FilePatternMutantFilterTests.cs @@ -5,7 +5,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoreBlockMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoreBlockMutantFilterTests.cs index cdf3235c65..6809827cfa 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoreBlockMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoreBlockMutantFilterTests.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoredMethodMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoredMethodMutantFilterTests.cs index 4fdb9c7b21..bb7216266e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoredMethodMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/IgnoredMethodMutantFilterTests.cs @@ -8,7 +8,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options.Inputs; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/MutantFilterFactoryTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/MutantFilterFactoryTests.cs index ca76ecdfba..5079eda28b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/MutantFilterFactoryTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/MutantFilterFactoryTests.cs @@ -11,6 +11,7 @@ using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; using Stryker.Core.Reporters.Json; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.MutantFilters; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/SinceMutantFilterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/SinceMutantFilterTests.cs index d07c87d22f..c492239822 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/SinceMutantFilterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutantFilters/SinceMutantFilterTests.cs @@ -7,11 +7,13 @@ using Moq; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions.Testing; using Stryker.Core.DiffProviders; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.MutantFilters; @@ -107,7 +109,7 @@ public void ShouldNotFilterMutantsWhereCoveringTestsContainsChangedTestFile() var myTestPath = Path.Combine(testProjectPath, "myTest.cs"); ; var tests = new TestSet(); - var test = new TestDescription(Guid.NewGuid(), "name", myTestPath); + var test = new TestDescription(Identifier.Create(Guid.NewGuid()), "name", myTestPath); tests.RegisterTests(new[] { test }); diffProvider.SetupGet(x => x.Tests).Returns(tests); diffProvider.Setup(x => x.ScanDiff()).Returns(new DiffResult @@ -249,8 +251,8 @@ public void FilterMutants_FiltersNoMutants_IfTestsChanged() }); var tests = new TestSet(); - var test1 = new TestDescription(Guid.NewGuid(), "name1", "C:/testfile1.cs"); - var test2 = new TestDescription(Guid.NewGuid(), "name2", "C:/testfile2.cs"); + var test1 = new TestDescription(Identifier.Create(Guid.NewGuid()), "name1", "C:/testfile1.cs"); + var test2 = new TestDescription(Identifier.Create(Guid.NewGuid()), "name2", "C:/testfile2.cs"); tests.RegisterTests(new[] { test1, test2 }); diffProvider.SetupGet(x => x.Tests).Returns(tests); var target = new SinceMutantFilter(diffProvider.Object); diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs index 65b7523153..053719069d 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs @@ -7,8 +7,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Configuration; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantOrchestratorTestsBase.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantOrchestratorTestsBase.cs index 8918db842b..9caec922e1 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantOrchestratorTestsBase.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantOrchestratorTestsBase.cs @@ -1,11 +1,8 @@ -using System.Text.RegularExpressions; using Microsoft.CodeAnalysis.CSharp; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions; -using Stryker.Core.Mutants; -using Stryker.Core.InjectedHelpers; using Stryker.Abstractions.Options; +using Stryker.Core.InjectedHelpers; +using Stryker.Core.Mutants; namespace Stryker.Core.UnitTest.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantPlacerTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantPlacerTests.cs index 8a522dbec9..b05d713d5a 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantPlacerTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantPlacerTests.cs @@ -7,8 +7,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Core.InjectedHelpers; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantTests.cs index 4214ca5bb3..0b52d5ea5b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutants/MutantTests.cs @@ -1,8 +1,9 @@ using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Core.Mutants; +using Stryker.TestRunner.Tests; namespace Stryker.Core.UnitTest.Mutants; @@ -58,8 +59,8 @@ public void ShouldSetKilledStateWhenAssesingTestFailed() false); mutant.ResultStatus.ShouldBe(MutantStatus.Killed); - var killingTest = mutant.KillingTests.GetGuids().ShouldHaveSingleItem(); - killingTest.ShouldBe(failingTest); + var killingTest = mutant.KillingTests.GetIdentifiers().ShouldHaveSingleItem(); + killingTest.ToGuid().ShouldBe(failingTest); } [TestMethod] @@ -78,7 +79,7 @@ public void ShouldSetSurvivedWhenNonAssesingTestFailed() false); mutant.ResultStatus.ShouldBe(MutantStatus.Survived); - mutant.KillingTests.GetGuids().ShouldBeEmpty(); + mutant.KillingTests.GetIdentifiers().ShouldBeEmpty(); } [TestMethod] @@ -96,7 +97,7 @@ public void ShouldSetSurvivedWhenNoTestSucceeds() false); mutant.ResultStatus.ShouldBe(MutantStatus.Survived); - mutant.KillingTests.GetGuids().ShouldBeEmpty(); + mutant.KillingTests.GetIdentifiers().ShouldBeEmpty(); } [TestMethod] diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/CSharpMutationTestProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/CSharpMutationTestProcessTests.cs index c198e833c7..f1a5f449f5 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/CSharpMutationTestProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/CSharpMutationTestProcessTests.cs @@ -13,7 +13,7 @@ using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; -using Mutation = Stryker.Abstractions.Mutants.Mutation; +using Mutation = Stryker.Abstractions.Mutation; namespace Stryker.Core.UnitTest.MutationTest; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/FullRunScenario.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/FullRunScenario.cs index 6ea42cf6ae..a6370dbab3 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/FullRunScenario.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/FullRunScenario.cs @@ -2,13 +2,14 @@ using System.Collections.Generic; using System.Linq; using Moq; -using Stryker.Abstractions.Initialisation; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions; using Stryker.Abstractions.Options; -using Stryker.Core.TestRunners; +using Stryker.Abstractions.Testing; using Stryker.Core.Mutants; -using Stryker.Core.TestRunners.VsTest; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; +using static Stryker.Abstractions.Testing.ITestRunner; namespace Stryker.Core.UnitTest.MutationTest; @@ -64,7 +65,7 @@ public void DeclareCoverageForMutant(int mutantId, params int[] testIds) _coverageResult[mutantId] = GetGuidList(testIds); foreach (var testId in testIds.Length == 0 ? _tests.Keys.ToArray() : testIds) { - var id = _tests[testId].Id; + var id = _tests[testId].Id.ToGuid(); if (!_testCoverage.ContainsKey(id)) { _testCoverage[id] = new List(); @@ -103,7 +104,7 @@ public TestDescription CreateTest(int id = -1, string name = null, string file = id = _tests.Keys.Append(-1).Max() + 1; } - var test = new TestDescription(Guid.NewGuid(), name ?? $"test {id}", file); + var test = new TestDescription(Identifier.Create(Guid.NewGuid()), name ?? $"test {id}", file); _tests[id] = test; TestSet.RegisterTests(new[] { test }); return test; @@ -178,7 +179,7 @@ public Mock GetTestRunnerMock() var result = new List(_tests.Count); foreach (var (guid, mutations) in _testCoverage) { - result.Add(new CoverageRunResult(guid, CoverageConfidence.Normal, + result.Add(CoverageRunResult.Create(guid.ToString(), CoverageConfidence.Normal, mutations, Enumerable.Empty(), Enumerable.Empty())); diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestExecutorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestExecutorTests.cs index d1988e0abf..333feeb931 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestExecutorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestExecutorTests.cs @@ -5,13 +5,13 @@ using Moq; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Initialisation; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; using Stryker.Core.Mutants; using Stryker.Core.MutationTest; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.UnitTest.MutationTest; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestProcessTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestProcessTests.cs index 739283ce3d..c890a326ad 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestProcessTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/MutationTest/MutationTestProcessTests.cs @@ -8,8 +8,6 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Abstractions.Reporting; using Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AbstractMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AbstractMutatorTests.cs index 48f3dc3703..6bff7ba870 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AbstractMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AbstractMutatorTests.cs @@ -2,8 +2,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Shouldly; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions; using System; using System.Collections.Generic; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ArrayCreationMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ArrayCreationMutatorTests.cs index 82b6b25054..267c7c51ec 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ArrayCreationMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ArrayCreationMutatorTests.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AssignmentStatementMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AssignmentStatementMutatorTests.cs index c570b28728..ad4756fb05 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AssignmentStatementMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/AssignmentStatementMutatorTests.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BinaryExpressionMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BinaryExpressionMutatorTests.cs index 2ff4046b62..65d6997a88 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BinaryExpressionMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BinaryExpressionMutatorTests.cs @@ -1,11 +1,11 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Shouldly; -using Stryker.Abstractions.Mutators; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Core.UnitTest; using Stryker.Core.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BlockMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BlockMutatorTests.cs index da277fdea4..66b95033a4 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BlockMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BlockMutatorTests.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; namespace Stryker.Core.Mutators.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BooleanMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BooleanMutatorTests.cs index 0878e455d4..e321bdf6ec 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BooleanMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/BooleanMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CheckedMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CheckedMutatorTests.cs index c9770d4f7c..b1f5e3c97e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CheckedMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CheckedMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs index b48508e8ce..8e91938152 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/CollectionExpressionMutatorTests.cs @@ -1,17 +1,17 @@ +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.IO; -using System; using System.Linq; using System.Reflection; +using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Exceptions; using Stryker.Abstractions; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Options; using Stryker.Core.Compiling; using Stryker.Core.InjectedHelpers; @@ -19,7 +19,6 @@ using Stryker.Core.MutationTest; using Stryker.Core.Mutators; using Stryker.Core.ProjectComponents.SourceProjects; -using System.Text; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ConditionalExpressionMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ConditionalExpressionMutatorTests.cs index ca473809e1..582eb8ec6a 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ConditionalExpressionMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ConditionalExpressionMutatorTests.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InitializerMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InitializerMutatorTests.cs index 3001a087bb..15a997b9d7 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InitializerMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InitializerMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InterpolatedStringMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InterpolatedStringMutatorTests.cs index 770117b59b..160d72169b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InterpolatedStringMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/InterpolatedStringMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/LinqMutatorTest.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/LinqMutatorTest.cs index 4afd62fd44..4e1490140d 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/LinqMutatorTest.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/LinqMutatorTest.cs @@ -4,7 +4,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.Mutators; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/MathMutatorTest.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/MathMutatorTest.cs index 5652ad45eb..e6d9df8662 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/MathMutatorTest.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/MathMutatorTest.cs @@ -5,10 +5,10 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Shouldly; -using Stryker.Abstractions.Mutators; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Core.Mutators; using Stryker.Core.UnitTest; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NegateConditionMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NegateConditionMutatorTests.cs index 6966110c8d..ab8c98da7b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NegateConditionMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NegateConditionMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NullCoalescingExpressionMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NullCoalescingExpressionMutatorTests.cs index 2f6fe5135d..6e4aaf5f7f 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NullCoalescingExpressionMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/NullCoalescingExpressionMutatorTests.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ObjectCreationMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ObjectCreationMutatorTests.cs index fe8553c09f..1f8496a05b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ObjectCreationMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/ObjectCreationMutatorTests.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PostfixUnaryMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PostfixUnaryMutatorTests.cs index 74d67d3d17..1b26438977 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PostfixUnaryMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PostfixUnaryMutatorTests.cs @@ -1,10 +1,10 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Shouldly; -using Stryker.Abstractions.Mutators; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Core.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PrefixUnaryMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PrefixUnaryMutatorTests.cs index c447f22f51..4eaa651696 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PrefixUnaryMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/PrefixUnaryMutatorTests.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/RegexMutatorTest.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/RegexMutatorTest.cs index a29c88efe8..82b48890b5 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/RegexMutatorTest.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/RegexMutatorTest.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StatementMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StatementMutatorTests.cs index 2294034023..c36c3b199a 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StatementMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StatementMutatorTests.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringEmptyMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringEmptyMutatorTests.cs index 7c3868852f..fc857eadf5 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringEmptyMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringEmptyMutatorTests.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMethodMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMethodMutatorTests.cs index 9739cc82af..850f914d96 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMethodMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMethodMutatorTests.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Mutators; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMutatorTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMutatorTests.cs index 73d8272741..2610aa2c47 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMutatorTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/StringMutatorTests.cs @@ -1,10 +1,10 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Shouldly; -using Stryker.Abstractions.Mutators; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Core.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/TestMutator.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/TestMutator.cs index 93d31102ef..22300ef0e7 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/TestMutator.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Mutators/TestMutator.cs @@ -1,4 +1,4 @@ -using Stryker.Utilities.Attributes; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Mutators; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/IgnoreMutationsInputTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/IgnoreMutationsInputTests.cs index b4825e467e..cbd8950f7b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/IgnoreMutationsInputTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/IgnoreMutationsInputTests.cs @@ -3,7 +3,6 @@ using System.Linq; using Shouldly; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options.Inputs; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Abstractions; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/MutationLevelInputTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/MutationLevelInputTests.cs index 33970c3452..ca66dc5a7c 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/MutationLevelInputTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Options/Inputs/MutationLevelInputTests.cs @@ -1,9 +1,9 @@ using Shouldly; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options.Inputs; using Microsoft.VisualStudio.TestTools.UnitTesting; using Stryker.Core.UnitTest; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Options.Inputs; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/CsharpProjectComponentTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/CsharpProjectComponentTests.cs index 0d80495629..a129231459 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/CsharpProjectComponentTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/CsharpProjectComponentTests.cs @@ -1,5 +1,4 @@ using Shouldly; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; using System.Collections.ObjectModel; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/SourceProjects/SourceProjectInfoTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/SourceProjects/SourceProjectInfoTests.cs index 3ac40970b0..a7121c9b90 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/SourceProjects/SourceProjectInfoTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/SourceProjects/SourceProjectInfoTests.cs @@ -2,8 +2,8 @@ using Microsoft.CodeAnalysis; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; -using Stryker.Core.Initialisation.Buildalyzer; using Stryker.Core.ProjectComponents.SourceProjects; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.UnitTest.ProjectComponents.SourceProjects; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestCaseTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestCaseTests.cs index 6390f7b36c..7158772778 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestCaseTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestCaseTests.cs @@ -2,6 +2,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; +using Stryker.Abstractions.Testing; using Stryker.Core.ProjectComponents.TestProjects; namespace Stryker.Core.UnitTest.ProjectComponents.TestProjects; @@ -13,17 +14,17 @@ public class TestCaseTests public void TestCaseEqualsWhenAllPropertiesEqual() { // Arrange - var guid = Guid.NewGuid(); + var id = Identifier.Create(Guid.NewGuid()); var node = SyntaxFactory.Block(); var testCaseA = new TestCase { - Id = guid, + Id = id, Name = "1", Node = node }; var testCaseB = new TestCase { - Id = guid, + Id = id, Name = "1", Node = node }; @@ -36,19 +37,20 @@ public void TestCaseEqualsWhenAllPropertiesEqual() [TestMethod] [DataRow("fd4896a2-1bd9-4e83-9e81-308059525bc9", "node2")] [DataRow("00000000-0000-0000-0000-000000000000", "node1")] - public void TestCaseNotEqualsWhenNotAllPropertiesEqual(string id, string name) + public void TestCaseNotEqualsWhenNotAllPropertiesEqual(string guid, string name) { // Arrange + var id = Identifier.Create(Guid.Parse(guid)); var node = SyntaxFactory.Block(); var testCaseA = new TestCase { - Id = new Guid(id), + Id = id, Name = name, Node = node }; var testCaseB = new TestCase { - Id = Guid.Empty, + Id = Identifier.Empty, Name = "node2", Node = node }; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestFileTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestFileTests.cs index 0446098a82..c0f502df9e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestFileTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestFileTests.cs @@ -2,6 +2,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; +using Stryker.Abstractions.Testing; using Stryker.Core.ProjectComponents.TestProjects; namespace Stryker.Core.UnitTest.ProjectComponents.TestProjects; @@ -13,7 +14,7 @@ public class TestFileTests public void MergeTestFiles() { // Arrange - var testCase1Id = Guid.NewGuid(); + var testCase1Id = Identifier.Create(Guid.NewGuid()); var node = SyntaxFactory.Block(); var fileA = new TestFile { diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestProjectsInfoTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestProjectsInfoTests.cs index 28b3d70165..096e1e7c71 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestProjectsInfoTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ProjectComponents/TestProjects/TestProjectsInfoTests.cs @@ -6,12 +6,13 @@ using System.Linq; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Stryker.Utilities; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Abstractions.Testing; using Stryker.Core.ProjectComponents.TestProjects; +using Stryker.Utilities; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.UnitTest.ProjectComponents.TestProjects; @@ -64,9 +65,9 @@ public void MergeTestProjectsInfo() var testProjectA = new TestProject(fileSystem, testProjectAnalyzerResultAMock.Object); var testProjectB = new TestProject(fileSystem, testProjectAnalyzerResultBMock.Object); - testProjectA.TestFiles.First().AddTest(Guid.NewGuid(), "test1", SyntaxFactory.Block()); - testProjectA.TestFiles.First().AddTest(Guid.NewGuid(), "test2", SyntaxFactory.Block()); - testProjectB.TestFiles.First().AddTest(Guid.NewGuid(), "test3", SyntaxFactory.Block()); + testProjectA.TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "test1", SyntaxFactory.Block()); + testProjectA.TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "test2", SyntaxFactory.Block()); + testProjectB.TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "test3", SyntaxFactory.Block()); var testProjectsInfoA = new TestProjectsInfo(fileSystem) { @@ -111,8 +112,8 @@ public void MergeTestProjectsInfoWithASharedSourceFile() var testProjectA = new TestProject(fileSystem, testProjectAnalyzerResultAMock.Object); var testProjectB = new TestProject(fileSystem, testProjectAnalyzerResultBMock.Object); - testProjectA.TestFiles.First().AddTest(Guid.NewGuid(), "test1", SyntaxFactory.Block()); - testProjectA.TestFiles.First().AddTest(Guid.NewGuid(), "test2", SyntaxFactory.Block()); + testProjectA.TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "test1", SyntaxFactory.Block()); + testProjectA.TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "test2", SyntaxFactory.Block()); var testProjectsInfoA = new TestProjectsInfo(fileSystem) { diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/BroadcastReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/BroadcastReporterTests.cs index 6587fd3ae0..b57f0515a0 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/BroadcastReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/BroadcastReporterTests.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextReporterTests.cs index 568175229c..9f5bc1d510 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextReporterTests.cs @@ -7,8 +7,6 @@ using Shouldly; using Spectre.Console.Testing; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.TestProjects; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextTreeReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextTreeReporterTests.cs index afea28488a..7e4c320fd8 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextTreeReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ClearTextTreeReporterTests.cs @@ -7,8 +7,6 @@ using Shouldly; using Spectre.Console.Testing; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.TestProjects; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ConsoleDotReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ConsoleDotReporterTests.cs index 302020b9fd..95f8d9a0f7 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ConsoleDotReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ConsoleDotReporterTests.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using Spectre.Console.Testing; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Core.Mutants; using Stryker.Core.Reporters; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/HtmlReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/HtmlReporterTests.cs index 8cc0781f8b..b558a0b6be 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/HtmlReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/HtmlReporterTests.cs @@ -7,7 +7,6 @@ using Shouldly; using Spectre.Console.Testing; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.TestProjects; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/RealTime/RealTimeMutantHandlerTest.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/RealTime/RealTimeMutantHandlerTest.cs index 5abf96e18a..fda6f14cba 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/RealTime/RealTimeMutantHandlerTest.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Html/RealTime/RealTimeMutantHandlerTest.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Core.Mutants; using Stryker.Core.Reporters.Html.RealTime; using Stryker.Core.Reporters.Html.RealTime.Events; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Json/JsonReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Json/JsonReporterTests.cs index 9d9a73beef..e2785d9d3b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Json/JsonReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Json/JsonReporterTests.cs @@ -14,6 +14,7 @@ using Moq; using Shouldly; using Stryker.Abstractions; +using Stryker.Abstractions.Testing; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.TestProjects; using Stryker.Core.Reporters.Json; @@ -183,7 +184,7 @@ public void JsonReporter_OnAllMutantsTestedShouldWriteJsonToFile() } }; var node = CSharpSyntaxTree.ParseText(_testFileContents).GetRoot().DescendantNodes().OfType().Single(); - testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Guid.Empty, "myUnitTestName", node); + testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Identifier.Empty, "myUnitTestName", node); var reporter = new JsonReporter(options, mockFileSystem); @@ -235,10 +236,10 @@ public void JsonReporter_ShouldSupportDuplicateTestFiles() } }; var node = CSharpSyntaxTree.ParseText(_testFileContents).GetRoot().DescendantNodes().OfType().Single(); - testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Guid.Empty, "myUnitTestName", node); - testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Guid.NewGuid(), "myOtherTestName", node); - testProjectsInfo.TestProjects.ElementAt(1).TestFiles.First().AddTest(Guid.Empty, "myUnitTestName", node); - testProjectsInfo.TestProjects.ElementAt(1).TestFiles.First().AddTest(Guid.NewGuid(), "myLastTestName", node); + testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Identifier.Empty, "myUnitTestName", node); + testProjectsInfo.TestProjects.First().TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "myOtherTestName", node); + testProjectsInfo.TestProjects.ElementAt(1).TestFiles.First().AddTest(Identifier.Empty, "myUnitTestName", node); + testProjectsInfo.TestProjects.ElementAt(1).TestFiles.First().AddTest(Identifier.Create(Guid.NewGuid()), "myLastTestName", node); var reporter = new JsonReporter(options, mockFileSystem); diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Progress/ProgressBarReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Progress/ProgressBarReporterTests.cs index b9a414bd5e..6cb3ec7e8e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Progress/ProgressBarReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/Progress/ProgressBarReporterTests.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Core.Mutants; using Stryker.Core.Reporters.Progress; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ReportTestHelper.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ReportTestHelper.cs index dd2778e520..b2d7b1fe2b 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ReportTestHelper.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/ReportTestHelper.cs @@ -2,12 +2,11 @@ using System.Linq; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; using Stryker.Core.Mutants; -using Stryker.Core.ProjectComponents; using Stryker.Core.ProjectComponents.Csharp; +using Stryker.TestRunner.Tests; namespace Stryker.Core.UnitTest.Reporters; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/StatusReporterTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/StatusReporterTests.cs index 9d5fb430f4..279e8eaf18 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/StatusReporterTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Reporters/StatusReporterTests.cs @@ -1,7 +1,6 @@ using Microsoft.Extensions.Logging; using Moq; using Shouldly; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.ProjectComponents; using System; using System.Collections.Generic; @@ -10,6 +9,7 @@ using Stryker.Core.Reporters; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents.Csharp; +using Stryker.Abstractions; namespace Stryker.Core.UnitTest.Reporters; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/Stryker.Core.UnitTest.csproj b/src/Stryker.Core/Stryker.Core.UnitTest/Stryker.Core.UnitTest.csproj index bc01ee4f40..1e60ca2647 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/Stryker.Core.UnitTest.csproj +++ b/src/Stryker.Core/Stryker.Core.UnitTest/Stryker.Core.UnitTest.csproj @@ -1,4 +1,4 @@ - + false @@ -58,6 +58,8 @@ + + diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs index fd2cde8f81..e8a3006226 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/StrykerRunnerTests.cs @@ -7,10 +7,10 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; +using Stryker.Abstractions.Testing; using Stryker.Core.Baseline.Providers; using Stryker.Core.Initialisation; using Stryker.Core.Mutants; @@ -19,7 +19,6 @@ using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; using Stryker.Core.Reporters; -using Stryker.Core.TestRunners; namespace Stryker.Core.UnitTest; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestMockingHelper.cs b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestMockingHelper.cs index c171703f1a..07d6a0b67e 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestMockingHelper.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestMockingHelper.cs @@ -14,21 +14,22 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces; using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollector.InProcDataCollector; -using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; -using Stryker.Core.Helpers; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; using Stryker.Core.Mutants; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; -using Stryker.DataCollector; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; +using Stryker.TetsRunner.VsTest.Helpers; using Stryker.Utilities; +using CoverageCollector = Stryker.DataCollector.CoverageCollector; using VsTest = Microsoft.VisualStudio.TestPlatform.ObjectModel; namespace Stryker.Core.UnitTest.TestRunners; @@ -89,8 +90,8 @@ public VsTestMockingHelper() { _testAssemblyPath!, new MockFileData("Bytecode") }, { Path.Combine(_filesystemRoot, "app", "bin", "Debug", "AppToTest.dll"), new MockFileData("Bytecode") }, }); - _coverageProperty = VsTest.TestProperty.Register(CoverageCollector.PropertyName, CoverageCollector.PropertyName, typeof(string), typeof(TestResult)); - _unexpectedCoverageProperty = VsTest.TestProperty.Register(CoverageCollector.OutOfTestsPropertyName, CoverageCollector.OutOfTestsPropertyName, typeof(string), typeof(TestResult)); + _coverageProperty = VsTest.TestProperty.Register(CoverageCollector.PropertyName, CoverageCollector.PropertyName, typeof(string), typeof(VsTest.TestResult)); + _unexpectedCoverageProperty = VsTest.TestProperty.Register(CoverageCollector.OutOfTestsPropertyName, CoverageCollector.OutOfTestsPropertyName, typeof(string), typeof(VsTest.TestResult)); Mutant = new Mutant { Id = 0 }; OtherMutant = new Mutant { Id = 1 }; _testProjectsInfo = BuildTestProjectsInfo(); diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestRunnerPoolTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestRunnerPoolTests.cs index 22ee4a81f1..eccab6675f 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestRunnerPoolTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTestRunnerPoolTests.cs @@ -7,14 +7,15 @@ using Shouldly; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Core.CoverageAnalysis; using Stryker.Core.Initialisation; using Stryker.Core.Mutants; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; +using Stryker.TestRunner.Tests; +using Stryker.TestRunner.VsTest; using VsTest = Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Stryker.Utilities.Buildalyzer; +using Stryker.Abstractions.Testing; namespace Stryker.Core.UnitTest.TestRunners; @@ -444,13 +445,13 @@ public void HandleFailureWithinMultipleTestResults() result = runner.TestMultipleMutants(SourceProjectInfo, null, new[] { Mutant }, null); result.ExecutedTests.IsEveryTest.ShouldBeTrue(); result.FailingTests.IsEmpty.ShouldBeFalse(); - result.FailingTests.GetGuids().ShouldContain(TestCases[0].Id); + result.FailingTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(TestCases[0].Id); // test session will fail on the other test result SetupMockTestRun(mockVsTest, new[] { ("T0", true), ("T0", false), ("T1", true) }); result = runner.TestMultipleMutants(SourceProjectInfo, null, new[] { Mutant }, null); result.ExecutedTests.IsEveryTest.ShouldBeTrue(); result.FailingTests.IsEmpty.ShouldBeFalse(); - result.FailingTests.GetGuids().ShouldContain(TestCases[0].Id); + result.FailingTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(TestCases[0].Id); } [TestMethod] @@ -469,7 +470,7 @@ public void HandleTimeOutWithMultipleTestResults() result.FailingTests.IsEmpty.ShouldBeTrue(); result.TimedOutTests.Count.ShouldBe(1); - result.TimedOutTests.GetGuids().ShouldContain(TestCases[0].Id); + result.TimedOutTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(TestCases[0].Id); result.ExecutedTests.IsEveryTest.ShouldBeFalse(); } @@ -488,7 +489,7 @@ public void HandleFailureWhenExtraMultipleTestResults() result = runner.TestMultipleMutants(SourceProjectInfo, null, new[] { Mutant }, null); result.ExecutedTests.IsEveryTest.ShouldBeTrue(); result.FailingTests.IsEmpty.ShouldBeFalse(); - result.FailingTests.GetGuids().ShouldContain(TestCases[0].Id); + result.FailingTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(TestCases[0].Id); } [TestMethod] @@ -673,8 +674,8 @@ public void DetectUnexpectedCase() var analyzer = new CoverageAnalyser(options); analyzer.DetermineTestCoverage(SourceProjectInfo, runner, new[] { Mutant, OtherMutant }, TestGuidsList.NoTest()); // the suspicious tests should be used for every mutant - OtherMutant.CoveringTests.GetGuids().ShouldContain(buildCase.Id); - Mutant.CoveringTests.GetGuids().ShouldContain(buildCase.Id); + OtherMutant.CoveringTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(buildCase.Id); + Mutant.CoveringTests.GetIdentifiers().Select(x => x.ToGuid()).ShouldContain(buildCase.Id); } // this verifies that Stryker disregard skipped tests diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTextContextInformationTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTextContextInformationTests.cs index ed269caa84..2a773111a1 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTextContextInformationTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/TestRunners/VsTextContextInformationTests.cs @@ -10,19 +10,17 @@ using Microsoft.TestPlatform.VsTestConsole.TranslationLayer; using Microsoft.TestPlatform.VsTestConsole.TranslationLayer.Interfaces; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Serilog.Events; using Shouldly; using Stryker.Abstractions; -using Stryker.Abstractions.ProjectComponents; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Stryker.Utilities; -using Stryker.Core.TestRunners.VsTest; -using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.Helpers; -using Stryker.Core.ProjectComponents.Csharp; using Stryker.Abstractions.Options; -using Stryker.Core.UnitTest; +using Stryker.Core.ProjectComponents.Csharp; +using Stryker.Core.ProjectComponents.TestProjects; +using Stryker.TestRunner.VsTest; +using Stryker.TetsRunner.VsTest.Helpers; +using Stryker.Utilities; namespace Stryker.Core.UnitTest.TestRunners; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/ToolHelpers/BuildalyzerHelperTests.cs b/src/Stryker.Core/Stryker.Core.UnitTest/ToolHelpers/BuildalyzerHelperTests.cs index 8db7e0e681..7f4d05254a 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/ToolHelpers/BuildalyzerHelperTests.cs +++ b/src/Stryker.Core/Stryker.Core.UnitTest/ToolHelpers/BuildalyzerHelperTests.cs @@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Shouldly; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.UnitTest.ToolHelpers; diff --git a/src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json b/src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json index 682c519963..b98a46a372 100644 --- a/src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json +++ b/src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json @@ -324,11 +324,6 @@ "Microsoft.Testing.Platform": "1.5.0" } }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" - }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", "resolved": "1.5.0", @@ -368,15 +363,6 @@ "resolved": "3.7.0", "contentHash": "6cW8FWzz6gr5MArL8GDNrw5c+afJtOMRyntFEzAdbgPHgH8DuLGMAyz8g38k/LMquewk3tOmbXoDIL/IACLKjg==" }, - "MSTest.TestAdapter": { - "type": "Transitive", - "resolved": "3.7.0", - "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", - "Microsoft.Testing.Platform.MSBuild": "1.5.0" - } - }, "NETStandard.Library": { "type": "Transitive", "resolved": "2.0.0", @@ -846,6 +832,8 @@ "DotNet.Glob": "[3.1.3, )", "Grynwald.MarkdownGenerator": "[3.0.106, )", "LibGit2Sharp": "[0.31.0, )", + "MSTest.TestAdapter": "[3.7.0, )", + "MSTest.TestFramework": "[3.7.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.Extensions.Logging": "[9.0.0, )", @@ -853,22 +841,26 @@ "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Microsoft.TestPlatform.Portable": "[17.12.0, )", "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", "Microsoft.Web.LibraryManager.Build": "[2.1.175, )", "Mono.Cecil": "[0.11.6, )", "NuGet.Frameworks": "[6.12.1, )", - "ResXResourceReader.NetStandard": "[1.3.0, )", "Serilog": "[4.2.0, )", "Serilog.Extensions.Logging": "[9.0.0, )", "Serilog.Extensions.Logging.File": "[3.0.0, )", "Serilog.Sinks.Console": "[6.0.0, )", "ShellProgressBar": "[5.2.0, )", "Spectre.Console": "[0.49.1, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Configuration": "[4.4.1, )", - "Stryker.DataCollector": "[4.4.1, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Configuration": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", "Stryker.Regex.Parser": "[1.0.0, )", - "Stryker.RegexMutators": "[4.4.1, )", - "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + "Stryker.RegexMutators": "[1.0.0, )", + "Stryker.TestRunner.VsTest": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )", + "dnlib": "[4.4.0, )" } }, "stryker.abstractions": { @@ -880,7 +872,6 @@ "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Utilities": "[4.4.1, )", "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" } }, @@ -891,8 +882,8 @@ "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Utilities": "[4.4.1, )" + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" } }, "stryker.datacollector": { @@ -908,11 +899,40 @@ "Stryker.Regex.Parser": "[1.0.0, )" } }, + "stryker.testrunner": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "stryker.testrunner.vstest": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Microsoft.TestPlatform": "[17.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.TestPlatform.Portable": "[17.12.0, )", + "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", + "Stryker.TestRunner": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" + } + }, "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" } }, "Azure.Storage.Files.Shares": { @@ -942,6 +962,12 @@ "NuGet.Frameworks": "6.9.1" } }, + "dnlib": { + "type": "CentralTransitive", + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "cKHI720q+zfEEvzklWVGt6B0TH3AibAyJbpUJl4U6KvTP13tycfnqJpkGHRZ/oQ45BTIoIxIwltHIJVDN+iCqQ==" + }, "DotNet.Glob": { "type": "CentralTransitive", "requested": "[3.1.3, )", @@ -1013,6 +1039,22 @@ "System.Diagnostics.DiagnosticSource": "9.0.0" } }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, "Microsoft.TestPlatform": { "type": "CentralTransitive", "requested": "[17.12.0, )", @@ -1058,6 +1100,16 @@ "resolved": "0.11.6", "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" }, + "MSTest.TestAdapter": { + "type": "CentralTransitive", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", + "Microsoft.Testing.Platform.MSBuild": "1.5.0" + } + }, "MSTest.TestFramework": { "type": "CentralTransitive", "requested": "[3.7.0, )", diff --git a/src/Stryker.Core/Stryker.Core/Baseline/Utils/BaselineMutantHelper.cs b/src/Stryker.Core/Stryker.Core/Baseline/Utils/BaselineMutantHelper.cs index 4763274f75..e1501111a4 100644 --- a/src/Stryker.Core/Stryker.Core/Baseline/Utils/BaselineMutantHelper.cs +++ b/src/Stryker.Core/Stryker.Core/Baseline/Utils/BaselineMutantHelper.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Reporting; namespace Stryker.Core.Baseline.Utils; diff --git a/src/Stryker.Core/Stryker.Core/Baseline/Utils/IBaselineMutantHelper.cs b/src/Stryker.Core/Stryker.Core/Baseline/Utils/IBaselineMutantHelper.cs index 4b2e6162bf..1bc40e7c24 100644 --- a/src/Stryker.Core/Stryker.Core/Baseline/Utils/IBaselineMutantHelper.cs +++ b/src/Stryker.Core/Stryker.Core/Baseline/Utils/IBaselineMutantHelper.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Reporting; namespace Stryker.Core.Baseline.Utils; diff --git a/src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs b/src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs index 74b18d7bf1..65486c508f 100644 --- a/src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs +++ b/src/Stryker.Core/Stryker.Core/Compiling/CSharpRollbackProcess.cs @@ -7,9 +7,9 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutators; using Stryker.Core.Mutants; namespace Stryker.Core.Compiling; diff --git a/src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs b/src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs index d4805f388f..22551c97b8 100644 --- a/src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs +++ b/src/Stryker.Core/Stryker.Core/Compiling/CsharpCompilingProcess.cs @@ -11,13 +11,13 @@ using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Emit; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions; -using Stryker.Core.Initialisation.Buildalyzer; -using Stryker.Core.MutationTest; -using Stryker.Core.Initialisation; using Stryker.Abstractions.Options; +using Stryker.Core.MutationTest; +using Stryker.Utilities.Buildalyzer; +using Stryker.Utilities.EmbeddedResources; namespace Stryker.Core.Compiling; diff --git a/src/Stryker.Core/Stryker.Core/CoverageAnalysis/CoverageAnalyser.cs b/src/Stryker.Core/Stryker.Core/CoverageAnalysis/CoverageAnalyser.cs index e10cb2a426..541ac907b0 100644 --- a/src/Stryker.Core/Stryker.Core/CoverageAnalysis/CoverageAnalyser.cs +++ b/src/Stryker.Core/Stryker.Core/CoverageAnalysis/CoverageAnalyser.cs @@ -1,15 +1,11 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; -using Stryker.Abstractions.Initialisation; -using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.TestRunners; -using Stryker.Core.Mutants; +using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Tests; namespace Stryker.Core.CoverageAnalysis; @@ -25,7 +21,7 @@ public CoverageAnalyser(IStrykerOptions options) } public void DetermineTestCoverage(IProjectAndTests project, ITestRunner runner, IEnumerable mutants, - ITestGuids resultFailingTests) + ITestIdentifiers resultFailingTests) { if (!_options.OptimizationMode.HasFlag(OptimizationModes.SkipUncoveredMutants) && !_options.OptimizationMode.HasFlag(OptimizationModes.CoverageBasedTest)) @@ -35,7 +31,7 @@ public void DetermineTestCoverage(IProjectAndTests project, ITestRunner runner, return; } - ParseCoverage(runner.CaptureCoverage(project), mutants, new TestGuidsList(resultFailingTests.GetGuids())); + ParseCoverage(runner.CaptureCoverage(project), mutants, new TestGuidsList(resultFailingTests.GetIdentifiers())); } private static void AssumeAllTestsAreNeeded(IEnumerable mutants) @@ -47,7 +43,7 @@ private static void AssumeAllTestsAreNeeded(IEnumerable mutants) } } - private void ParseCoverage(IEnumerable coverage, IEnumerable mutantsToScan, + private void ParseCoverage(IEnumerable coverage, IEnumerable mutantsToScan, TestGuidsList failedTests) { if (coverage.Sum(c => c.MutationsCovered.Count) == 0) @@ -57,24 +53,24 @@ private void ParseCoverage(IEnumerable coverage, IEnumerable< return; } - var dubiousTests = new HashSet(); - var trustedTests = new HashSet(); - var testIds = new HashSet(); + var dubiousTests = new HashSet(); + var trustedTests = new HashSet(); + var testIds = new HashSet(); - var mutationToResultMap = new Dictionary>(); + var mutationToResultMap = new Dictionary>(); foreach (var coverageRunResult in coverage) { foreach (var i in coverageRunResult.MutationsCovered) { if (!mutationToResultMap.ContainsKey(i)) { - mutationToResultMap[i] = new List(); + mutationToResultMap[i] = new List(); } mutationToResultMap[i].Add(coverageRunResult); } - if (failedTests.Contains(coverageRunResult.TestId)) + if (failedTests.GetIdentifiers().Contains(coverageRunResult.TestId)) { // exclude failing tests from the list of all tests continue; @@ -112,9 +108,9 @@ private void ParseCoverage(IEnumerable coverage, IEnumerable< } private void CoverageForThisMutant(IMutant mutant, - IReadOnlyDictionary> mutationToResultMap, + IReadOnlyDictionary> mutationToResultMap, TestGuidsList everytest, - TestGuidsList allTestsGuidsExceptTrusted, + ITestIdentifiers allTestsGuidsExceptTrusted, TestGuidsList dubiousTests, TestGuidsList failedTest) { @@ -166,7 +162,7 @@ private void CoverageForThisMutant(IMutant mutant, } private static (MutationTestingRequirements, TestGuidsList) ParseResultForThisMutant( - IReadOnlyDictionary> mutationToResultMap, int mutantId) + IReadOnlyDictionary> mutationToResultMap, int mutantId) { var resultingRequirements = MutationTestingRequirements.None; if (!mutationToResultMap.ContainsKey(mutantId)) @@ -174,7 +170,7 @@ private static (MutationTestingRequirements, TestGuidsList) ParseResultForThisMu return (resultingRequirements, TestGuidsList.NoTest()); } - var testGuids = new List(); + var testGuids = new List(); foreach (var coverageRunResult in mutationToResultMap[mutantId]) { testGuids.Add(coverageRunResult.TestId); diff --git a/src/Stryker.Core/Stryker.Core/CoverageAnalysis/ICoverageAnalyser.cs b/src/Stryker.Core/Stryker.Core/CoverageAnalysis/ICoverageAnalyser.cs index 586f6513d4..01156e936d 100644 --- a/src/Stryker.Core/Stryker.Core/CoverageAnalysis/ICoverageAnalyser.cs +++ b/src/Stryker.Core/Stryker.Core/CoverageAnalysis/ICoverageAnalyser.cs @@ -1,12 +1,10 @@ using System.Collections.Generic; -using Stryker.Abstractions.Initialisation; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.TestRunners; +using Stryker.Abstractions; +using Stryker.Abstractions.Testing; namespace Stryker.Core.CoverageAnalysis; public interface ICoverageAnalyser { - void DetermineTestCoverage(IProjectAndTests project, ITestRunner runner, IEnumerable mutants, ITestGuids resultFailingTests); + void DetermineTestCoverage(IProjectAndTests project, ITestRunner runner, IEnumerable mutants, ITestIdentifiers resultFailingTests); } diff --git a/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs b/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs index 1b3e0b8549..7a1e0fc5f3 100644 --- a/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs +++ b/src/Stryker.Core/Stryker.Core/DiffProviders/GitDiffProvider.cs @@ -4,19 +4,19 @@ using LibGit2Sharp; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Options; +using Stryker.Abstractions.Testing; using Stryker.Core.Baseline.Providers; -using Stryker.Core.Mutants; using Stryker.Utilities; namespace Stryker.Core.DiffProviders; public class GitDiffProvider : IDiffProvider { - public TestSet Tests { get; } + public ITestSet Tests { get; } private readonly IStrykerOptions _options; private readonly IGitInfoProvider _gitInfoProvider; - public GitDiffProvider(IStrykerOptions options, TestSet tests, IGitInfoProvider gitInfoProvider = null) + public GitDiffProvider(IStrykerOptions options, ITestSet tests, IGitInfoProvider gitInfoProvider = null) { Tests = tests; _options = options; diff --git a/src/Stryker.Core/Stryker.Core/DiffProviders/IDiffProvider.cs b/src/Stryker.Core/Stryker.Core/DiffProviders/IDiffProvider.cs index 4f5689ae86..c72a7f8528 100644 --- a/src/Stryker.Core/Stryker.Core/DiffProviders/IDiffProvider.cs +++ b/src/Stryker.Core/Stryker.Core/DiffProviders/IDiffProvider.cs @@ -1,4 +1,4 @@ -using Stryker.Core.Mutants; +using Stryker.Abstractions.Testing; namespace Stryker.Core.DiffProviders; @@ -6,5 +6,5 @@ public interface IDiffProvider { DiffResult ScanDiff(); - TestSet Tests { get; } + ITestSet Tests { get; } } diff --git a/src/Stryker.Core/Stryker.Core/Helpers/RoslynHelper.cs b/src/Stryker.Core/Stryker.Core/Helpers/RoslynHelper.cs index da554217a2..f6be696505 100644 --- a/src/Stryker.Core/Stryker.Core/Helpers/RoslynHelper.cs +++ b/src/Stryker.Core/Stryker.Core/Helpers/RoslynHelper.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; namespace Stryker.Core.Helpers; diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs b/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs index b75f18044c..12ecae0e5e 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/CsharpProjectComponentsBuilder.cs @@ -9,14 +9,13 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; -using Stryker.Abstractions; +using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; -using Stryker.Core.ProjectComponents.Csharp; +using Stryker.Core.MutantFilters; using Stryker.Core.ProjectComponents; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.SourceProjects; -using Stryker.Core.MutantFilters; -using Stryker.Abstractions.Options; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestProcess.cs b/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestProcess.cs index fa7f407ace..d9b0dc765b 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestProcess.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestProcess.cs @@ -1,10 +1,9 @@ using System.Diagnostics; using Microsoft.Extensions.Logging; using Stryker.Abstractions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; -using Stryker.Core.TestRunners; +using Stryker.Abstractions.Testing; namespace Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestRun.cs b/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestRun.cs index 4f6a72c3b7..29c575e556 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestRun.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/InitialTestRun.cs @@ -1,16 +1,16 @@ using Stryker.Abstractions; -using Stryker.Core.TestRunners; +using Stryker.Abstractions.Testing; namespace Stryker.Core.Initialisation; public class InitialTestRun { - public InitialTestRun(TestRunResult result, ITimeoutValueCalculator timeoutValueCalculator) + public InitialTestRun(ITestRunResult result, ITimeoutValueCalculator timeoutValueCalculator) { Result = result; TimeoutValueCalculator = timeoutValueCalculator; } - public TestRunResult Result { get; } + public ITestRunResult Result { get; } public ITimeoutValueCalculator TimeoutValueCalculator { get; } } diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs b/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs index 7a63c6a9f0..68810a1981 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/InitialisationProcess.cs @@ -6,10 +6,10 @@ using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Abstractions.Testing; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents.SourceProjects; -using Stryker.Core.TestRunners; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs b/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs index 15b9103668..56dcd37576 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/InputFileResolver.cs @@ -9,13 +9,14 @@ using Buildalyzer; using Buildalyzer.Environment; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; -using Stryker.Core.Initialisation.Buildalyzer; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; using Stryker.Core.Testing; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/ProjectMutator.cs b/src/Stryker.Core/Stryker.Core/Initialisation/ProjectMutator.cs index 86a1f59bb1..05a4b83bc7 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/ProjectMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/ProjectMutator.cs @@ -45,7 +45,7 @@ public IMutationTestProcess MutateProject(IStrykerOptions options, MutationTestI private void EnrichTestProjectsWithTestInfo(InitialTestRun initialTestRun, ITestProjectsInfo testProjectsInfo) { var unitTests = - initialTestRun.Result.VsTestDescriptions + initialTestRun.Result.TestDescriptions .Select(desc => desc.Case) // F# has a different syntax tree and would throw further down the line .Where(unitTest => Path.GetExtension(unitTest.CodeFilePath) == ".cs"); diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs b/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs index 3af57cff74..ccec571c6b 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs +++ b/src/Stryker.Core/Stryker.Core/Initialisation/ProjectOrchestrator.cs @@ -6,16 +6,15 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Mono.Cecil; -using Stryker.Abstractions; using Stryker.Abstractions.Baseline; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; using Stryker.Abstractions.Reporting; +using Stryker.Abstractions.Testing; using Stryker.Core.MutationTest; using Stryker.Core.ProjectComponents.SourceProjects; -using Stryker.Core.TestRunners; -using Stryker.Core.TestRunners.VsTest; +using Stryker.TestRunner.VsTest; namespace Stryker.Core.Initialisation; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/BaselineMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/BaselineMutantFilter.cs index 010940c43d..c2a36cf6c9 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/BaselineMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/BaselineMutantFilter.cs @@ -4,9 +4,9 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Baseline; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/BroadcastMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/BroadcastMutantFilter.cs index e81e9f0e5e..33843112f5 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/BroadcastMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/BroadcastMutantFilter.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeFromCodeCoverageFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeFromCodeCoverageFilter.cs index 8cf229d02c..1f6655ddcb 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeFromCodeCoverageFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeFromCodeCoverageFilter.cs @@ -3,7 +3,7 @@ using System.Text.RegularExpressions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeLinqExpressionFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeLinqExpressionFilter.cs index 76bab30854..001a2ad274 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeLinqExpressionFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeLinqExpressionFilter.cs @@ -5,8 +5,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeMutationMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeMutationMutantFilter.cs index cd37369b26..8ab9118b61 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeMutationMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/ExcludeMutationMutantFilter.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/FilePatternMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/FilePatternMutantFilter.cs index 2dbf6563d9..a141d53098 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/FilePatternMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/FilePatternMutantFilter.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/IMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/IMutantFilter.cs index ca2d11d0db..28619c1e92 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/IMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/IMutantFilter.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoreBlockMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoreBlockMutantFilter.cs index e8aa9a223f..0e61f1c05f 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoreBlockMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoreBlockMutantFilter.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; using Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoredMethodMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoredMethodMutantFilter.cs index 15772798c6..4b8c7796f2 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoredMethodMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/IgnoredMethodMutantFilter.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/MutantFilterFactory.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/MutantFilterFactory.cs index be7553a52f..65eecba26e 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/MutantFilterFactory.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/MutantFilterFactory.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions; using Stryker.Abstractions.Baseline; using Stryker.Abstractions.Options; using Stryker.Core.Baseline.Providers; diff --git a/src/Stryker.Core/Stryker.Core/MutantFilters/SinceMutantFilter.cs b/src/Stryker.Core/Stryker.Core/MutantFilters/SinceMutantFilter.cs index ca6a6e7910..f6e92c2fc8 100644 --- a/src/Stryker.Core/Stryker.Core/MutantFilters/SinceMutantFilter.cs +++ b/src/Stryker.Core/Stryker.Core/MutantFilters/SinceMutantFilter.cs @@ -3,19 +3,19 @@ using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; +using Stryker.Abstractions.Testing; using Stryker.Core.DiffProviders; -using Stryker.Core.Mutants; namespace Stryker.Core.MutantFilters; public class SinceMutantFilter : IMutantFilter { private readonly DiffResult _diffResult; - private readonly TestSet _tests; + private readonly ITestSet _tests; private readonly ILogger _logger; public MutantFilter Type => MutantFilter.Since; @@ -125,7 +125,7 @@ private IEnumerable ResetMutantStatusForChangedTests(IEnumerable _diffResult.ChangedTestFiles.Any(changedTestFile => coveringTest.TestFilePath == changedTestFile diff --git a/src/Stryker.Core/Stryker.Core/Mutants/BaseMutantOrchestrator.cs b/src/Stryker.Core/Stryker.Core/Mutants/BaseMutantOrchestrator.cs index 83670d8835..0501030816 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/BaseMutantOrchestrator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/BaseMutantOrchestrator.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Configuration; diff --git a/src/Stryker.Core/Stryker.Core/Mutants/CsharpMutantOrchestrator.cs b/src/Stryker.Core/Stryker.Core/Mutants/CsharpMutantOrchestrator.cs index 09b1932454..7de332adc0 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/CsharpMutantOrchestrator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/CsharpMutantOrchestrator.cs @@ -8,8 +8,6 @@ using Microsoft.Extensions.Logging; using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Core.Mutants.CsharpNodeOrchestrators; using Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/CommentParser.cs b/src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/CommentParser.cs index 3ede504565..573ba46d93 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/CommentParser.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/CsharpNodeOrchestrators/CommentParser.cs @@ -5,8 +5,8 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutators; using Stryker.Core.Mutants; namespace Stryker.Core.Mutants.CsharpNodeOrchestrators; diff --git a/src/Stryker.Core/Stryker.Core/Mutants/Mutant.cs b/src/Stryker.Core/Stryker.Core/Mutants/Mutant.cs index b82a81cabb..8fad55d73f 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/Mutant.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/Mutant.cs @@ -1,5 +1,6 @@ -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.TestRunners; +using Stryker.Abstractions; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Tests; namespace Stryker.Core.Mutants; @@ -14,11 +15,11 @@ public class Mutant : IMutant public MutantStatus ResultStatus { get; set; } - public ITestGuids CoveringTests { get; set; } = TestGuidsList.NoTest(); + public ITestIdentifiers CoveringTests { get; set; } = TestIdentifierList.NoTest(); - public ITestGuids KillingTests { get; set; } = TestGuidsList.NoTest(); + public ITestIdentifiers KillingTests { get; set; } = TestIdentifierList.NoTest(); - public ITestGuids AssessingTests { get; set; } = TestGuidsList.EveryTest(); + public ITestIdentifiers AssessingTests { get; set; } = TestIdentifierList.EveryTest(); public string ResultStatusReason { get; set; } @@ -30,7 +31,7 @@ public class Mutant : IMutant public string DisplayName => $"{Id}: {Mutation?.DisplayName}"; - public void AnalyzeTestRun(ITestGuids failedTests, ITestGuids resultRanTests, ITestGuids timedOutTests, bool sessionTimedOut) + public void AnalyzeTestRun(ITestIdentifiers failedTests, ITestIdentifiers resultRanTests, ITestIdentifiers timedOutTests, bool sessionTimedOut) { if (AssessingTests.ContainsAny(failedTests)) { diff --git a/src/Stryker.Core/Stryker.Core/Mutants/MutationContext.cs b/src/Stryker.Core/Stryker.Core/Mutants/MutationContext.cs index e19e50425f..48ca82cd87 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/MutationContext.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/MutationContext.cs @@ -2,7 +2,7 @@ using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs b/src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs index ca761024b5..7a0d8380b3 100644 --- a/src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs +++ b/src/Stryker.Core/Stryker.Core/Mutants/MutationStore.cs @@ -4,8 +4,8 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Core.Helpers; namespace Stryker.Core.Mutants; diff --git a/src/Stryker.Core/Stryker.Core/Mutants/TestGuidsList.cs b/src/Stryker.Core/Stryker.Core/Mutants/TestGuidsList.cs deleted file mode 100644 index 4d4588da56..0000000000 --- a/src/Stryker.Core/Stryker.Core/Mutants/TestGuidsList.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Stryker.Abstractions.TestRunners; - -namespace Stryker.Core.Mutants; - -public class TestGuidsList : ITestGuids -{ - private readonly HashSet _testGuids; - - private static readonly TestGuidsList EveryTests = new(); - private static readonly TestGuidsList NoTestAtAll = new(Array.Empty()); - - private TestGuidsList() => _testGuids = null; - - public TestGuidsList(IEnumerable testDescriptions) : this(testDescriptions?.Select(t => t.Id)) - { } - - public TestGuidsList(HashSet set) => _testGuids = set; - - public TestGuidsList(IEnumerable guids) => _testGuids = guids != null ? new HashSet(guids) : null; - - public TestGuidsList(params Guid[] guids) : this((IEnumerable)guids) - { } - - public bool IsEmpty => _testGuids is { Count: 0 }; - - public bool IsEveryTest => _testGuids == null; - - public int Count => _testGuids?.Count ?? 0; - - public ITestGuids Merge(ITestGuids other) - { - if (IsEveryTest) - { - return this; - } - - var result = new HashSet(_testGuids); - result.UnionWith(other.GetGuids()); - return new TestGuidsList(result); - } - - public TestGuidsList Merge(TestGuidsList other) - { - if (IsEveryTest) - { - return this; - } - - var result = new HashSet(_testGuids); - result.UnionWith(other.GetGuids()); - return new TestGuidsList(result); - } - - public bool Contains(Guid testId) => IsEveryTest || _testGuids.Contains(testId); - - public bool IsIncludedIn(ITestGuids other) => other.IsEveryTest || _testGuids?.IsSubsetOf(other.GetGuids()) == true; - - public TestGuidsList Excluding(TestGuidsList testsToSkip) - { - if (IsEmpty || testsToSkip.IsEmpty) - { - return this; - } - - if (IsEveryTest) - { - throw new InvalidOperationException("Can't exclude from EveryTest"); - } - - return testsToSkip.IsEveryTest ? NoTest() : new TestGuidsList(_testGuids.Except(testsToSkip._testGuids)); - } - - public static TestGuidsList EveryTest() => EveryTests; - - public static TestGuidsList NoTest() => NoTestAtAll; - - public IEnumerable GetGuids() => _testGuids ?? []; - - public bool ContainsAny(ITestGuids other) - { - if (other.IsEmpty || IsEmpty) - { - return false; - } - if (IsEveryTest || other.IsEveryTest) - { - return true; - } - return _testGuids.Overlaps(other.GetGuids()); - } - - public ITestGuids Intersect(ITestGuids other) => IsEveryTest ? new TestGuidsList(other.GetGuids()) : new TestGuidsList(_testGuids.Intersect(other.GetGuids())); -} diff --git a/src/Stryker.Core/Stryker.Core/Mutants/TestSet.cs b/src/Stryker.Core/Stryker.Core/Mutants/TestSet.cs deleted file mode 100644 index 46e45a59b6..0000000000 --- a/src/Stryker.Core/Stryker.Core/Mutants/TestSet.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Stryker.Core.Mutants; - -public class TestSet -{ - private readonly IDictionary _tests = new Dictionary(); - public int Count => _tests.Count; - public TestDescription this[Guid guid] => _tests[guid]; - - public void RegisterTests(IEnumerable tests) - { - foreach (var test in tests) - { - RegisterTest(test); - } - } - - public void RegisterTest(TestDescription test) => _tests[test.Id] = test; - - public IEnumerable Extract(IEnumerable ids) => ids?.Select(i => _tests[i]) ?? Enumerable.Empty(); -} diff --git a/src/Stryker.Core/Stryker.Core/Mutants/WrappedGuidsEnumeration.cs b/src/Stryker.Core/Stryker.Core/Mutants/WrappedGuidsEnumeration.cs deleted file mode 100644 index 1911b7a797..0000000000 --- a/src/Stryker.Core/Stryker.Core/Mutants/WrappedGuidsEnumeration.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.TestRunners; - -namespace Stryker.Core.Mutants; - -public class WrappedGuidsEnumeration : ITestGuids -{ - private readonly IEnumerable _guids; - - public ICollection Tests => throw new NotImplementedException(); - - public int Count => _guids.Count(); - - public bool IsEmpty => _guids == null || !_guids.Any(); - - public bool IsEveryTest => false; - - public ITestGuids Merge(ITestGuids other) => MergeList(this, other); - - public bool Contains(Guid testId) => _guids.Any(g => g == testId); - - public bool ContainsAny(ITestGuids other) => _guids.Any(other.Contains); - - public bool IsIncludedIn(ITestGuids other) => _guids.All(other.Contains); - - public WrappedGuidsEnumeration(IEnumerable guids) => _guids = guids; - - public ITestGuids Excluding(ISet testsToSkip) => IsEveryTest || IsEmpty ? this : new TestGuidsList(_guids.Except(testsToSkip)); - - public static ITestGuids MergeList(ITestGuids a, ITestGuids b) - { - if (a.GetGuids() == null) - { - return b; - } - - return b.GetGuids() == null ? a : new WrappedGuidsEnumeration(a.GetGuids().Union(b.GetGuids())); - } - - public IEnumerable GetGuids() => _guids; - - public ITestGuids Intersect(ITestGuids other) => IsEveryTest ? new WrappedGuidsEnumeration(other.GetGuids()) : new WrappedGuidsEnumeration(_guids.Intersect(other.GetGuids())); -} diff --git a/src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs b/src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs index bf20e7dbc5..0e5b98ef23 100644 --- a/src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs +++ b/src/Stryker.Core/Stryker.Core/MutationTest/CsharpMutationProcess.cs @@ -4,16 +4,16 @@ using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; -using Stryker.Core.ProjectComponents.Csharp; +using Stryker.Abstractions.Options; +using Stryker.Core.Compiling; using Stryker.Core.MutantFilters; using Stryker.Core.Mutants; using Stryker.Core.ProjectComponents; -using Stryker.Core.Initialisation.Buildalyzer; -using Stryker.Core.Compiling; +using Stryker.Core.ProjectComponents.Csharp; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Abstractions.Options; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.MutationTest; diff --git a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestExecutor.cs b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestExecutor.cs index 58aca2659d..54ded7e4c8 100644 --- a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestExecutor.cs +++ b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestExecutor.cs @@ -3,11 +3,10 @@ using System.Linq; using Microsoft.Extensions.Logging; using Stryker.Abstractions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; -using Stryker.Core.Mutants; -using Stryker.Core.TestRunners; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Results; +using static Stryker.Abstractions.Testing.ITestRunner; namespace Stryker.Core.MutationTest; @@ -90,7 +89,7 @@ public void Test(IProjectAndTests project, IList mutantsToTest, ITimeou } } - private TestRunResult RunTestSession(IProjectAndTests projectAndTests, ICollection mutantsToTest, + private ITestRunResult RunTestSession(IProjectAndTests projectAndTests, ICollection mutantsToTest, ITimeoutValueCalculator timeoutMs, TestUpdateHandler updateHandler, bool forceSingle) { diff --git a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestInput.cs b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestInput.cs index 0e99c30f93..b6edc2cf66 100644 --- a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestInput.cs +++ b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestInput.cs @@ -1,8 +1,8 @@ using Stryker.Abstractions.ProjectComponents; +using Stryker.Abstractions.Testing; using Stryker.Core.Initialisation; using Stryker.Core.ProjectComponents.SourceProjects; using Stryker.Core.ProjectComponents.TestProjects; -using Stryker.Core.TestRunners; namespace Stryker.Core.MutationTest; diff --git a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs index a789580dc5..89b636478a 100644 --- a/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs +++ b/src/Stryker.Core/Stryker.Core/MutationTest/MutationTestProcess.cs @@ -3,17 +3,16 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; -using Stryker.Abstractions.TestRunners; +using Stryker.Abstractions.Testing; using Stryker.Core.CoverageAnalysis; -using Stryker.Core.Initialisation; -using Stryker.Core.Initialisation.Buildalyzer; -using Stryker.Core.Mutants; +using Stryker.TestRunner.Tests; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.MutationTest; @@ -72,13 +71,12 @@ public MutationTestProcess(MutationTestInput input, private IMutationProcess BuildMutationProcess() { - if (!LanguageMap.ContainsKey(Input.SourceProjectInfo.AnalyzerResult.GetLanguage())) + if (LanguageMap.ContainsKey(Input.SourceProjectInfo.AnalyzerResult.GetLanguage())) { - throw new GeneralStrykerException( - "no valid language detected || no valid csproj or fsproj was given."); + return LanguageMap[Input.SourceProjectInfo.AnalyzerResult.GetLanguage()](_options); } - return LanguageMap[Input.SourceProjectInfo.AnalyzerResult.GetLanguage()](_options); + throw new GeneralStrykerException("no valid language detected || no valid csproj or fsproj was given."); } public void Mutate() @@ -122,17 +120,17 @@ private void TestMutants(IEnumerable mutantsToTest) }); } - private bool TestUpdateHandler(IEnumerable testedMutants, ITestGuids failedTests, ITestGuids ranTests, - ITestGuids timedOutTest, ISet reportedMutants) + private bool TestUpdateHandler(IEnumerable testedMutants, ITestIdentifiers failedTests, ITestIdentifiers ranTests, + ITestIdentifiers timedOutTest, ISet reportedMutants) { - var testsFailingInitially = Input.InitialTestRun.Result.FailingTests.GetGuids().ToHashSet(); + var testsFailingInitially = Input.InitialTestRun.Result.FailingTests.GetIdentifiers().ToHashSet(); var continueTestRun = _options.OptimizationMode.HasFlag(OptimizationModes.DisableBail); - if (testsFailingInitially.Count > 0 && failedTests.GetGuids().Any(testsFailingInitially.Contains)) + if (testsFailingInitially.Count > 0 && failedTests.GetIdentifiers().Any(id => testsFailingInitially.Contains(id))) { // some of the failing tests where failing without any mutation // we discard those tests failedTests = new TestGuidsList( - failedTests.GetGuids().Where(t => !testsFailingInitially.Contains(t))); + failedTests.GetIdentifiers().Where(t => !testsFailingInitially.Contains(t))); } foreach (var mutant in testedMutants) diff --git a/src/Stryker.Core/Stryker.Core/Mutators/ArrayCreationMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/ArrayCreationMutator.cs index ed601be0d3..c898a00de1 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/ArrayCreationMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/ArrayCreationMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/AssignmentStatementMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/AssignmentStatementMutator.cs index 9284663dec..1171e83b69 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/AssignmentStatementMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/AssignmentStatementMutator.cs @@ -2,8 +2,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Helpers; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/BinaryExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/BinaryExpressionMutator.cs index cb5c74c36a..215d361b04 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/BinaryExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/BinaryExpressionMutator.cs @@ -2,8 +2,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Helpers; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/BlockMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/BlockMutator.cs index 9e9c7055c1..5264ad7c75 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/BlockMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/BlockMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using Stryker.Core.Helpers; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/BooleanMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/BooleanMutator.cs index 364a9a0f81..1ebcf29207 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/BooleanMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/BooleanMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/CheckedMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/CheckedMutator.cs index f9fdd31640..bfef0c4608 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/CheckedMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/CheckedMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/CollectionExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/CollectionExpressionMutator.cs index d39b44bba9..c9452db57c 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/CollectionExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/CollectionExpressionMutator.cs @@ -2,8 +2,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/ConditionalExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/ConditionalExpressionMutator.cs index 105776c3f1..ce7c1a08da 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/ConditionalExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/ConditionalExpressionMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/InitializerMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/InitializerMutator.cs index 9e7f95976f..ba47b869ba 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/InitializerMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/InitializerMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/InterpolatedStringMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/InterpolatedStringMutator.cs index 57fa2ba35f..f8e82e8a31 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/InterpolatedStringMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/InterpolatedStringMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/IsPatternExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/IsPatternExpressionMutator.cs index 2d20260f55..1b50963c1e 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/IsPatternExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/IsPatternExpressionMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/LinqMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/LinqMutator.cs index 886a500d70..5812320e12 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/LinqMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/LinqMutator.cs @@ -2,8 +2,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using System; using System.Collections.Generic; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/MathMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/MathMutator.cs index 81ba3ace4d..f0792d7287 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/MathMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/MathMutator.cs @@ -4,8 +4,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/MutatorBase.cs b/src/Stryker.Core/Stryker.Core/Mutators/MutatorBase.cs index c38841dece..a03dcd681d 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/MutatorBase.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/MutatorBase.cs @@ -2,8 +2,7 @@ using System.Linq; using Microsoft.CodeAnalysis; using Stryker.Abstractions.Options; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/NegateConditionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/NegateConditionMutator.cs index ed3c486e2d..c50b733128 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/NegateConditionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/NegateConditionMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/NullCoalescingExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/NullCoalescingExpressionMutator.cs index afc2d4944c..bc196cd725 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/NullCoalescingExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/NullCoalescingExpressionMutator.cs @@ -1,9 +1,8 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; using System.Collections.Generic; using Microsoft.CodeAnalysis; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/ObjectCreationMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/ObjectCreationMutator.cs index bdb7dbd907..e18957d8ea 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/ObjectCreationMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/ObjectCreationMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/PatternMutatorBase.cs b/src/Stryker.Core/Stryker.Core/Mutators/PatternMutatorBase.cs index f5479d4454..6cd84e90f2 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/PatternMutatorBase.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/PatternMutatorBase.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/PostfixUnaryMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/PostfixUnaryMutator.cs index ce9d650f6b..040cbfdf9e 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/PostfixUnaryMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/PostfixUnaryMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/PrefixUnaryMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/PrefixUnaryMutator.cs index a5b72387bb..17e38b0beb 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/PrefixUnaryMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/PrefixUnaryMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System.Collections.Generic; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/RegexMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/RegexMutator.cs index 3e33c8feb0..7fc029975c 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/RegexMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/RegexMutator.cs @@ -2,9 +2,8 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; using Stryker.RegexMutators; using System; using System.Collections.Generic; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/StatementMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/StatementMutator.cs index c9d6de0060..01d2642cff 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/StatementMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/StatementMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/StringEmptyMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/StringEmptyMutator.cs index 14f207a229..da2aff06ef 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/StringEmptyMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/StringEmptyMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/StringMethodMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/StringMethodMutator.cs index 99367a7806..0e60480f40 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/StringMethodMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/StringMethodMutator.cs @@ -3,8 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/StringMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/StringMutator.cs index 95512fe420..2237664649 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/StringMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/StringMutator.cs @@ -1,8 +1,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.Mutators; +using Stryker.Abstractions; using System; using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/src/Stryker.Core/Stryker.Core/Mutators/SwitchExpressionMutator.cs b/src/Stryker.Core/Stryker.Core/Mutators/SwitchExpressionMutator.cs index 904ac83382..934a164ba3 100644 --- a/src/Stryker.Core/Stryker.Core/Mutators/SwitchExpressionMutator.cs +++ b/src/Stryker.Core/Stryker.Core/Mutators/SwitchExpressionMutator.cs @@ -2,7 +2,7 @@ using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; namespace Stryker.Core.Mutators; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/Csharp/CsharpFileLeaf.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/Csharp/CsharpFileLeaf.cs index 7c289ee23f..55e85d8a0a 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/Csharp/CsharpFileLeaf.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/Csharp/CsharpFileLeaf.cs @@ -1,5 +1,5 @@ using Microsoft.CodeAnalysis; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; using System.Collections.Generic; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/FolderComposite.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/FolderComposite.cs index 29bc773ec7..937a9ecb8d 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/FolderComposite.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/FolderComposite.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; namespace Stryker.Core.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/ProjectComponent.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/ProjectComponent.cs index 6aadc93904..8d40068545 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/ProjectComponent.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/ProjectComponent.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/Solution.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/Solution.cs index 1ae22f2c4d..4ca79d357d 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/Solution.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/Solution.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; namespace Stryker.Core.ProjectComponents; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/SourceProjects/SourceProjectInfo.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/SourceProjects/SourceProjectInfo.cs index c975a25b1c..fe4cb6f807 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/SourceProjects/SourceProjectInfo.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/SourceProjects/SourceProjectInfo.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; using Buildalyzer; -using Stryker.Abstractions.Initialisation; +using Stryker.Abstractions; using Stryker.Abstractions.ProjectComponents; -using Stryker.Core.Initialisation.Buildalyzer; using Stryker.Core.InjectedHelpers; -using Stryker.Core.ProjectComponents.TestProjects; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.ProjectComponents.SourceProjects; diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestCase.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestCase.cs index e58115bc1f..44f4653c0b 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestCase.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestCase.cs @@ -6,7 +6,7 @@ namespace Stryker.Core.ProjectComponents.TestProjects; public sealed class TestCase : IEquatable, ITestCase { - public Guid Id { get; init; } + public Abstractions.Testing.Identifier Id { get; init; } public string Name { get; init; } public SyntaxNode Node { get; init; } diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestFile.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestFile.cs index b75675c265..9643634830 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestFile.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestFile.cs @@ -13,7 +13,7 @@ public sealed class TestFile : IEquatable, ITestFile public string Source { get; init; } public IList Tests { get; private set; } = new List(); - public void AddTest(Guid id, string name, SyntaxNode node) + public void AddTest(Abstractions.Testing.Identifier id, string name, SyntaxNode node) { if (Tests.Any(test => test.Id == id)) { diff --git a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestProjectsInfo.cs b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestProjectsInfo.cs index e986deb040..007133f87a 100644 --- a/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestProjectsInfo.cs +++ b/src/Stryker.Core/Stryker.Core/ProjectComponents/TestProjects/TestProjectsInfo.cs @@ -6,7 +6,7 @@ using Microsoft.Extensions.Logging; using Stryker.Abstractions.Logging; using Stryker.Abstractions.ProjectComponents; -using Stryker.Core.Initialisation.Buildalyzer; +using Stryker.Utilities.Buildalyzer; namespace Stryker.Core.ProjectComponents.TestProjects; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/ClearTextReporter.cs b/src/Stryker.Core/Stryker.Core/Reporters/ClearTextReporter.cs index 1f541a9d39..e07d72fef7 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/ClearTextReporter.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/ClearTextReporter.cs @@ -3,7 +3,6 @@ using Spectre.Console; using Spectre.Console.Rendering; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/ClearTextTreeReporter.cs b/src/Stryker.Core/Stryker.Core/Reporters/ClearTextTreeReporter.cs index f9a10f7e84..fa85e1d5bb 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/ClearTextTreeReporter.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/ClearTextTreeReporter.cs @@ -4,7 +4,6 @@ using System.Text; using Spectre.Console; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/ConsoleDotProgressReporter.cs b/src/Stryker.Core/Stryker.Core/Reporters/ConsoleDotProgressReporter.cs index 9180392623..29871c5be9 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/ConsoleDotProgressReporter.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/ConsoleDotProgressReporter.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using Spectre.Console; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/FilteredMutantsLogger.cs b/src/Stryker.Core/Stryker.Core/Reporters/FilteredMutantsLogger.cs index 0f90318a10..eb43a8747f 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/FilteredMutantsLogger.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/FilteredMutantsLogger.cs @@ -1,7 +1,7 @@ using System.Linq; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.ProjectComponents; namespace Stryker.Core.Reporters; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/Html/RealTime/IRealTimeMutantHandler.cs b/src/Stryker.Core/Stryker.Core/Reporters/Html/RealTime/IRealTimeMutantHandler.cs index 613f92c330..9de45124f8 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/Html/RealTime/IRealTimeMutantHandler.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/Html/RealTime/IRealTimeMutantHandler.cs @@ -1,5 +1,4 @@ -using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; +using Stryker.Abstractions; namespace Stryker.Core.Reporters.Html.RealTime; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/Json/SourceFiles/JsonMutant.cs b/src/Stryker.Core/Stryker.Core/Reporters/Json/SourceFiles/JsonMutant.cs index fb6b90cbbe..afcecc7e16 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/Json/SourceFiles/JsonMutant.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/Json/SourceFiles/JsonMutant.cs @@ -43,8 +43,8 @@ public JsonMutant(IReadOnlyMutant mutant) Static = mutant.IsStaticValue; - CoveredBy = mutant.CoveringTests.GetGuids()?.Select(g => g.ToString()); - KilledBy = mutant.KillingTests.GetGuids()?.Select(g => g.ToString()); + CoveredBy = mutant.CoveringTests.GetIdentifiers()?.Select(g => g.ToString()); + KilledBy = mutant.KillingTests.GetIdentifiers()?.Select(g => g.ToString()); } } diff --git a/src/Stryker.Core/Stryker.Core/Reporters/MarkdownSummaryReporter.cs b/src/Stryker.Core/Stryker.Core/Reporters/MarkdownSummaryReporter.cs index d382a29830..d669d03f88 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/MarkdownSummaryReporter.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/MarkdownSummaryReporter.cs @@ -6,7 +6,6 @@ using Grynwald.MarkdownGenerator; using Spectre.Console; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Abstractions.Reporting; diff --git a/src/Stryker.Core/Stryker.Core/Reporters/Progress/ProgressBarReporter.cs b/src/Stryker.Core/Stryker.Core/Reporters/Progress/ProgressBarReporter.cs index 7c71693936..e447f29129 100644 --- a/src/Stryker.Core/Stryker.Core/Reporters/Progress/ProgressBarReporter.cs +++ b/src/Stryker.Core/Stryker.Core/Reporters/Progress/ProgressBarReporter.cs @@ -1,7 +1,6 @@ using System; using Spectre.Console; using Stryker.Abstractions; -using Stryker.Abstractions.Mutants; namespace Stryker.Core.Reporters.Progress; diff --git a/src/Stryker.Core/Stryker.Core/Stryker.Core.csproj b/src/Stryker.Core/Stryker.Core/Stryker.Core.csproj index 514770224b..db7796f439 100644 --- a/src/Stryker.Core/Stryker.Core/Stryker.Core.csproj +++ b/src/Stryker.Core/Stryker.Core/Stryker.Core.csproj @@ -1,5 +1,4 @@ - Full Stryker.Core @@ -32,11 +31,11 @@ - + @@ -44,14 +43,17 @@ + + + + - @@ -98,5 +100,7 @@ + + diff --git a/src/Stryker.Core/Stryker.Core/StrykerRunner.cs b/src/Stryker.Core/Stryker.Core/StrykerRunner.cs index 0a17f8fd0e..9b63ff16fe 100644 --- a/src/Stryker.Core/Stryker.Core/StrykerRunner.cs +++ b/src/Stryker.Core/Stryker.Core/StrykerRunner.cs @@ -5,9 +5,9 @@ using System.Diagnostics; using System.Linq; using Microsoft.Extensions.Logging; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Core.Initialisation; @@ -196,4 +196,17 @@ private IReadOnlyProjectComponent AddRootFolderIfMultiProject(IEnumerable _mutationFlags = new(); - - public Guid TestId { get; } - - public IReadOnlyCollection MutationsCovered => _mutationFlags.Keys; - - public MutationTestingRequirements this[int mutation] => _mutationFlags.ContainsKey(mutation) - ? _mutationFlags[mutation] - : MutationTestingRequirements.NotCovered; - - public CoverageConfidence Confidence { get; private set; } - - public CoverageRunResult(Guid testId, CoverageConfidence confidence, IEnumerable coveredMutations, - IEnumerable detectedStaticMutations, IEnumerable leakedMutations) - { - TestId = testId; - foreach (var coveredMutation in coveredMutations) - { - _mutationFlags[coveredMutation] = MutationTestingRequirements.None; - } - - foreach (var detectedStaticMutation in detectedStaticMutations) - { - _mutationFlags[detectedStaticMutation] = MutationTestingRequirements.Static; - } - - foreach (var leakedMutation in leakedMutations) - { - _mutationFlags[leakedMutation] = confidence == CoverageConfidence.Exact ? MutationTestingRequirements.NeedEarlyActivation : MutationTestingRequirements.CoveredOutsideTest; - } - - Confidence = confidence; - } - - public void Merge(CoverageRunResult coverageRunResult) - { - Confidence = (CoverageConfidence)Math.Min((int)Confidence, (int)coverageRunResult.Confidence); - foreach (var mutationFlag in coverageRunResult._mutationFlags) - { - if (_mutationFlags.ContainsKey(mutationFlag.Key)) - { - _mutationFlags[mutationFlag.Key] |= mutationFlag.Value; - } - else - { - _mutationFlags[mutationFlag.Key] = mutationFlag.Value; - } - } - } -} +//using System; +//using System.Collections.Generic; +//using Stryker.Abstractions.Testing; + +//namespace Stryker.Core.TestRunners; + +//public class MsTestCoverageRunResult : ICoverageRunResult +//{ +// public Dictionary MutationFlags { get; } = new(); + +// public Identifier TestId { get; } + +// public IReadOnlyCollection MutationsCovered => MutationFlags.Keys; + +// public MutationTestingRequirements this[int mutation] => MutationFlags.ContainsKey(mutation) +// ? MutationFlags[mutation] +// : MutationTestingRequirements.NotCovered; + +// public CoverageConfidence Confidence { get; private set; } + +// public MsTestCoverageRunResult(Identifier testId, CoverageConfidence confidence, IEnumerable coveredMutations, +// IEnumerable detectedStaticMutations, IEnumerable leakedMutations) +// { +// TestId = testId; +// foreach (var coveredMutation in coveredMutations) +// { +// MutationFlags[coveredMutation] = MutationTestingRequirements.None; +// } + +// foreach (var detectedStaticMutation in detectedStaticMutations) +// { +// MutationFlags[detectedStaticMutation] = MutationTestingRequirements.Static; +// } + +// foreach (var leakedMutation in leakedMutations) +// { +// MutationFlags[leakedMutation] = confidence == CoverageConfidence.Exact ? MutationTestingRequirements.NeedEarlyActivation : MutationTestingRequirements.CoveredOutsideTest; +// } + +// Confidence = confidence; +// } + +// public void Merge(ICoverageRunResult coverageRunResult) +// { +// Confidence = (CoverageConfidence)Math.Min((int)Confidence, (int)coverageRunResult.Confidence); +// foreach (var mutationFlag in coverageRunResult.MutationFlags) +// { +// if (MutationFlags.ContainsKey(mutationFlag.Key)) +// { +// MutationFlags[mutationFlag.Key] |= mutationFlag.Value; +// } +// else +// { +// MutationFlags[mutationFlag.Key] = mutationFlag.Value; +// } +// } +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunResult.cs b/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunResult.cs deleted file mode 100644 index abb86bbf92..0000000000 --- a/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunResult.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.TestRunners.VsTest; - -namespace Stryker.Core.TestRunners; - -public interface ITestRunResult -{ - TimeSpan Duration { get; } - ITestGuids ExecutedTests { get; } - ITestGuids FailingTests { get; } - IEnumerable Messages { get; } - string ResultMessage { get; } - bool SessionTimedOut { get; } - ITestGuids TimedOutTests { get; } - IEnumerable VsTestDescriptions { get; } -} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunner.cs b/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunner.cs deleted file mode 100644 index 4ec9eebcc9..0000000000 --- a/src/Stryker.Core/Stryker.Core/TestRunners/ITestRunner.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using Stryker.Abstractions; -using Stryker.Abstractions.Initialisation; -using Stryker.Abstractions.Mutants; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.Mutants; - -namespace Stryker.Core.TestRunners; - -public delegate bool TestUpdateHandler(IReadOnlyList testedMutants, - ITestGuids failedTests, - ITestGuids ranTests, - ITestGuids timedOutTests); - -public interface ITestRunner : IDisposable -{ - bool DiscoverTests(string assembly); - - TestSet GetTests(IProjectAndTests project); - - TestRunResult InitialTest(IProjectAndTests project); - - IEnumerable CaptureCoverage(IProjectAndTests project); - - TestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, TestUpdateHandler update); -} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/CoverageLifecycleCallbacks.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/CoverageLifecycleCallbacks.cs new file mode 100644 index 0000000000..73082710e2 --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/CoverageLifecycleCallbacks.cs @@ -0,0 +1,93 @@ +//using System; +//using System.Linq; +//using System.Reflection; +//using System.Threading; +//using System.Threading.Tasks; +//using Microsoft.Testing.Platform.Extensions.TestHost; +//using Stryker.Core.TestRunners.MsTest.Setup; +//using Stryker.Core.TestRunners.MSTest.Setup; +//using Stryker.TestRunner.Tests; + +//namespace Stryker.TestRunner.LifecycleCallbacks; + +//public class CoverageLifecycleCallbacks : ITestApplicationLifecycleCallbacks +//{ +// private readonly string _assemblyPath; +// private readonly CoverageCollector _coverageCollector; + +// private CoverageLifecycleCallbacks(string assemblyPath, CoverageCollector coverageCollector) +// { +// _assemblyPath = assemblyPath; +// _coverageCollector = coverageCollector; +// } + +// public static CoverageLifecycleCallbacks Create(string assemblyPath, CoverageCollector coverageCollector) => +// new(assemblyPath, coverageCollector); + +// public string Uid => nameof(CoverageLifecycleCallbacks); + +// public string Version => "1.0.0"; + +// public string DisplayName => $"Stryker.{Uid}"; + +// public string Description => "Setup and cleanup for coverage run"; + +// public Task BeforeRunAsync(CancellationToken cancellationToken) +// { +// var projects = DirectoryScanner.FindProjects(_assemblyPath); + +// // In case the assembly has not loaded yet. +// AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoaded; + +// // Scan through assemblies containing the name of the .csproj files. +// var loadedProjects = AppDomain.CurrentDomain +// .GetAssemblies() +// .Where(assembly => projects.Contains(assembly.GetName().Name)) +// .Where(assembly => !assembly.Location.EndsWith($"{AssemblyCopy.CopySuffix}.dll")) +// .Where(assembly => assembly.Location != _assemblyPath); + +// foreach (var project in loadedProjects) +// { +// InitializeCoverageCollector(project); +// } + +// return Task.CompletedTask; +// } + + +// public Task AfterRunAsync(int exitCode, CancellationToken cancellation) +// { +// // Disables capturing coverage +// _coverageCollector.SetCoverage(false); +// return Task.CompletedTask; +// } + +// public Task IsEnabledAsync() => Task.FromResult(true); + +// private void OnAssemblyLoaded(object sender, AssemblyLoadEventArgs args) +// { +// var assembly = args.LoadedAssembly; +// InitializeCoverageCollector(assembly); +// } + +// private void InitializeCoverageCollector(Assembly assembly) +// { +// var mutantControlType = assembly.DefinedTypes?.FirstOrDefault(t => t.FullName == _coverageCollector.MutantControlClassName); + +// if (mutantControlType is null) +// { +// return; +// } + +// // Sets active mutation to None +// var activeMutantField = mutantControlType.GetField("ActiveMutant"); +// activeMutantField?.SetValue(null, -1); + +// // Sets capture coverage to true +// _coverageCollector.CaptureCoverageField = mutantControlType.GetField("CaptureCoverage"); +// _coverageCollector.SetCoverage(true); + +// // Method to receive coverage +// _coverageCollector.GetCoverageDataMethod = mutantControlType.GetMethod("GetCoverageData")!; +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/MutantControlLifecycleCallbacks.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/MutantControlLifecycleCallbacks.cs new file mode 100644 index 0000000000..5e3798d82b --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/LifecycleCallbacks/MutantControlLifecycleCallbacks.cs @@ -0,0 +1,78 @@ +//using System; +//using System.Linq; +//using System.Reflection; +//using System.Threading; +//using System.Threading.Tasks; +//using Microsoft.Testing.Platform.Extensions.TestHost; +//using Stryker.Core.TestRunners.MsTest.Setup; +//using Stryker.Core.TestRunners.MSTest.Setup; +//using Stryker.TestRunner.Tests; + +//namespace Stryker.TestRunner.LifecycleCallbacks; + +//internal class MutantControlLifecycleCallbacks : ITestApplicationLifecycleCallbacks +//{ +// private readonly string _assemblyPath; +// private readonly MutantController _mutantController; + +// private MutantControlLifecycleCallbacks(string assemblyPath, MutantController mutantController) +// { +// _assemblyPath = assemblyPath; +// _mutantController = mutantController; +// } + +// public static MutantControlLifecycleCallbacks Create(string assemblyPath, MutantController mutantController) => +// new(assemblyPath, mutantController); + +// public string Uid => nameof(MutantControlLifecycleCallbacks); + +// public string Version => "1.0.0"; + +// public string DisplayName => $"Stryker.{Uid}"; + +// public string Description => "Setup and cleanup for mutation test run."; + +// public Task BeforeRunAsync(CancellationToken cancellationToken) +// { +// if (_mutantController.IsAsyncRunField is not null) +// { +// return Task.CompletedTask; +// } + +// var projects = DirectoryScanner.FindProjects(_assemblyPath); + +// // Scan through assemblies containing the name of the .csproj files. +// var loadedProjects = AppDomain.CurrentDomain +// .GetAssemblies() +// .Where(assembly => projects.Contains(assembly.GetName().Name)) +// .Where(assembly => !assembly.Location.EndsWith($"{AssemblyCopy.CopySuffix}.dll")) +// .Where(assembly => assembly.Location != _assemblyPath); + +// foreach (var project in loadedProjects) +// { +// InitializeMutantController(project); +// } + +// return Task.FromResult(true); +// } + +// public Task AfterRunAsync(int exitCode, CancellationToken cancellation) => Task.CompletedTask; + +// public Task IsEnabledAsync() => Task.FromResult(true); + +// private void InitializeMutantController(Assembly assembly) +// { +// var mutantControlType = assembly.DefinedTypes?.FirstOrDefault(t => t.FullName == _mutantController.MutantControlClassName); + +// if (mutantControlType is null) +// { +// return; +// } + +// _mutantController.IsAsyncRunField = mutantControlType.GetField("IsAsyncRun"); +// _mutantController.SetAsync(true); + +// _mutantController.InitAsyncRunMethod = mutantControlType.GetMethod("InitAsyncRun"); +// _mutantController.InitAsyncRun(); +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestProject.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestProject.cs new file mode 100644 index 0000000000..ffb4b94139 --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestProject.cs @@ -0,0 +1,79 @@ +//using System; +//using System.Collections.Generic; +//using System.Reflection; +//using System.Threading.Tasks; +//using Microsoft.Testing.Platform.Builder; +//using Microsoft.Testing.Platform.Extensions.Messages; +//using Stryker.TestRunner.Consumers; +//using Stryker.TestRunner.Options; +//using Stryker.TestRunner.Results; +//using Stryker.TestRunner.Tests; + +//namespace Stryker.TestRunner.TestProjects; + +//internal class MsTestProject : ITestProject +//{ +// public const string EntryPoint = "MSTest"; +// public const string ExecutorPath = "executor://mstestadapter"; + +// private readonly Assembly _assembly; + +// private MsTestProject(Assembly assembly) +// { +// _assembly = assembly; +// } + +// public static MsTestProject Create(Assembly assembly) => new(assembly); + +// public async Task Discover(DiscoveryResult discoveryResult, List executed, string assemblyPath) +// { +// var builder = await TestApplication.CreateBuilderAsync([RunOptions.DiscoverySettings, RunOptions.NoBanner, RunOptions.NoConsole]); +// builder.AddMSTest(() => [_assembly]); +// builder.TestHost.AddDataConsumer(_ => DiscoveryConsumer.Create(assemblyPath, new Uri(ExecutorPath), discoveryResult, executed)); +// using var app = await builder.BuildAsync(); +// return await app.RunAsync(); +// } + +// public async Task InitialTestRun(DiscoveryResult discoveryResult, List executed) +// { +// var builder = await TestApplication.CreateBuilderAsync([RunOptions.RunSettings, RunOptions.NoBanner, RunOptions.NoConsole]); +// builder.AddMSTest(() => [_assembly]); +// builder.TestHost.AddDataConsumer((_) => InitialTestRunConsumer.Create(discoveryResult, executed)); +// using var app = await builder.BuildAsync(); +// return await app.RunAsync(); +// } + +// public async Task CoverageRun(CoverageCollector coverageCollector) +// { +// var builder = await TestApplication.CreateBuilderAsync([RunOptions.CoverageSettings, RunOptions.NoConsole, RunOptions.NoBanner]); +// builder.AddMSTest(() => [_assembly]); +// builder.TestHost.AddTestApplicationLifecycleCallbacks((_) => CoverageLifecycleCallbacks.Create(_assembly.Location, coverageCollector)); +// builder.TestHost.AddDataConsumer((_) => CoverageConsumer.Create(coverageCollector)); +// using var app = await builder.BuildAsync(); +// return await app.RunAsync(); +// } + +// public async Task MutantRun(MutantController mutantController, IEnumerable? testCases, List executed) +// { +// List args = [RunOptions.RunSettings, RunOptions.NoBanner, RunOptions.NoConsole]; + +// var testCaseFilter = GetTestCaseFilterString(testCases); + +// if (testCaseFilter is not null) +// { +// args.Add(testCaseFilter); +// } + +// var builder = await TestApplication.CreateBuilderAsync([.. args]); + +// builder.AddMSTest(() => [_assembly]); +// builder.TestHost.AddTestApplicationLifecycleCallbacks((_) => MutantControlLifecycleCallbacks.Create(_assembly.Location, mutantController)); +// builder.TestHost.AddDataConsumer((_) => MutantRunConsumer.Create(executed)); + +// var app = await builder.BuildAsync(); +// return await app.RunAsync(); +// } + +// private static string GetTestCaseFilterString(IEnumerable? testCases) => +// testCases is null ? null : $"--filter {string.Join("|", testCases)}"; +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestRunner.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestRunner.cs new file mode 100644 index 0000000000..1f3d083fd5 --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/MsTestRunner.cs @@ -0,0 +1,168 @@ +//using System; +//using System.Collections.Generic; +//using System.IO.Abstractions; +//using System.Linq; +//using Microsoft.Testing.Platform.Extensions.Messages; +//using Stryker.Abstractions; +//using Stryker.Abstractions.Exceptions; +//using Stryker.Abstractions.Options; +//using Stryker.Abstractions.Testing; +//using Stryker.Core.TestRunners.MSTest.Setup; +//using Stryker.TestRunner.Results; +//using Stryker.TestRunner.Tests; + +//namespace Stryker.Core.TestRunners.MsTest; + +//public class MsTestRunner : ITestRunner +//{ +// private DiscoveryResult DiscoveryResult { get; } +// private TestProjectLoader TestProjectLoader { get; } + +// private Dictionary> Executed { get; } + +// private readonly IStrykerOptions _strykerOptions; + +// private readonly object _mutantRunLock = new object(); + +// public MsTestRunner(IStrykerOptions options, IFileSystem? fileSystem = null) +// { +// _strykerOptions = options; +// Executed = []; +// DiscoveryResult = new DiscoveryResult(); +// TestProjectLoader = new TestProjectLoader(fileSystem); +// } + +// public IEnumerable CaptureCoverage(IProjectAndTests project) +// { +// var coverageCollector = CoverageCollector.Create(DiscoveryResult, project.HelperNamespace); + +// foreach (var assembly in project.GetTestAssemblies()) +// { +// var testProject = TestProjectLoader.Load(assembly); +// var exitCode = testProject.CoverageRun(coverageCollector).GetAwaiter().GetResult(); +// } + +// return coverageCollector.GetCoverageRunResult(true); +// } + +// public bool DiscoverTests(string assembly) +// { +// var testProject = TestProjectLoader.LoadCopy(assembly); +// var executedTests = new List(); +// var exitCode = testProject.Discover(DiscoveryResult, executedTests, assembly).GetAwaiter().GetResult(); +// Executed.Add(assembly, executedTests); +// return DiscoveryResult.TestsPerSource[assembly].Count > 0; +// } + +// public ITestSet GetTests(IProjectAndTests project) => DiscoveryResult.GetTestsForSources(project.GetTestAssemblies()); + +// public ITestRunResult InitialTest(IProjectAndTests project) +// { +// var executedTests = new List(); + +// foreach (var assembly in project.GetTestAssemblies()) +// { +// var containsExecuted = Executed.TryGetValue(assembly, out var result); + +// if (containsExecuted) +// { +// executedTests.AddRange(result!); +// } +// } + +// var executed = executedTests +// .Select(tn => tn.Uid.Value) +// .ToHashSet(); + +// var failed = executedTests +// .Where(tn => tn.Properties.SingleOrDefault() is FailedTestNodeStateProperty) +// .Select(tn => tn.Uid.Value); + +// var timedOut = executedTests +// .Where(tn => tn.Properties.SingleOrDefault() is TimeoutTestNodeStateProperty) +// .Select(tn => tn.Uid.Value); + +// var duration = TimeSpan.FromTicks(DiscoveryResult.MsTests.Values.Sum(t => t.InitialRunTime.Ticks)); + +// return TestRunResult.Successful(DiscoveryResult.MsTests.Values, +// new WrappedIdentifierEnumeration(executed), +// new WrappedIdentifierEnumeration(failed), +// new WrappedIdentifierEnumeration(timedOut), +// Enumerable.Empty(), +// duration); +// } + +// public ITestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, ITestRunner.TestUpdateHandler update) +// { +// var mutantTestsMap = new Dictionary(); +// var testCases = TestCases(mutants, mutantTestsMap); + +// if (testCases?.Count == 0) +// { +// return TestRunResult.None(DiscoveryResult.MsTests.Values, "Mutants are not covered by any test!"); +// } + +// var totalCountOfTests = DiscoveryResult.GetTestsForSources(project.GetTestAssemblies()).Count; +// var executed = new List(); +// var mutantController = MutantController.Create(project.HelperNamespace, mutantTestsMap.Keys); + +// lock (_mutantRunLock) +// { +// foreach (var assembly in project.GetTestAssemblies()) +// { +// var testProject = TestProjectLoader.Load(assembly); +// var exitCode = testProject.MutantRun(mutantController, testCases, executed).GetAwaiter().GetResult(); +// } +// } + +// var tests = executed.Select(tn => tn.Uid.Value).Distinct().Count() >= totalCountOfTests ? +// TestIdentifierList.EveryTest() : +// new WrappedIdentifierEnumeration(executed.Select(tn => tn.Uid.Value)); + +// var failedTests = executed +// .Where(tn => tn.Properties.SingleOrDefault() is FailedTestNodeStateProperty) +// .Select(tn => tn.Uid.Value); + +// var timedOutTests = executed +// .Where(tn => tn.Properties.SingleOrDefault() is TimeoutTestNodeStateProperty) +// .Select(tn => tn.Uid.Value); + +// var remainingMutants = update?.Invoke(mutants, new WrappedIdentifierEnumeration(failedTests), tests, new WrappedIdentifierEnumeration(timedOutTests)); + +// var duration = TimeSpan.FromTicks(DiscoveryResult.MsTests.Values.Sum(t => t.InitialRunTime.Ticks)); + +// return TestRunResult.Successful( +// DiscoveryResult.MsTests.Values, +// tests, +// new WrappedIdentifierEnumeration(failedTests), +// new WrappedIdentifierEnumeration(timedOutTests), +// Enumerable.Empty(), +// duration); +// } + +// private List? TestCases(IReadOnlyList mutants, Dictionary mutantTestsMap) +// { +// if (_strykerOptions.OptimizationMode.HasFlag(OptimizationModes.CoverageBasedTest)) +// { +// var needAll = false; +// foreach (var mutant in mutants) +// { +// var tests = mutant.AssessingTests; +// needAll = needAll || tests.IsEveryTest; +// mutantTestsMap.Add(mutant.Id, tests); +// } + +// return needAll ? null : mutants.SelectMany(m => m.AssessingTests.GetIdentifiers().Select(t => t.ToString())).ToList(); +// } + +// if (mutants.Count > 1) +// { +// throw new GeneralStrykerException("Internal error: trying to test multiple mutants simultaneously without 'perTest' coverage analysis."); +// } + +// mutantTestsMap.Add(mutants[0].Id, TestIdentifierList.EveryTest()); +// return null; +// } + +// public void Dispose() => GC.SuppressFinalize(this); +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/AssemblyCopy.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/AssemblyCopy.cs new file mode 100644 index 0000000000..6e4c647d1b --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/AssemblyCopy.cs @@ -0,0 +1,89 @@ +//using System.Collections.Generic; +//using System.IO; +//using System.IO.Abstractions; +//using System.Linq; +//using dnlib.DotNet; +//using dnlib.DotNet.Writer; +//using Stryker.Abstractions.Exceptions; + +//namespace Stryker.Core.TestRunners.MsTest.Setup; +//internal class AssemblyCopy +//{ +// public const string CopySuffix = "Copy"; +// private readonly IFileSystem _fileSystem; + +// public AssemblyCopy(IFileSystem fileSystem) => _fileSystem = fileSystem; + +// public IEnumerable CopyProjects(IEnumerable csprojFilePaths, string testAssembly) +// { +// var csprojFiles = csprojFilePaths.Select(Path.GetFileNameWithoutExtension); +// var testDirectory = Path.GetDirectoryName(testAssembly) ?? string.Empty; + +// List projectNames = []; + +// var dlls = csprojFiles +// .Select(file => $"{Path.Combine(testDirectory, file ?? string.Empty)}.dll") +// .Where(file => _fileSystem.File.Exists(file) && file != testAssembly); + +// foreach (var dll in dlls) +// { +// var moduleContext = ModuleDef.CreateModuleContext(); +// var module = ModuleDefMD.Load(dll, moduleContext); + +// var moduleWriterOptions = new ModuleWriterOptions(module) +// { +// WritePdb = true +// }; + +// var projectName = Path.GetFileNameWithoutExtension(dll); +// projectNames.Add(projectName); + +// var copyName = $"{projectName}.{CopySuffix}"; +// var copyPath = $"{Path.Combine(testDirectory, copyName)}.dll"; + +// module.Assembly.Name = copyName; + +// module.Write(copyPath, moduleWriterOptions); +// } + +// return projectNames; +// } + +// public string CopyUnitTestProject(string testAssembly, IEnumerable projectNames) +// { +// if (!_fileSystem.File.Exists(testAssembly)) +// { +// throw new GeneralStrykerException($"Could not load assembly from path: {testAssembly}"); +// } + +// var moduleContext = ModuleDef.CreateModuleContext(); +// var module = ModuleDefMD.Load(testAssembly, moduleContext); + +// var moduleWriterOptions = new ModuleWriterOptions(module) +// { +// WritePdb = true +// }; + +// var copyDirectory = Path.GetDirectoryName(testAssembly) ?? string.Empty; +// var copyName = $"{Path.GetFileNameWithoutExtension(testAssembly)}.{CopySuffix}"; +// var copyPath = $"{Path.Combine(copyDirectory, copyName)}.dll"; + +// module.Assembly.Name = copyName; + +// foreach (var projectName in projectNames) +// { +// var assemblyRef = module.GetAssemblyRefs().FirstOrDefault(x => x.Name.Contains(projectName)); + +// if (assemblyRef is null) +// { +// continue; +// } + +// assemblyRef.Name = $"{projectName}.{CopySuffix}"; +// } + +// module.Write(copyPath, moduleWriterOptions); + +// return copyPath; +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/DirectoryScanner.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/DirectoryScanner.cs new file mode 100644 index 0000000000..fddb940db7 --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/DirectoryScanner.cs @@ -0,0 +1,43 @@ +//using System.Collections.Generic; +//using System.IO; +//using System.Linq; +//using Stryker.Abstractions.Exceptions; + +//namespace Stryker.Core.TestRunners.MSTest.Setup; + +//internal class DirectoryScanner +//{ +// public static IEnumerable FindProjects(string path) +// { +// var root = FindSolutionRoot(path); +// var csprojFiles = FindCsprojFiles(root); + +// return csprojFiles +// .Select(file => Path.GetFileNameWithoutExtension(file) ?? string.Empty) +// .Where(fileName => fileName != string.Empty); +// } + +// public static string FindSolutionRoot(string path) +// { +// var directoryPath = Path.GetDirectoryName(path) ?? throw new GeneralStrykerException($"Could not load assembly from path: {path}"); +// var directoryInfo = new DirectoryInfo(directoryPath); + +// while (directoryInfo is not null && directoryInfo.GetFiles("*.sln").Length == 0) +// { +// directoryInfo = directoryInfo.Parent; +// } + +// return directoryInfo?.FullName ?? string.Empty; +// } + +// public static IEnumerable FindCsprojFiles(string rootDirectory) +// { +// var directoryInfo = new DirectoryInfo(rootDirectory); + +// var files = directoryInfo +// .GetFiles("*.csproj", SearchOption.AllDirectories) +// .Select(x => x.FullName); + +// return files; +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/TestProjectLoader.cs b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/TestProjectLoader.cs new file mode 100644 index 0000000000..a2a18a6a49 --- /dev/null +++ b/src/Stryker.Core/Stryker.Core/TestRunners/MsTest/Setup/TestProjectLoader.cs @@ -0,0 +1,93 @@ +//using System; +//using System.Collections.Generic; +//using System.IO.Abstractions; +//using System.Reflection; +//using Stryker.Abstractions.Exceptions; +//using Stryker.Abstractions.ProjectComponents; +//using Stryker.Core.TestRunners.MsTest.Setup; + +//namespace Stryker.Core.TestRunners.MSTest.Setup; + +//internal class TestProjectLoader +//{ +// // Caches loaded assemblies +// private readonly Dictionary _projects = []; +// private readonly Dictionary _shadowProjects = []; + +// private readonly IFileSystem _fileSystem; +// private readonly AssemblyCopy _assemblyCopy; + +// public TestProjectLoader(IFileSystem? fileSystem) +// { +// _fileSystem = fileSystem ?? new FileSystem(); +// _assemblyCopy = new AssemblyCopy(_fileSystem); +// } + +// public ITestProject Load(string path) +// { +// var isCached = _projects.TryGetValue(path, out var project); + +// if (isCached) +// { +// return project!; +// } + +// var assembly = LoadAssembly(path); +// var testProject = LoadTestProject(assembly); + +// _projects.Add(path, testProject); +// return testProject; +// } + +// public ITestProject LoadCopy(string path) +// { +// var isCached = _shadowProjects.TryGetValue(path, out var project); + +// if (isCached) +// { +// return project!; +// } + +// // Find all .csproj files so we only copy referenced assemblies +// var root = DirectoryScanner.FindSolutionRoot(path); +// var csprojFiles = DirectoryScanner.FindCsprojFiles(root); + +// // Makes a copy of the current assemblies +// var projectNames = _assemblyCopy.CopyProjects(csprojFiles, path); +// var copyPath = _assemblyCopy.CopyUnitTestProject(path, projectNames); + +// // Loads the copy into memory +// var testAssembly = LoadAssembly(copyPath); +// var testProject = LoadTestProject(testAssembly); + +// _shadowProjects.Add(path, testProject); +// return testProject; +// } + +// private static Assembly LoadAssembly(string path) +// { +// try +// { +// // Loads the assembly in the default AssemblyLoadContext. +// // Locks the corresponding file for any IO-operations. +// return Assembly.LoadFrom(path); +// } +// catch +// { +// throw new GeneralStrykerException($"Could not load assembly from path: {path}"); +// } +// } + +// private static ITestProject LoadTestProject(Assembly assembly) +// { +// foreach (var reference in assembly.GetReferencedAssemblies()) +// { +// if (reference.FullName?.Contains(MsTestProject.EntryPoint, StringComparison.OrdinalIgnoreCase) is true) +// { +// return MsTestProject.Create(assembly); +// } +// } + +// throw new GeneralStrykerException("No supported test adapter found"); +// } +//} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/TestRunResult.cs b/src/Stryker.Core/Stryker.Core/TestRunners/TestRunResult.cs index 7f14aea827..1e8be67933 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/TestRunResult.cs +++ b/src/Stryker.Core/Stryker.Core/TestRunners/TestRunResult.cs @@ -1,57 +1,68 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.Mutants; -using Stryker.Core.TestRunners.VsTest; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using Stryker.Abstractions.Testing; +//using Stryker.TestRunner.Tests; -namespace Stryker.Core.TestRunners; +//namespace Stryker.Core.TestRunners; -public class TestRunResult : ITestRunResult -{ - public TestRunResult(bool success, string message = null) - { - VsTestDescriptions = new List(); - FailingTests = !success ? TestGuidsList.EveryTest() : TestGuidsList.NoTest(); - ExecutedTests = TestGuidsList.EveryTest(); - TimedOutTests = TestGuidsList.NoTest(); - ResultMessage = message; - Duration = TimeSpan.Zero; - } +//public class TestRunResult : ITestRunResult +//{ +// public TestRunResult(bool success, string message = null) +// { +// TestDescriptions = new List(); +// FailingTests = !success ? TestIdentifierList.EveryTest() : TestIdentifierList.NoTest(); +// ExecutedTests = TestIdentifierList.EveryTest(); +// TimedOutTests = TestIdentifierList.NoTest(); +// ResultMessage = message; +// Duration = TimeSpan.Zero; +// } - public TestRunResult( - IEnumerable vsTestDescriptions, - ITestGuids executedTests, - ITestGuids failedTests, - ITestGuids timedOutTest, - string message, - IEnumerable messages, - TimeSpan timeSpan) - { - VsTestDescriptions = vsTestDescriptions.Where(p => executedTests.Contains(p.Id)).ToList(); - ExecutedTests = executedTests; - FailingTests = failedTests; - TimedOutTests = timedOutTest; - ResultMessage = message; - Messages = messages; - Duration = timeSpan; - } +// public TestRunResult( +// IEnumerable testDescriptions, +// ITestIdentifiers executedTests, +// ITestIdentifiers failedTests, +// ITestIdentifiers timedOutTest, +// string message, +// IEnumerable messages, +// TimeSpan timeSpan) +// { +// TestDescriptions = testDescriptions.Where(p => executedTests.Contains(p.Id)).ToList(); +// ExecutedTests = executedTests; +// FailingTests = failedTests; +// TimedOutTests = timedOutTest; +// ResultMessage = message; +// Messages = messages; +// Duration = timeSpan; +// } - public static TestRunResult TimedOut( - IEnumerable vsTestDescriptions, - ITestGuids ranTests, - ITestGuids failedTest, - ITestGuids timedOutTests, - string message, - IEnumerable messages, - TimeSpan duration) => new(vsTestDescriptions, ranTests, failedTest, timedOutTests, message, messages, duration) { SessionTimedOut = true }; +// public static TestRunResult None(IEnumerable testDescriptions, string message) +// => new(testDescriptions, TestIdentifierList.NoTest(), TestIdentifierList.NoTest(), TestIdentifierList.NoTest(), message, Array.Empty(), TimeSpan.Zero); - public ITestGuids FailingTests { get; } - public ITestGuids ExecutedTests { get; } - public ITestGuids TimedOutTests { get; } - public bool SessionTimedOut { get; private init; } - public string ResultMessage { get; } - public IEnumerable Messages { get; } - public TimeSpan Duration { get; } - public IEnumerable VsTestDescriptions { get; } -} +// public static TestRunResult TimedOut( +// IEnumerable testDescriptions, +// ITestIdentifiers ranTests, +// ITestIdentifiers failedTest, +// ITestIdentifiers timedOutTests, +// string message, +// IEnumerable messages, +// TimeSpan duration) +// => new(testDescriptions, ranTests, failedTest, timedOutTests, message, messages, duration) { SessionTimedOut = true }; + +// public static TestRunResult Successful(IEnumerable testDescriptions, +// ITestIdentifiers executedTests, +// ITestIdentifiers failedTests, +// ITestIdentifiers timedOutTests, +// IEnumerable messages, +// TimeSpan duration) +// => new(testDescriptions, executedTests, failedTests, timedOutTests, "All tests passed", messages, duration); + +// public ITestIdentifiers FailingTests { get; } +// public ITestIdentifiers ExecutedTests { get; } +// public ITestIdentifiers TimedOutTests { get; } +// public bool SessionTimedOut { get; private init; } +// public string ResultMessage { get; } +// public IEnumerable Messages { get; } +// public TimeSpan Duration { get; } +// public IEnumerable TestDescriptions { get; } +//} diff --git a/src/Stryker.Core/Stryker.Core/packages.lock.json b/src/Stryker.Core/Stryker.Core/packages.lock.json index 6ca47694be..79ded41cde 100644 --- a/src/Stryker.Core/Stryker.Core/packages.lock.json +++ b/src/Stryker.Core/Stryker.Core/packages.lock.json @@ -29,6 +29,12 @@ "NuGet.Frameworks": "6.9.1" } }, + "dnlib": { + "type": "Direct", + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "cKHI720q+zfEEvzklWVGt6B0TH3AibAyJbpUJl4U6KvTP13tycfnqJpkGHRZ/oQ45BTIoIxIwltHIJVDN+iCqQ==" + }, "DotNet.Glob": { "type": "Direct", "requested": "[3.1.3, )", @@ -96,6 +102,22 @@ "Microsoft.Extensions.Options": "9.0.0" } }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, "Microsoft.TestPlatform": { "type": "Direct", "requested": "[17.12.0, )", @@ -141,18 +163,31 @@ "resolved": "0.11.6", "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" }, + "MSTest.TestAdapter": { + "type": "Direct", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", + "Microsoft.Testing.Platform.MSBuild": "1.5.0" + } + }, + "MSTest.TestFramework": { + "type": "Direct", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "CRHONroYbAaxhVILTNS84gIaI3uRRVmj8Qd3+Mpia1AVwSz2JiQy0LlTqtS8p+TYWgN+8zHG6j17OaTz/P/eHw==", + "dependencies": { + "MSTest.Analyzers": "3.7.0" + } + }, "NuGet.Frameworks": { "type": "Direct", "requested": "[6.12.1, )", "resolved": "6.12.1", "contentHash": "kPaRD5RJC0ByUg+yGX6bDz5XHMI7OYmQwP8kbtef+vZ+csj/VDb5Bwas4ChxwhoAbI8lEvwP5/3aViQPpgNBow==" }, - "ResXResourceReader.NetStandard": { - "type": "Direct", - "requested": "[1.3.0, )", - "resolved": "1.3.0", - "contentHash": "voW0VHwFGIvbJ4Pp/wfHKFGn9kxZD97H/mnD6LziBJCi4FJZtetYQpQQnpYp0IkL2+PQ6VOzkMvhK1+s7+NJnA==" - }, "Serilog": { "type": "Direct", "requested": "[4.2.0, )", @@ -264,6 +299,14 @@ "resolved": "2.0.323", "contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA==" }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "6.0.0", @@ -374,6 +417,43 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "G6XK8iLDMHIys55Fw7lIudRGrhNo3e/msIGkt6+Fckqggd9xl/nGTawy/4Avb8GFcuPfCwpQUuu8ESCPaxr08Q==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "3vMXWbqqy3rSXYlPshR7CPqG0bgGDOhasyhVtqhAOy2tMED6VKU/IbKNMUmEuqgPNjMkCaicDTfNdXsrJPKcsw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "lLb7JfTDdl6PUU3+Ia2O7+LekAqvyW3C5Rl94f+A/G16g+gxhynRDx73UuCBotjhn+8WGfEEH7Q81LsMCK/O4A==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.TestPlatform.ObjectModel": "17.12.0", + "Microsoft.Testing.Extensions.Telemetry": "1.5.0", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "D3mL4Tz0m6nDkbl0ZdTnHiyKMqxDc84mtDiFzM6HQgfLlc5OIdZgN+MCj6YD1CW/izQO566XHOFImTSxluiLIg==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, "MSBuild.StructuredLogger": { "type": "Transitive", "resolved": "2.2.158", @@ -391,6 +471,11 @@ "Microsoft.Build": "15.3.409" } }, + "MSTest.Analyzers": { + "type": "Transitive", + "resolved": "3.7.0", + "contentHash": "6cW8FWzz6gr5MArL8GDNrw5c+afJtOMRyntFEzAdbgPHgH8DuLGMAyz8g38k/LMquewk3tOmbXoDIL/IACLKjg==" + }, "NETStandard.Library": { "type": "Transitive", "resolved": "2.0.0", @@ -840,7 +925,6 @@ "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Utilities": "[4.4.1, )", "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" } }, @@ -851,8 +935,8 @@ "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Abstractions": "[4.4.1, )", - "Stryker.Utilities": "[4.4.1, )" + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" } }, "stryker.datacollector": { @@ -868,11 +952,40 @@ "Stryker.Regex.Parser": "[1.0.0, )" } }, + "stryker.testrunner": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "stryker.testrunner.vstest": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Microsoft.TestPlatform": "[17.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.TestPlatform.Portable": "[17.12.0, )", + "Microsoft.TestPlatform.TranslationLayer": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )", + "Stryker.DataCollector": "[1.0.0, )", + "Stryker.TestRunner": "[1.0.0, )", + "Stryker.Utilities": "[1.0.0, )" + } + }, "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" } }, "Microsoft.CodeAnalysis.VisualBasic": { @@ -893,6 +1006,12 @@ "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0", "System.Diagnostics.DiagnosticSource": "9.0.0" } + }, + "ResXResourceReader.NetStandard": { + "type": "CentralTransitive", + "requested": "[1.3.0, )", + "resolved": "1.3.0", + "contentHash": "voW0VHwFGIvbJ4Pp/wfHKFGn9kxZD97H/mnD6LziBJCi4FJZtetYQpQQnpYp0IkL2+PQ6VOzkMvhK1+s7+NJnA==" } } } diff --git a/src/Stryker.Options/Options/Inputs/MutationLevelInput.cs b/src/Stryker.Options/Options/Inputs/MutationLevelInput.cs index 16a6ed6b03..3e22605d2d 100644 --- a/src/Stryker.Options/Options/Inputs/MutationLevelInput.cs +++ b/src/Stryker.Options/Options/Inputs/MutationLevelInput.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Mutators; namespace Stryker.Abstractions.Options.Inputs; diff --git a/src/Stryker.Options/Options/StrykerInputs.cs b/src/Stryker.Options/Options/StrykerInputs.cs index ae0679c478..7066940d1b 100644 --- a/src/Stryker.Options/Options/StrykerInputs.cs +++ b/src/Stryker.Options/Options/StrykerInputs.cs @@ -1,5 +1,4 @@ using System.IO.Abstractions; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options.Inputs; using Stryker.Configuration; diff --git a/src/Stryker.Options/Options/StrykerOptions.cs b/src/Stryker.Options/Options/StrykerOptions.cs index b5948009d7..9ac02f6476 100644 --- a/src/Stryker.Options/Options/StrykerOptions.cs +++ b/src/Stryker.Options/Options/StrykerOptions.cs @@ -4,7 +4,6 @@ using System.Text.RegularExpressions; using Microsoft.CodeAnalysis.CSharp; using Stryker.Abstractions.Baseline; -using Stryker.Abstractions.Mutators; using Stryker.Abstractions.Options; using Stryker.Abstractions.ProjectComponents; using Stryker.Utilities; diff --git a/src/Stryker.Options/packages.lock.json b/src/Stryker.Options/packages.lock.json index 5e038b912e..ca13aa359b 100644 --- a/src/Stryker.Options/packages.lock.json +++ b/src/Stryker.Options/packages.lock.json @@ -254,15 +254,18 @@ "Microsoft.CodeAnalysis.Common": "[4.12.0, )", "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", "Serilog": "[4.2.0, )", - "Stryker.Utilities": "[4.4.1, )", "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" } }, "stryker.utilities": { "type": "Project", "dependencies": { + "Buildalyzer": "[7.1.0, )", "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" } }, "Buildalyzer": { @@ -329,12 +332,24 @@ "System.Reflection.Metadata": "1.6.0" } }, + "Mono.Cecil": { + "type": "CentralTransitive", + "requested": "[0.11.6, )", + "resolved": "0.11.6", + "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" + }, "NuGet.Frameworks": { "type": "CentralTransitive", "requested": "[6.12.1, )", "resolved": "6.9.1", "contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA==" }, + "ResXResourceReader.NetStandard": { + "type": "CentralTransitive", + "requested": "[1.3.0, )", + "resolved": "1.3.0", + "contentHash": "voW0VHwFGIvbJ4Pp/wfHKFGn9kxZD97H/mnD6LziBJCi4FJZtetYQpQQnpYp0IkL2+PQ6VOzkMvhK1+s7+NJnA==" + }, "TestableIO.System.IO.Abstractions.Wrappers": { "type": "CentralTransitive", "requested": "[21.2.1, )", diff --git a/src/Stryker.RegexMutators/Stryker.RegexMutators.UnitTest/packages.lock.json b/src/Stryker.RegexMutators/Stryker.RegexMutators.UnitTest/packages.lock.json index ed549022e3..8ef929b2d9 100644 --- a/src/Stryker.RegexMutators/Stryker.RegexMutators.UnitTest/packages.lock.json +++ b/src/Stryker.RegexMutators/Stryker.RegexMutators.UnitTest/packages.lock.json @@ -108,11 +108,6 @@ "Microsoft.Testing.Platform": "1.5.0" } }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" - }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", "resolved": "1.5.0", @@ -135,15 +130,6 @@ "resolved": "3.7.0", "contentHash": "6cW8FWzz6gr5MArL8GDNrw5c+afJtOMRyntFEzAdbgPHgH8DuLGMAyz8g38k/LMquewk3tOmbXoDIL/IACLKjg==" }, - "MSTest.TestAdapter": { - "type": "Transitive", - "resolved": "3.7.0", - "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", - "Microsoft.Testing.Platform.MSBuild": "1.5.0" - } - }, "Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.1", @@ -178,6 +164,12 @@ "Stryker.Regex.Parser": "[1.0.0, )" } }, + "Microsoft.Testing.Platform": { + "type": "CentralTransitive", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, "Microsoft.TestPlatform.ObjectModel": { "type": "CentralTransitive", "requested": "[17.12.0, )", @@ -187,6 +179,16 @@ "System.Reflection.Metadata": "1.6.0" } }, + "MSTest.TestAdapter": { + "type": "CentralTransitive", + "requested": "[3.7.0, )", + "resolved": "3.7.0", + "contentHash": "sq1AOdka70e8lD/mRzaqFfuquOHSUMF+09ACeP1zW9TG053ovVl6gzvi5VoRMxaE+q3rAItC7sx+5B3npK1kqg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.0", + "Microsoft.Testing.Platform.MSBuild": "1.5.0" + } + }, "MSTest.TestFramework": { "type": "CentralTransitive", "requested": "[3.7.0, )", diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/DiscoveryEventHandler.cs b/src/Stryker.TestRunner.VsTest/DiscoveryEventHandler.cs similarity index 97% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/DiscoveryEventHandler.cs rename to src/Stryker.TestRunner.VsTest/DiscoveryEventHandler.cs index 4858166db0..91edffcd1c 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/DiscoveryEventHandler.cs +++ b/src/Stryker.TestRunner.VsTest/DiscoveryEventHandler.cs @@ -1,10 +1,10 @@ +using System.Collections.Generic; +using System.Threading; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; -using System.Collections.Generic; -using System.Threading; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; public class DiscoveryEventHandler : ITestDiscoveryEventsHandler { diff --git a/src/Stryker.Core/Stryker.Core/Helpers/VsTestHelper.cs b/src/Stryker.TestRunner.VsTest/Helpers/VsTestHelper.cs similarity index 99% rename from src/Stryker.Core/Stryker.Core/Helpers/VsTestHelper.cs rename to src/Stryker.TestRunner.VsTest/Helpers/VsTestHelper.cs index 11093cb346..da818c782e 100644 --- a/src/Stryker.Core/Stryker.Core/Helpers/VsTestHelper.cs +++ b/src/Stryker.TestRunner.VsTest/Helpers/VsTestHelper.cs @@ -12,7 +12,7 @@ using Stryker.Abstractions.Logging; using Stryker.Utilities; -namespace Stryker.Core.Helpers; +namespace Stryker.TetsRunner.VsTest.Helpers; public interface IVsTestHelper { @@ -184,7 +184,7 @@ static bool TryGetNonEmptyEnvironmentVariable(string variable, out string value) } } - internal string DeployEmbeddedVsTestBinaries() + public string DeployEmbeddedVsTestBinaries() { var assembly = typeof(VsTestHelper).Assembly; var vsTestZips = assembly.GetManifestResourceNames().Where(r => r == "Microsoft.TestPlatform.Portable.nupkg").ToList(); diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/RunEventHandler.cs b/src/Stryker.TestRunner.VsTest/RunEventHandler.cs similarity index 99% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/RunEventHandler.cs rename to src/Stryker.TestRunner.VsTest/RunEventHandler.cs index c58acfcb20..6c8b201f7a 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/RunEventHandler.cs +++ b/src/Stryker.TestRunner.VsTest/RunEventHandler.cs @@ -10,7 +10,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; public interface IRunResults { @@ -102,7 +102,7 @@ private void AnalyzeRawTestResults(IEnumerable testResults) else { // unknown id. Probable cause: test name has changed due to some parameter having changed - _runs[id] = new TestRun(new VsTestDescription(testResult.TestCase)); + _runs[id] = new TestRun(new VsTestDescription(new VsTestCase(testResult.TestCase))); } } diff --git a/src/Stryker.TestRunner.VsTest/Stryker.TestRunner.VsTest.csproj b/src/Stryker.TestRunner.VsTest/Stryker.TestRunner.VsTest.csproj new file mode 100644 index 0000000000..1e1d6c3236 --- /dev/null +++ b/src/Stryker.TestRunner.VsTest/Stryker.TestRunner.VsTest.csproj @@ -0,0 +1,29 @@ + + + + net8.0 + enable + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/StrykerVstestHostLauncher.cs b/src/Stryker.TestRunner.VsTest/StrykerVstestHostLauncher.cs similarity index 98% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/StrykerVstestHostLauncher.cs rename to src/Stryker.TestRunner.VsTest/StrykerVstestHostLauncher.cs index 7010aa883b..7da8320ed0 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/StrykerVstestHostLauncher.cs +++ b/src/Stryker.TestRunner.VsTest/StrykerVstestHostLauncher.cs @@ -1,12 +1,12 @@ +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Threading; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.Interfaces; using Stryker.Abstractions.Logging; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Threading; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; public interface IStrykerTestHostLauncher : ITestHostLauncher { diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/TestRun.cs b/src/Stryker.TestRunner.VsTest/TestRun.cs similarity index 98% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/TestRun.cs rename to src/Stryker.TestRunner.VsTest/TestRun.cs index 90b3388cf5..e760390ae2 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/TestRun.cs +++ b/src/Stryker.TestRunner.VsTest/TestRun.cs @@ -17,7 +17,7 @@ using System.Linq; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; internal class TestRun { diff --git a/src/Stryker.TestRunner.VsTest/TestSet.cs b/src/Stryker.TestRunner.VsTest/TestSet.cs new file mode 100644 index 0000000000..dff8141cec --- /dev/null +++ b/src/Stryker.TestRunner.VsTest/TestSet.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.VsTest; + +public class TestSet : ITestSet +{ + private readonly IDictionary _tests = new Dictionary(); + public int Count => _tests.Count; + public ITestDescription this[Identifier guid] => _tests[guid]; + + public void RegisterTests(IEnumerable tests) + { + foreach (var test in tests) + { + RegisterTest(test); + } + } + + public void RegisterTest(ITestDescription test) => _tests[test.Id] = test; + + public IEnumerable Extract(IEnumerable ids) => ids?.Select(i => _tests[i]) ?? Enumerable.Empty(); +} diff --git a/src/Stryker.TestRunner.VsTest/VsTestCase.cs b/src/Stryker.TestRunner.VsTest/VsTestCase.cs new file mode 100644 index 0000000000..a8a1ded017 --- /dev/null +++ b/src/Stryker.TestRunner.VsTest/VsTestCase.cs @@ -0,0 +1,37 @@ +using System; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Stryker.Abstractions.Testing; +using ITestCase = Stryker.Abstractions.Testing.ITestCase; + +namespace Stryker.TestRunner.VsTest; + +public class VsTestCase : ITestCase +{ + public VsTestCase(TestCase testCase) + { + OriginalTestCase = testCase; + Id = Identifier.Create(testCase.Id); + Name = testCase.DisplayName; + FullyQualifiedName = testCase.FullyQualifiedName; + Uri = testCase.ExecutorUri; + CodeFilePath = testCase.CodeFilePath ?? string.Empty; + LineNumber = testCase.LineNumber; + Source = testCase.Source; + } + + public TestCase OriginalTestCase { get; } + + public Identifier Id { get; } + + public string Name { get; } + + public Uri Uri { get; } + + public string CodeFilePath { get; } + + public string FullyQualifiedName { get; } + + public int LineNumber { get; } + + public string Source { get; } +} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestContextInformation.cs b/src/Stryker.TestRunner.VsTest/VsTestContextInformation.cs similarity index 95% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestContextInformation.cs rename to src/Stryker.TestRunner.VsTest/VsTestContextInformation.cs index c02b532532..48245abe5a 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestContextInformation.cs +++ b/src/Stryker.TestRunner.VsTest/VsTestContextInformation.cs @@ -11,12 +11,11 @@ using Stryker.Abstractions.Exceptions; using Stryker.Abstractions.Logging; using Stryker.Abstractions.Options; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.Helpers; -using Stryker.Core.Mutants; +using Stryker.Abstractions.Testing; using Stryker.DataCollector; +using Stryker.TetsRunner.VsTest.Helpers; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; /// /// Handles VsTest setup and configuration. @@ -102,7 +101,7 @@ public IVsTestConsoleWrapper BuildVsTestWrapper(string runnerId, string controlV { var env = DetermineConsoleParameters(runnerId); // Set roll forward on no candidate fx so vstest console can start on incompatible dotnet core runtimes - env.EnvironmentVariables["DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX"]="2"; + env.EnvironmentVariables["DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX"] = "2"; // we define a per runner control variable to prevent conflict env.EnvironmentVariables["STRYKER_MUTANT_ID_CONTROL_VAR"] = controlVariable; var vsTestConsole = _wrapperBuilder(env); @@ -159,12 +158,12 @@ private ConsoleParameters DetermineConsoleParameters(string runnerId) return determineConsoleParameters; } - public TestSet GetTestsForSources(IEnumerable sources) + public ITestSet GetTestsForSources(IEnumerable sources) { var result = new TestSet(); foreach (var source in sources) { - result.RegisterTests(TestsPerSource[source].Select(id => Tests[id])); + result.RegisterTests(TestsPerSource[source].Select(id => Tests[Identifier.Create(id)])); } return result; @@ -214,7 +213,7 @@ private void DiscoverTestsInSources(string newSource, string frameworkVersion = { if (!VsTests.ContainsKey(testCase.Id)) { - VsTests[testCase.Id] = new VsTestDescription(testCase); + VsTests[testCase.Id] = new VsTestDescription(new VsTestCase(testCase)); } VsTests[testCase.Id].AddSubCase(); @@ -229,9 +228,9 @@ private void DiscoverTestsInSources(string newSource, string frameworkVersion = internal void RegisterDiscoveredTest(VsTestDescription vsTestDescription) { - VsTests[vsTestDescription.Id] = vsTestDescription; + VsTests[vsTestDescription.Id.ToGuid()] = vsTestDescription; Tests.RegisterTest(vsTestDescription.Description); - TestsPerSource[vsTestDescription.Case.Source].Add(vsTestDescription.Id); + TestsPerSource[vsTestDescription.Case.Source].Add(vsTestDescription.Id.ToGuid()); } private void DetectTestFrameworks(ICollection tests) @@ -284,7 +283,7 @@ private string GenerateRunSettingsForDiscovery(string frameworkVersion = null, s "; - public string GenerateRunSettings(int? timeout, bool forCoverage, Dictionary mutantTestsMap, + public string GenerateRunSettings(int? timeout, bool forCoverage, Dictionary mutantTestsMap, string helperNameSpace, string frameworkVersion = null, string platform = null) { var settingsForCoverage = string.Empty; @@ -292,7 +291,7 @@ public string GenerateRunSettings(int? timeout, bool forCoverage, Dictionary (e.Key, e.Value.GetGuids())), + mutantTestsMap?.Select(e => (e.Key, e.Value.GetIdentifiers().Select(x => x.ToGuid()))), helperNameSpace) : string.Empty; if (_testFramework.HasFlag(TestFrameworks.NUnit)) diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestDescription.cs b/src/Stryker.TestRunner.VsTest/VsTestDescription.cs similarity index 58% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestDescription.cs rename to src/Stryker.TestRunner.VsTest/VsTestDescription.cs index 841fa1818f..d8d09aff21 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestDescription.cs +++ b/src/Stryker.TestRunner.VsTest/VsTestDescription.cs @@ -1,35 +1,34 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.VisualStudio.TestPlatform.ObjectModel; -using Stryker.Core.Mutants; +using Stryker.Abstractions.Testing; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; -public sealed class VsTestDescription +public sealed class VsTestDescription : IFrameworkTestDescription { - private readonly ICollection _initialResults = []; + private readonly ICollection _initialResults = []; private int _subCases; - public VsTestDescription(TestCase testCase) + public VsTestDescription(ITestCase testCase) { Case = testCase; - Description = new TestDescription(testCase.Id, testCase.DisplayName, testCase.CodeFilePath); + Description = new TestDescription(testCase.Id, testCase.Name, testCase.CodeFilePath); } public TestFrameworks Framework { get { - if (Case.ExecutorUri.AbsoluteUri.Contains("nunit")) + if (Case.Uri.AbsoluteUri.Contains("nunit")) { return TestFrameworks.NUnit; } - return Case.ExecutorUri.AbsoluteUri.Contains("xunit") ? TestFrameworks.xUnit : TestFrameworks.MsTest; + return Case.Uri.AbsoluteUri.Contains("xunit") ? TestFrameworks.xUnit : TestFrameworks.MsTest; } } - public TestDescription Description { get; } + public ITestDescription Description { get; } public TimeSpan InitialRunTime { @@ -45,13 +44,13 @@ public TimeSpan InitialRunTime } } - public Guid Id => Case.Id; + public Identifier Id => Case.Id; - public TestCase Case { get; } + public ITestCase Case { get; } public int NbSubCases => Math.Max(_subCases, _initialResults.Count); - public void RegisterInitialTestResult(TestResult result) => _initialResults.Add(result); + public void RegisterInitialTestResult(ITestResult result) => _initialResults.Add(result); public void AddSubCase() => _subCases++; diff --git a/src/Stryker.TestRunner.VsTest/VsTestResult.cs b/src/Stryker.TestRunner.VsTest/VsTestResult.cs new file mode 100644 index 0000000000..fa5bf0b6ce --- /dev/null +++ b/src/Stryker.TestRunner.VsTest/VsTestResult.cs @@ -0,0 +1,15 @@ +using System; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.VsTest; + +internal class VsTestResult : ITestResult +{ + public VsTestResult(TestResult testResult) + { + Duration = testResult.Duration; + } + + public TimeSpan Duration { get; } +} diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunner.cs b/src/Stryker.TestRunner.VsTest/VsTestRunner.cs similarity index 86% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunner.cs rename to src/Stryker.TestRunner.VsTest/VsTestRunner.cs index de6e99665c..c1f8f2c80c 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunner.cs +++ b/src/Stryker.TestRunner.VsTest/VsTestRunner.cs @@ -8,15 +8,15 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; -using Stryker.Abstractions.TestRunners; -using Stryker.Core.Initialisation.Buildalyzer; -using Stryker.Core.Mutants; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using Stryker.Utilities.Buildalyzer; +using static Stryker.Abstractions.Testing.ITestRunner; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; public sealed class VsTestRunner : IDisposable { @@ -49,7 +49,7 @@ public VsTestRunner(VsTestContextInformation context, public TestRunResult InitialTest(IProjectAndTests project) { - var testResults = RunTestSession(TestGuidsList.EveryTest(), project); + var testResults = RunTestSession(TestIdentifierList.EveryTest(), project); foreach (var test in _context.VsTests.Keys) { _context.VsTests[test].ClearInitialResult(); @@ -60,14 +60,15 @@ public TestRunResult InitialTest(IProjectAndTests project) { if (!_context.VsTests.ContainsKey(result.TestCase.Id)) { - var vsTestDescription = new VsTestDescription(result.TestCase); + var vsTestDescription = new VsTestDescription(new VsTestCase(result.TestCase)); + _context.VsTests[result.TestCase.Id] = vsTestDescription; _context.RegisterDiscoveredTest(vsTestDescription); _logger.LogWarning( "{RunnerId}: Initial test run encounter an unexpected test case ({DisplayName}), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.", RunnerId, result.TestCase.DisplayName); } - _context.VsTests[result.TestCase.Id].RegisterInitialTestResult(result); + _context.VsTests[result.TestCase.Id].RegisterInitialTestResult(new VsTestResult(result)); } var totalCountOfTests = _context.GetTestsForSources(project.GetTestAssemblies()).Count; @@ -77,14 +78,14 @@ public TestRunResult InitialTest(IProjectAndTests project) public TestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, TestUpdateHandler update) { - var mutantTestsMap = new Dictionary(); + var mutantTestsMap = new Dictionary(); var testCases = TestCases(mutants, mutantTestsMap); if (testCases?.Count == 0) { - return new TestRunResult(_context.VsTests.Values, TestGuidsList.NoTest(), TestGuidsList.NoTest(), - TestGuidsList.NoTest(), "Mutants are not covered by any test!", [], + return new TestRunResult(_context.VsTests.Values, TestIdentifierList.NoTest(), TestIdentifierList.NoTest(), + TestIdentifierList.NoTest(), "Mutants are not covered by any test!", Enumerable.Empty(), TimeSpan.Zero); } @@ -95,7 +96,7 @@ public TestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValue if (timeoutCalc != null && testCases != null) { // compute time out - timeOutMs = timeoutCalc.CalculateTimeoutValue((int)testCases.Sum(id => _context.VsTests[id].InitialRunTime.TotalMilliseconds)); + timeOutMs = timeoutCalc.CalculateTimeoutValue((int)testCases.Sum(id => _context.VsTests[id.ToGuid()].InitialRunTime.TotalMilliseconds)); } if (timeOutMs.HasValue) @@ -103,7 +104,7 @@ public TestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValue _logger.LogDebug("{RunnerId}: Using {timeOutMs} ms as test run timeout", RunnerId, timeOutMs); } - var testResults = RunTestSession(new TestGuidsList(testCases), project, timeOutMs, mutantTestsMap, HandleUpdate); + var testResults = RunTestSession(new TestIdentifierList(testCases), project, timeOutMs, mutantTestsMap, HandleUpdate); return BuildTestRunResult(testResults, expectedTests, totalCountOfTests); @@ -111,7 +112,7 @@ void HandleUpdate(IRunResults handler) { var handlerTestResults = handler.TestResults; var tests = handlerTestResults.Select(p => p.TestCase.Id).Distinct().Count() >= totalCountOfTests - ? (ITestGuids)TestGuidsList.EveryTest() + ? TestIdentifierList.EveryTest() : new WrappedGuidsEnumeration(handlerTestResults.Select(t => t.TestCase.Id)); var failedTest = new WrappedGuidsEnumeration(handlerTestResults .Where(tr => tr.Outcome == TestOutcome.Failed) @@ -134,9 +135,9 @@ void HandleUpdate(IRunResults handler) } } - private ICollection TestCases(IReadOnlyList mutants, Dictionary mutantTestsMap) + private ICollection TestCases(IReadOnlyList mutants, Dictionary mutantTestsMap) { - ICollection testCases; + ICollection testCases; // if we optimize the number of tests to run if (_context.Options.OptimizationMode.HasFlag(OptimizationModes.CoverageBasedTest)) { @@ -148,7 +149,7 @@ private ICollection TestCases(IReadOnlyList mutants, Dictionary m.AssessingTests.GetGuids()).ToList(); + testCases = needAll ? null : mutants.SelectMany(m => m.AssessingTests.GetIdentifiers()).ToList(); _logger.LogDebug("{RunnerId}: Testing [{Mutants}]", RunnerId, string.Join(',', mutants.Select(m => m.DisplayName))); _logger.LogTrace( @@ -163,7 +164,7 @@ private ICollection TestCases(IReadOnlyList mutants, Dictionary 0 && ranTestsCount >= totalCountOfTests - ? (ITestGuids)TestGuidsList.EveryTest() + ? TestIdentifierList.EveryTest() : new WrappedGuidsEnumeration(testCases); var failedTests = resultAsArray.Where(tr => tr.Outcome == TestOutcome.Failed).Select(t => t.TestCase.Id); @@ -207,15 +208,15 @@ private TestRunResult BuildTestRunResult(IRunResults testResults, int expectedTe messages, duration); } - public IRunResults RunTestSession(ITestGuids testsToRun, IProjectAndTests project, int? timeout = null, Dictionary mutantTestsMap = null, Action updateHandler = null) => + public IRunResults RunTestSession(ITestIdentifiers testsToRun, IProjectAndTests project, int? timeout = null, Dictionary mutantTestsMap = null, Action updateHandler = null) => RunTestSession(testsToRun, project, false, timeout, updateHandler, mutantTestsMap).normal; - public IRunResults RunCoverageSession(ITestGuids testsToRun, IProjectAndTests project) => + public IRunResults RunCoverageSession(ITestIdentifiers testsToRun, IProjectAndTests project) => RunTestSession(testsToRun, project, true).raw; - private (IRunResults normal, IRunResults raw) RunTestSession(ITestGuids tests, IProjectAndTests projectAndTests, + private (IRunResults normal, IRunResults raw) RunTestSession(ITestIdentifiers tests, IProjectAndTests projectAndTests, bool forCoverage, int? timeOut = null, Action updateHandler = null, - Dictionary mutantTestsMap = null) + Dictionary mutantTestsMap = null) { var sources = projectAndTests.GetTestAssemblies(); var validSources = _context.GetValidSources(sources).ToList(); @@ -240,7 +241,7 @@ public IRunResults RunCoverageSession(ITestGuids testsToRun, IProjectAndTests pr foreach (var source in projectAndTests.TestProjectsInfo.AnalyzerResults) { var testForSource = _context.TestsPerSource[source.GetAssemblyPath()]; - var testsForAssembly = new TestGuidsList(tests.GetGuids().Where(testForSource.Contains)); + var testsForAssembly = new TestGuidsList(tests.GetIdentifiers().Where(t => testForSource.Contains(t.ToGuid()))); if (!tests.IsEveryTest && testsForAssembly.Count == 0) { // skip empty assemblies @@ -272,11 +273,11 @@ void HandlerUpdate(object sender, EventArgs e) } } - private void RunVsTest(ITestGuids tests, string source, string runSettings, TestPlatformOptions options, + private void RunVsTest(ITestIdentifiers tests, string source, string runSettings, TestPlatformOptions options, int? timeOut, RunEventHandler eventHandler) { var attempt = 0; - while (attempt _context.VsTests[t].Case).ToList(); + var actualTestCases = tests.GetIdentifiers().Select(t => + { + var testCase = (VsTestCase)_context.VsTests[t.ToGuid()].Case; + return testCase.OriginalTestCase; + }); var testCases = actualTestCases; _vsTestConsole.RunTestsWithCustomTestHost( testCases, diff --git a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs b/src/Stryker.TestRunner.VsTest/VsTestRunnerPool.cs similarity index 81% rename from src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs rename to src/Stryker.TestRunner.VsTest/VsTestRunnerPool.cs index 4ede47d9ae..893c97a28a 100644 --- a/src/Stryker.Core/Stryker.Core/TestRunners/VsTest/VsTestRunnerPool.cs +++ b/src/Stryker.TestRunner.VsTest/VsTestRunnerPool.cs @@ -9,14 +9,15 @@ using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Stryker.Abstractions; -using Stryker.Abstractions.Initialisation; using Stryker.Abstractions.Logging; -using Stryker.Abstractions.Mutants; using Stryker.Abstractions.Options; -using Stryker.Core.Mutants; -using Stryker.DataCollector; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; +using static Stryker.Abstractions.Testing.ITestRunner; +using CoverageCollector = Stryker.DataCollector.CoverageCollector; -namespace Stryker.Core.TestRunners.VsTest; +namespace Stryker.TestRunner.VsTest; public sealed class VsTestRunnerPool : ITestRunner { @@ -54,15 +55,15 @@ public VsTestRunnerPool(IStrykerOptions options, IFileSystem fileSystem = null) public bool DiscoverTests(string assembly) => Context.AddTestSource(assembly); - public TestSet GetTests(IProjectAndTests project) => Context.GetTestsForSources(project.GetTestAssemblies()); + public ITestSet GetTests(IProjectAndTests project) => Context.GetTestsForSources(project.GetTestAssemblies()); - public TestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, TestUpdateHandler update) + public ITestRunResult TestMultipleMutants(IProjectAndTests project, ITimeoutValueCalculator timeoutCalc, IReadOnlyList mutants, TestUpdateHandler update) => RunThis(runner => runner.TestMultipleMutants(project, timeoutCalc, mutants, update)); - public TestRunResult InitialTest(IProjectAndTests project) + public ITestRunResult InitialTest(IProjectAndTests project) => RunThis(runner => runner.InitialTest(project)); - public IEnumerable CaptureCoverage(IProjectAndTests project) => Context.Options.OptimizationMode.HasFlag(OptimizationModes.CaptureCoveragePerTest) ? CaptureCoverageTestByTest(project) : CaptureCoverageInOneGo(project); + public IEnumerable CaptureCoverage(IProjectAndTests project) => Context.Options.OptimizationMode.HasFlag(OptimizationModes.CaptureCoveragePerTest) ? CaptureCoverageTestByTest(project) : CaptureCoverageInOneGo(project); private void Initialize(Func runnerBuilder = null) { @@ -75,9 +76,9 @@ private void Initialize(Func runner })); } - private IEnumerable CaptureCoverageInOneGo(IProjectAndTests project) => ConvertCoverageResult(RunThis(runner => runner.RunCoverageSession(TestGuidsList.EveryTest(), project).TestResults), false); + private IEnumerable CaptureCoverageInOneGo(IProjectAndTests project) => ConvertCoverageResult(RunThis(runner => runner.RunCoverageSession(TestGuidsList.EveryTest(), project).TestResults), false); - private IEnumerable CaptureCoverageTestByTest(IProjectAndTests project) => ConvertCoverageResult(CaptureCoveragePerIsolatedTests(project, Context.VsTests.Keys).TestResults, true); + private IEnumerable CaptureCoverageTestByTest(IProjectAndTests project) => ConvertCoverageResult(CaptureCoveragePerIsolatedTests(project, Context.VsTests.Keys).TestResults, true); private IRunResults CaptureCoveragePerIsolatedTests(IProjectAndTests project, IEnumerable tests) { @@ -119,11 +120,11 @@ public void Dispose() _runnerAvailableHandler.Dispose(); } - private IEnumerable ConvertCoverageResult(IEnumerable testResults, bool perIsolatedTest) + private IEnumerable ConvertCoverageResult(IEnumerable testResults, bool perIsolatedTest) { var seenTestCases = new HashSet(); var defaultConfidence = perIsolatedTest ? CoverageConfidence.Exact : CoverageConfidence.Normal; - var resultCache = new Dictionary(); + var resultCache = new Dictionary(); // initialize the map foreach (var testResult in testResults) { @@ -140,9 +141,9 @@ private IEnumerable ConvertCoverageResult(IEnumerable seenTestCases "VsTestRunner: Coverage analysis run encountered a unexpected test case ({TestCase}), mutation tests may be inaccurate. Disable coverage analysis if you have doubts.", testResult.TestCase.DisplayName); // add the test description to the referential - Context.VsTests.Add(testCaseId, new VsTestDescription(testResult.TestCase)); + Context.VsTests.Add(testCaseId, new VsTestDescription(new VsTestCase(testResult.TestCase))); unexpected = true; } @@ -187,13 +188,13 @@ private bool ConvertSingleResult(TestResult testResult, ISet seenTestCases // the coverage collector was not able to report anything ==> it has not been tracked by it, so we do not have coverage data // ==> we need it to use this test against every mutation _logger.LogDebug("VsTestRunner: No coverage data for {TestCase}.", testResult.TestCase.DisplayName); - seenTestCases.Add(testDescription.Id); - coverageRunResult = new CoverageRunResult(testCaseId, CoverageConfidence.Dubious, [], [], []); + seenTestCases.Add(testDescription.Id.ToGuid()); + coverageRunResult = CoverageRunResult.Create(testDescription.Id.ToString(), CoverageConfidence.Dubious, [], [], []); } else { // we have coverage data - seenTestCases.Add(testDescription.Id); + seenTestCases.Add(testDescription.Id.ToGuid()); var propertyPairValue = value as string; coverageRunResult = BuildCoverageRunResultFromCoverageInfo(propertyPairValue, testResult, testCaseId, @@ -248,6 +249,6 @@ private CoverageRunResult BuildCoverageRunResultFromCoverageInfo(string property leakedMutants = Enumerable.Empty(); } - return new CoverageRunResult(testCaseId, level, coveredMutants, staticMutants, leakedMutants); + return CoverageRunResult.Create(testCaseId.ToString(), level, coveredMutants, staticMutants, leakedMutants); } } diff --git a/src/Stryker.TestRunner.VsTest/packages.lock.json b/src/Stryker.TestRunner.VsTest/packages.lock.json new file mode 100644 index 0000000000..aa3df42796 --- /dev/null +++ b/src/Stryker.TestRunner.VsTest/packages.lock.json @@ -0,0 +1,438 @@ +{ + "version": 2, + "dependencies": { + "net8.0": { + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.2.25, )", + "resolved": "1.2.25", + "contentHash": "xCXiw7BCxHJ8pF6wPepRUddlh2dlQlbr81gXA72hdk4FLHkKXas7EH/n+fk5UCA/YfMqG1Z6XaPiUjDbUNBUzg==" + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Direct", + "requested": "[9.0.0, )", + "resolved": "9.0.0", + "contentHash": "g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0", + "System.Diagnostics.DiagnosticSource": "9.0.0" + } + }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, + "Microsoft.TestPlatform": { + "type": "Direct", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "asEPFo3cFftjlf3P5Ayx+xT4UdNCvSI+ar7q8UBd9M1JaR+zYie0X8yQVkicClp73AtbXcPnlivsIdpjC0WUJA==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Direct", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.Portable": { + "type": "Direct", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "kyfkCP7KPZWUpANRHFaWwYpbiWt6QuHNAJxgRoJRKxEy4HuYgd7kJqRp4LhX0T6E2a+850hVl/vjOP8OMmJmJA==" + }, + "Microsoft.TestPlatform.TranslationLayer": { + "type": "Direct", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "Vtsytd0doKbas33cscfYhKl06jee80lHJy5wrSEsBEOpNX1wP2nHgkFUasxGxg88Ihddp3NnHitZ7MCUgVuM2A==", + "dependencies": { + "NETStandard.Library": "2.0.0" + } + }, + "Buildalyzer.Logger": { + "type": "Transitive", + "resolved": "7.1.0", + "contentHash": "a0T+Se+HSCxOvP2s7kUbgHBVeeJghliN9CO3pSl8JfqPhKD9JaE7ZxS3iTEgKglDsRibcqbdIxhYvvvIdLOvuQ==" + }, + "Microsoft.Build": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "ZmGA8vhVXFzC4oo48ybQKlEybVKd0Ntfdr+Enqrn5ES1R6e/krIK9hLk0W33xuT0/G6QYd3YdhJZh+Xle717Ag==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.MetadataLoadContext": "8.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.Tasks.Dataflow": "8.0.0" + } + }, + "Microsoft.Build.Framework": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "4qXCwNOXBR1dyCzuks9SwTwFJQO/xmf2wcMislotDWJu7MN/r3xDNoU8Ae5QmKIHPaLG1xmfDkYS7qBVzxmeKw==" + }, + "Microsoft.Build.Tasks.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "k1sefpk2VvJNwcexMjisH+TdzhspCVRtYvh4fAez5qRM20VvsNxcOIjfDe3h3StZRIGI2aiFKGxBZYkwM+WV+A==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.Build.Utilities.Core": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.CodeDom": "8.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Resources.Extensions": "8.0.0", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Security.Cryptography.Xml": "8.0.0" + } + }, + "Microsoft.Build.Utilities.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "eEB/tcXkSV+nQgvoa/l53UPtn+KVtKZ8zBceDZsXVTrfE4fA+4+/olrx9W8n2tq4XiESsL9UuGJgCKzqBwQCoQ==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NET.StringTools": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "wyABaqY+IHCMMSTQmcc3Ca6vbmg5BaEPgicnEgpll+4xyWZWlkQqUwafweUd9VAhBb4jqplMl6voUHQ6yfdUcg==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "3vMXWbqqy3rSXYlPshR7CPqG0bgGDOhasyhVtqhAOy2tMED6VKU/IbKNMUmEuqgPNjMkCaicDTfNdXsrJPKcsw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "MSBuild.StructuredLogger": { + "type": "Transitive", + "resolved": "2.2.158", + "contentHash": "A7hI65/MrDKdPpu4rsnqimDdAs42B05gpfOIyzWPJ+pqw6Q3p4r1I/AjWVe3joKGHIQSpL+0AX2tzLVVCaR0ug==", + "dependencies": { + "Microsoft.Build.Framework": "17.5.0", + "Microsoft.Build.Utilities.Core": "17.5.0" + } + }, + "MsBuildPipeLogger.Server": { + "type": "Transitive", + "resolved": "1.1.6", + "contentHash": "rls0hb7plSfVFCqScDxTqtGpIlMfoQEchqjmK/YtXDML11GU5jI+oCi9YsikGulJVUv/vLSY6Ktah0uXwv25EA==", + "dependencies": { + "Microsoft.Build": "15.3.409" + } + }, + "NETStandard.Library": { + "type": "Transitive", + "resolved": "2.0.0", + "contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==", + "dependencies": { + "System.Diagnostics.EventLog": "8.0.0", + "System.Security.Cryptography.ProtectedData": "8.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==" + }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AJukBuLoe3QeAF+mfaRKQb2dgyrvt340iMBHYv+VdBzCUM06IxGlvl0o/uPOS7lHnXPN6u8fFRHSHudx5aTi8w==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Reflection.MetadataLoadContext": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "System.Resources.Extensions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.Cryptography.Pkcs": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "dependencies": { + "System.Formats.Asn1": "8.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==" + }, + "System.Security.Cryptography.Xml": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==", + "dependencies": { + "System.Security.Cryptography.Pkcs": "8.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Threading.Tasks.Dataflow": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "7V0I8tPa9V7UxMx/+7DIwkhls5ouaEMQx6l/GwGm1Y8kJQ61On9B/PxCXFLbgu5/C47g0BP2CUYs+nMv1+Oaqw==" + }, + "TestableIO.System.IO.Abstractions": { + "type": "Transitive", + "resolved": "21.2.1", + "contentHash": "47NQXrfVUF+0b8W5EMnERR7FpgWE04wuYR1s9WvlNyh1hnRMGDPOvmewBLIZUG88Rhj9buzG3VVR8sAgH7TzjA==" + }, + "stryker.abstractions": { + "type": "Project", + "dependencies": { + "Buildalyzer": "[7.1.0, )", + "DotNet.Glob": "[3.1.3, )", + "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", + "Microsoft.CodeAnalysis.Common": "[4.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Serilog": "[4.2.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + } + }, + "stryker.datacollector": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.TestPlatform.Portable": "[17.12.0, )" + } + }, + "stryker.testrunner": { + "type": "Project", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Microsoft.Testing.Extensions.TrxReport": "[1.5.0, )", + "Microsoft.Testing.Platform": "[1.5.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "stryker.utilities": { + "type": "Project", + "dependencies": { + "Buildalyzer": "[7.1.0, )", + "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", + "Microsoft.Extensions.Logging.Abstractions": "[9.0.0, )", + "Mono.Cecil": "[0.11.6, )", + "ResXResourceReader.NetStandard": "[1.3.0, )", + "Stryker.Abstractions": "[1.0.0, )" + } + }, + "Buildalyzer": { + "type": "CentralTransitive", + "requested": "[7.1.0, )", + "resolved": "7.1.0", + "contentHash": "U6e7mHdQC672lfvqNVp70jQGb8g3aPnLafnFnnrzUwFfPX+4tK5uk3Ah+1R3svyG5kc3Qu9ZjBrhcvml/IwXrw==", + "dependencies": { + "Buildalyzer.Logger": "7.1.0", + "MSBuild.StructuredLogger": "2.2.158", + "Microsoft.Build": "17.10.4", + "Microsoft.Build.Tasks.Core": "17.10.4", + "Microsoft.CodeAnalysis.CSharp": "4.0.0", + "Microsoft.CodeAnalysis.VisualBasic": "4.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "MsBuildPipeLogger.Server": "1.1.6", + "NuGet.Frameworks": "6.9.1" + } + }, + "DotNet.Glob": { + "type": "CentralTransitive", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "hOfHw7MLJw/tbXaFwR1oiDb+dIXDp8URTxp5Pco42OOhiw77wrUNx6v6syNygHZbWwYdXQocL2Mo1l5FnfDVjg==" + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "CentralTransitive", + "requested": "[3.11.0, )", + "resolved": "3.3.4", + "contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.12.0", + "contentHash": "c1kNYihL2gdcuU1dqm8R8YeA4YkB43TpU3pa2r66Uooh6AAhRtENzj9A4Kj0a+H8JDDyuTjNZql9XlVUzV+UjA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.12.0", + "contentHash": "30vVQ1MizeC22iEdEvI2w0eTIYG43/L20yBzuQH01xKzJgHAoWehzI2F8u07o4mXh4DGMOjQF7aEm0zzvsG3Mg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "Microsoft.CodeAnalysis.Common": "[4.12.0]", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "Microsoft.CodeAnalysis.VisualBasic": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.0.0", + "contentHash": "FK+OGUMUh9O6/GCwyIy4c/sOrarF36/yEY07BbXVYMql1qCqHGWfyWXyCQKQ6m/KqReCqW6aO4cK7kK/AYBpyA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[4.0.0]" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[9.0.0, )", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" + } + }, + "Mono.Cecil": { + "type": "CentralTransitive", + "requested": "[0.11.6, )", + "resolved": "0.11.6", + "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" + }, + "NuGet.Frameworks": { + "type": "CentralTransitive", + "requested": "[6.12.1, )", + "resolved": "6.9.1", + "contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA==" + }, + "ResXResourceReader.NetStandard": { + "type": "CentralTransitive", + "requested": "[1.3.0, )", + "resolved": "1.3.0", + "contentHash": "voW0VHwFGIvbJ4Pp/wfHKFGn9kxZD97H/mnD6LziBJCi4FJZtetYQpQQnpYp0IkL2+PQ6VOzkMvhK1+s7+NJnA==" + }, + "Serilog": { + "type": "CentralTransitive", + "requested": "[4.2.0, )", + "resolved": "4.2.0", + "contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA==" + }, + "TestableIO.System.IO.Abstractions.Wrappers": { + "type": "CentralTransitive", + "requested": "[21.2.1, )", + "resolved": "21.2.1", + "contentHash": "a0jzTAZRIic40USnf8b59EbJ6+hh/kndLV3mTxgSGBkjei/H9qjULOtk/ZHQtRD8lLaUav7ZsMZn6JiwCgDmEw==", + "dependencies": { + "TestableIO.System.IO.Abstractions": "21.2.1" + } + } + } + } +} \ No newline at end of file diff --git a/src/Stryker.TestRunner/Consumers/CoverageConsumer.cs b/src/Stryker.TestRunner/Consumers/CoverageConsumer.cs new file mode 100644 index 0000000000..54d199daec --- /dev/null +++ b/src/Stryker.TestRunner/Consumers/CoverageConsumer.cs @@ -0,0 +1,48 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Extensions.TestHost; +using Stryker.TestRunner.Tests; + +namespace Stryker.TestRunner.Consumers; + +public class CoverageConsumer : IDataConsumer +{ + private readonly CoverageCollector _coverageCollector; + + private CoverageConsumer(CoverageCollector coverageCollector) + { + _coverageCollector = coverageCollector; + } + + public static CoverageConsumer Create(CoverageCollector coverageCollector) => new(coverageCollector); + + public Type[] DataTypesConsumed => [typeof(TestNodeUpdateMessage)]; + + public string Uid => nameof(CoverageConsumer); + + public string Version => "1.0.0"; + + public string DisplayName => "Stryker.CoverageConsumer"; + + public string Description => "Used to gather coverage"; + + public Task IsEnabledAsync() => Task.FromResult(true); + + public Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken) + { + var update = value as TestNodeUpdateMessage; + var state = update!.TestNode.Properties.Single(); + + if (state is InProgressTestNodeStateProperty) + { + _coverageCollector.CaptureCoverageOutsideTests(); + return Task.CompletedTask; + } + + _coverageCollector.PublishCoverageData(update.TestNode); + + return Task.CompletedTask; + } +} diff --git a/src/Stryker.TestRunner/Consumers/DiscoveryConsumer.cs b/src/Stryker.TestRunner/Consumers/DiscoveryConsumer.cs new file mode 100644 index 0000000000..9ef588f8df --- /dev/null +++ b/src/Stryker.TestRunner/Consumers/DiscoveryConsumer.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Extensions.TestHost; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; + +namespace Stryker.TestRunner.Consumers; + +public class DiscoveryConsumer : IDataConsumer +{ + private readonly DiscoveryResult _discoveryResult; + private readonly Uri _executor; + private readonly string _source; + private readonly List _executed; + + private DiscoveryConsumer(string source, Uri executor, DiscoveryResult discoveryResult, List executed) + { + _source = source; + _executor = executor; + _discoveryResult = discoveryResult; + _executed = executed; + } + + public static DiscoveryConsumer Create(string source, Uri executor, DiscoveryResult discoveryResult, List executed) => + new(source, executor, discoveryResult, executed); + + public Type[] DataTypesConsumed => [typeof(TestNodeUpdateMessage)]; + + public string Uid => nameof(DiscoveryConsumer); + + public string Version => "1.0.0"; + + public string DisplayName => "Discovery consumer"; + + public string Description => "Discovery consumer"; + + public Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken) + { + var update = value as TestNodeUpdateMessage; + + var state = update!.TestNode.Properties.Single(); + + if (state is InProgressTestNodeStateProperty) + { + return Task.CompletedTask; + } + + var testCase = new Tests.TestCase(_source, _executor, update.TestNode); + var timing = update.TestNode.Properties.Single(); + var duration = timing.GlobalTiming.Duration; + var testResult = new MsTestResult(duration); + + _discoveryResult.AddTestSource(_source, update.TestNode.Uid); + _discoveryResult.AddTestDescription(update.TestNode.Uid, testCase); + _discoveryResult.AddTest(new TestDescription(testCase.Id.ToString(), testCase.Name, testCase.CodeFilePath)); + _discoveryResult.MsTests[update.TestNode.Uid].RegisterInitialTestResult(testResult); + _executed.Add(update.TestNode); + + return Task.CompletedTask; + } + + public Task IsEnabledAsync() => Task.FromResult(true); +} diff --git a/src/Stryker.TestRunner/Consumers/InitialTestRunConsumer.cs b/src/Stryker.TestRunner/Consumers/InitialTestRunConsumer.cs new file mode 100644 index 0000000000..7609eea230 --- /dev/null +++ b/src/Stryker.TestRunner/Consumers/InitialTestRunConsumer.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Extensions.TestHost; +using Stryker.TestRunner.Results; + +namespace Stryker.TestRunner.Consumers; + +public class InitialTestRunConsumer : IDataConsumer +{ + private readonly DiscoveryResult _discoveryResult; + private readonly List _executed; + + private InitialTestRunConsumer(DiscoveryResult discoveryResult, List executed) + { + _discoveryResult = discoveryResult; + _executed = executed; + } + + public static InitialTestRunConsumer Create(DiscoveryResult discoveryResult, List executed) => + new(discoveryResult, executed); + + public Type[] DataTypesConsumed => [typeof(TestNodeUpdateMessage)]; + + public string Uid => nameof(InitialTestRunConsumer); + + public string Version => "1.0.0"; + + public string DisplayName => "Initial Test Run consumer"; + + public string Description => "Consumes tests during the initial run"; + + public Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken) + { + var update = value as TestNodeUpdateMessage; + + var state = update!.TestNode.Properties.Single(); + + if (state is InProgressTestNodeStateProperty) + { + return Task.CompletedTask; + } + + var timing = update.TestNode.Properties.Single(); + var duration = timing.GlobalTiming.Duration; + var testResult = new MsTestResult(duration); + _discoveryResult.MsTests[update.TestNode.Uid].RegisterInitialTestResult(testResult); + _executed.Add(update.TestNode); + + return Task.CompletedTask; + } + + public Task IsEnabledAsync() => Task.FromResult(true); +} diff --git a/src/Stryker.TestRunner/Consumers/MutantRunConsumer.cs b/src/Stryker.TestRunner/Consumers/MutantRunConsumer.cs new file mode 100644 index 0000000000..26423310b2 --- /dev/null +++ b/src/Stryker.TestRunner/Consumers/MutantRunConsumer.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Extensions.TestHost; + +namespace Stryker.TestRunner.Consumers; +public class MutantRunConsumer : IDataConsumer +{ + private readonly List _executed; + + private MutantRunConsumer(List executed) + { + _executed = executed; + } + + public static MutantRunConsumer Create(List executed) => + new(executed); + + public Type[] DataTypesConsumed => [typeof(TestNodeUpdateMessage)]; + + public string Uid => nameof(MutantRunConsumer); + + public string Version => "1.0.0"; + + public string DisplayName => $"Stryker.{Uid}"; + + public string Description => "Consumes tests during the mutation test run"; + + public Task ConsumeAsync(IDataProducer dataProducer, IData value, CancellationToken cancellationToken) + { + var update = value as TestNodeUpdateMessage; + var state = update!.TestNode.Properties.Single(); + + if (state is InProgressTestNodeStateProperty) + { + return Task.CompletedTask; + } + + _executed.Add(update.TestNode); + return Task.CompletedTask; + } + + public Task IsEnabledAsync() => Task.FromResult(true); +} diff --git a/src/Stryker.TestRunner/Options/RunOptions.cs b/src/Stryker.TestRunner/Options/RunOptions.cs new file mode 100644 index 0000000000..7c6b1d9dc1 --- /dev/null +++ b/src/Stryker.TestRunner/Options/RunOptions.cs @@ -0,0 +1,23 @@ +using System.IO; +using System.Reflection; + +namespace Stryker.TestRunner.Options; + +public static class RunOptions +{ + public const string NoConsole = "--internal-vstest-adapter"; + public const string NoBanner = "--no-banner"; + + public static string DiscoverySettings => $"--settings {GetSettingsPath("discovery.runsettings")}"; + public static string RunSettings => $"--settings {GetSettingsPath("run.runsettings")}"; + public static string CoverageSettings => $"--settings {GetSettingsPath("coverage.runsettings")}"; + + private const string RunSettingsDirectory = "RunSettings"; + + private static string GetSettingsPath(string fileName) => + Path.Combine(CurrentExecutingDirectory, RunSettingsDirectory, fileName); + + + private static string CurrentExecutingDirectory => + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; +} diff --git a/src/Stryker.TestRunner/Results/CoverageRunResult.cs b/src/Stryker.TestRunner/Results/CoverageRunResult.cs new file mode 100644 index 0000000000..9cc0e1993a --- /dev/null +++ b/src/Stryker.TestRunner/Results/CoverageRunResult.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Results; + +public class CoverageRunResult : ICoverageRunResult +{ + public Dictionary MutationFlags { get; } = new(); + + private CoverageRunResult(string testId, CoverageConfidence confidence, IEnumerable coveredMutations, + IEnumerable detectedStaticMutations, IEnumerable leakedMutations) + { + TestId = Identifier.Create(testId); + + foreach (var coveredMutation in coveredMutations) + { + MutationFlags[coveredMutation] = MutationTestingRequirements.None; + } + + foreach (var detectedStaticMutation in detectedStaticMutations) + { + MutationFlags[detectedStaticMutation] = MutationTestingRequirements.Static; + } + + foreach (var leakedMutation in leakedMutations) + { + var requirement = confidence == CoverageConfidence.Exact ? + MutationTestingRequirements.NeedEarlyActivation : + MutationTestingRequirements.CoveredOutsideTest; + + MutationFlags[leakedMutation] = requirement; + } + + Confidence = confidence; + } + + public static CoverageRunResult Create( + string testId, + CoverageConfidence confidence, + IEnumerable coveredMutations, + IEnumerable detectedStaticMutations, + IEnumerable leakedMutations) => new(testId, confidence, coveredMutations, detectedStaticMutations, leakedMutations); + + public MutationTestingRequirements this[int mutation] => MutationFlags.TryGetValue(mutation, out var value) ? value : MutationTestingRequirements.NotCovered; + + public Identifier TestId { get; } + + public IReadOnlyCollection MutationsCovered => MutationFlags.Keys; + + public CoverageConfidence Confidence { get; private set; } + + public void Merge(ICoverageRunResult coverageRunResult) + { + var coverage = (CoverageRunResult)coverageRunResult; + Confidence = (CoverageConfidence)Math.Min((int)Confidence, (int)coverage.Confidence); + foreach (var mutationFlag in coverage.MutationFlags) + { + if (MutationFlags.ContainsKey(mutationFlag.Key)) + { + MutationFlags[mutationFlag.Key] |= mutationFlag.Value; + } + else + { + MutationFlags[mutationFlag.Key] = mutationFlag.Value; + } + } + } +} diff --git a/src/Stryker.TestRunner/Results/DiscoveryResult.cs b/src/Stryker.TestRunner/Results/DiscoveryResult.cs new file mode 100644 index 0000000000..eade959677 --- /dev/null +++ b/src/Stryker.TestRunner/Results/DiscoveryResult.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Tests; + +namespace Stryker.TestRunner.Results; + +public class DiscoveryResult +{ + public IDictionary MsTests { get; private set; } = new Dictionary(); + + public IDictionary> TestsPerSource { get; } = new Dictionary>(); + + public ITestSet Tests { get; } = new TestSet(); + + public ITestSet GetTestsForSources(IEnumerable sources) + { + var result = new TestSet(); + foreach (var source in sources) + { + result.RegisterTests(TestsPerSource[source].Select(id => Tests[Identifier.Create(id)])); + } + + return result; + } + public IEnumerable GetValidSources(IEnumerable sources) => + sources.Where(s => TestsPerSource.TryGetValue(s, out var result) && result.Count > 0); + + public void AddTestSource(string source, string testId) + { + var hasValue = TestsPerSource.TryGetValue(source, out var result); + + if (hasValue) + { + result!.Add(testId); + return; + } + + TestsPerSource.Add(source, new HashSet { testId }); + } + + public void AddTestDescription(string testId, ITestCase testCase) + { + var hasValue = MsTests.TryGetValue(testId, out var result); + + if (hasValue) + { + result!.AddSubCase(); + return; + } + + MsTests.Add(testId, new MsTestDescription(testCase)); + } + + public void AddTest(ITestDescription testDescription) => Tests.RegisterTest(testDescription); +} diff --git a/src/Stryker.TestRunner/Results/MsTestResult.cs b/src/Stryker.TestRunner/Results/MsTestResult.cs new file mode 100644 index 0000000000..2bda316634 --- /dev/null +++ b/src/Stryker.TestRunner/Results/MsTestResult.cs @@ -0,0 +1,14 @@ +using System; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Results; + +internal class MsTestResult : ITestResult +{ + public MsTestResult(TimeSpan duration) + { + Duration = duration; + } + + public TimeSpan Duration { get; } +} diff --git a/src/Stryker.TestRunner/Results/TestRunResult.cs b/src/Stryker.TestRunner/Results/TestRunResult.cs new file mode 100644 index 0000000000..e91e7a44fd --- /dev/null +++ b/src/Stryker.TestRunner/Results/TestRunResult.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Tests; + +namespace Stryker.TestRunner.Results; + +public class TestRunResult : ITestRunResult +{ + public TestRunResult(bool success, string message = null) + { + TestDescriptions = new List(); + FailingTests = !success ? TestIdentifierList.EveryTest() : TestIdentifierList.NoTest(); + ExecutedTests = TestIdentifierList.EveryTest(); + TimedOutTests = TestIdentifierList.NoTest(); + ResultMessage = message; + Duration = TimeSpan.Zero; + } + + public TestRunResult( + IEnumerable vsTestDescriptions, + ITestIdentifiers executedTests, + ITestIdentifiers failedTests, + ITestIdentifiers timedOutTest, + string message, + IEnumerable messages, + TimeSpan timeSpan) + { + TestDescriptions = vsTestDescriptions.Where(p => executedTests.GetIdentifiers().Contains(p.Id)).ToList(); + ExecutedTests = executedTests; + FailingTests = failedTests; + TimedOutTests = timedOutTest; + ResultMessage = message; + Messages = messages; + Duration = timeSpan; + } + + public static TestRunResult TimedOut( + IEnumerable vsTestDescriptions, + ITestIdentifiers ranTests, + ITestIdentifiers failedTest, + ITestIdentifiers timedOutTests, + string message, + IEnumerable messages, + TimeSpan duration) => new(vsTestDescriptions, ranTests, failedTest, timedOutTests, message, messages, duration) { SessionTimedOut = true }; + + public ITestIdentifiers FailingTests { get; } + public ITestIdentifiers ExecutedTests { get; } + public ITestIdentifiers TimedOutTests { get; } + public bool SessionTimedOut { get; private init; } + public string ResultMessage { get; } + public IEnumerable Messages { get; } + public TimeSpan Duration { get; } + public IEnumerable TestDescriptions { get; } +} diff --git a/src/Stryker.TestRunner/Stryker.TestRunner.csproj b/src/Stryker.TestRunner/Stryker.TestRunner.csproj new file mode 100644 index 0000000000..20efdb0c18 --- /dev/null +++ b/src/Stryker.TestRunner/Stryker.TestRunner.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + + + + + + + + + + + + + diff --git a/src/Stryker.TestRunner/TestProjects/ITestProject.cs b/src/Stryker.TestRunner/TestProjects/ITestProject.cs new file mode 100644 index 0000000000..3a1983a31a --- /dev/null +++ b/src/Stryker.TestRunner/TestProjects/ITestProject.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Testing.Platform.Extensions.Messages; +using Stryker.TestRunner.Results; +using Stryker.TestRunner.Tests; + +namespace Stryker.TestRunner.TestProjects; + +public interface ITestProject +{ + Task Discover(DiscoveryResult discoveryResult, List executed, string assemblyPath); + Task InitialTestRun(DiscoveryResult discoveryResult, List executed); + Task CoverageRun(CoverageCollector coverageCollector); + Task MutantRun(MutantController mutantController, IEnumerable? testCases, List executed); +} diff --git a/src/Stryker.TestRunner/Tests/CoverageCollector.cs b/src/Stryker.TestRunner/Tests/CoverageCollector.cs new file mode 100644 index 0000000000..c8b9381708 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/CoverageCollector.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Microsoft.Testing.Platform.Extensions.Messages; +using Stryker.Abstractions.Testing; +using Stryker.TestRunner.Results; + +namespace Stryker.TestRunner.Tests; + +public class CoverageCollector +{ + private readonly DiscoveryResult _discoveryResult; + private readonly List _testCoverageInfos = []; + + private List _mutationCoveredOutsideTests = []; + + private CoverageCollector(DiscoveryResult discoveryResult, string helperNamespace) + { + _discoveryResult = discoveryResult; + MutantControlClassName = $"{helperNamespace}.MutantControl"; + } + + public static CoverageCollector Create(DiscoveryResult discoveryResult, string helperNamespace) => new(discoveryResult, helperNamespace); + + public string MutantControlClassName { get; } + + public FieldInfo CaptureCoverageField { get; set; } + + public MethodInfo GetCoverageDataMethod { get; set; } + + public IList[] RetrieveCoverData() + => (IList[])GetCoverageDataMethod?.Invoke(null, []); + + public void CaptureCoverageOutsideTests() + { + var covered = RetrieveCoverData(); + if (covered?[0] is not null) + { + _mutationCoveredOutsideTests = + covered[1] is not null ? covered[0].Union(covered[1]).ToList() : [.. covered[0]]; + } + else if (covered?[1] is not null) + { + _mutationCoveredOutsideTests = [.. covered[1]]; + } + } + + public void PublishCoverageData(TestNode testNode) + { + var covered = RetrieveCoverData(); + + if (covered is null) + { + return; + } + + var testCoverageInfo = new TestCoverageInfo( + testNode, + covered[0], + covered[1], + _mutationCoveredOutsideTests); + + _testCoverageInfos.Add(testCoverageInfo); + _mutationCoveredOutsideTests.Clear(); + } + + public void SetCoverage(bool enabled) => CaptureCoverageField?.SetValue(null, enabled); + + public IEnumerable GetCoverageRunResult(bool perIsolatedTest) + { + var seenTestCases = new HashSet(); + var defaultConfidence = perIsolatedTest ? CoverageConfidence.Exact : CoverageConfidence.Normal; + var resultCache = new Dictionary(); + + foreach (var testCoverageInfo in _testCoverageInfos) + { + var outcome = testCoverageInfo.TestNode.Properties.Single(); + + if (outcome is not PassedTestNodeStateProperty && outcome is not FailedTestNodeStateProperty) + { + continue; + } + + if (TryConvertToCoverageResult(testCoverageInfo, seenTestCases, defaultConfidence, out var coverageRunResult)) + { + continue; + } + + if (!resultCache.TryAdd(coverageRunResult!.TestId.ToString(), coverageRunResult)) + { + resultCache[coverageRunResult.TestId.ToString()].Merge(coverageRunResult); + } + } + + return resultCache.Values; + } + + private bool TryConvertToCoverageResult(TestCoverageInfo testCoverageInfo, ISet seenTestCases, CoverageConfidence defaultConfidence, out CoverageRunResult coverageRunResult) + { + var testCaseId = testCoverageInfo.TestNode.Uid.Value; + + if (!_discoveryResult.MsTests.TryGetValue(testCaseId, out var testDescription)) + { + throw new NotImplementedException(); + } + + if (seenTestCases.Contains(testCaseId)) + { + coverageRunResult = null; + return true; + } + + seenTestCases.Add(testDescription.Id.ToString()); + coverageRunResult = CoverageRunResult.Create(testCaseId, defaultConfidence, testCoverageInfo.CoveredMutations, testCoverageInfo.CoveredStaticMutations, testCoverageInfo.LeakedMutations); + + return false; + } +} diff --git a/src/Stryker.TestRunner/Tests/MsTestDescription.cs b/src/Stryker.TestRunner/Tests/MsTestDescription.cs new file mode 100644 index 0000000000..4681bfb18c --- /dev/null +++ b/src/Stryker.TestRunner/Tests/MsTestDescription.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +public class MsTestDescription : IFrameworkTestDescription +{ + private readonly ICollection _initialResults = []; + + private int _subCases; + + public MsTestDescription(ITestCase testCase) + { + Case = testCase; + Description = new TestDescription(testCase.Id.ToString(), testCase.Name, testCase.CodeFilePath); + } + + public TestFrameworks Framework => + Case.Uri.AbsolutePath.Contains("xunit") ? TestFrameworks.xUnit : + Case.Uri.AbsolutePath.Contains("mstest") ? TestFrameworks.MsTest : + TestFrameworks.NUnit; + + public ITestDescription Description { get; } + + public TimeSpan InitialRunTime => TimeSpan.FromTicks(_initialResults.Sum(t => t.Duration.Ticks)); + + public Identifier Id => Case.Id; + + public int NbSubCases => Math.Max(_subCases, _initialResults.Count); + public ITestCase Case { get; } + + public void AddSubCase() => _subCases++; + + public void ClearInitialResult() => _initialResults.Clear(); + + public void RegisterInitialTestResult(ITestResult result) => _initialResults.Add(result); +} diff --git a/src/Stryker.TestRunner/Tests/MutantController.cs b/src/Stryker.TestRunner/Tests/MutantController.cs new file mode 100644 index 0000000000..1494661036 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/MutantController.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Reflection; + +namespace Stryker.TestRunner.Tests; + +public class MutantController +{ + private readonly IEnumerable _mutants; + + private MutantController(string helperNamespace, IEnumerable mutants) + { + MutantControlClassName = $"{helperNamespace}.MutantControl"; + _mutants = mutants; + } + + public static MutantController Create(string helperNamespace, IEnumerable mutants) => new(helperNamespace, mutants); + + public FieldInfo IsAsyncRunField { get; set; } + public MethodInfo InitAsyncRunMethod { get; set; } + + public string MutantControlClassName { get; } + + public void SetAsync(bool enabled) => IsAsyncRunField?.SetValue(null, enabled); + + public void InitAsyncRun() => InitAsyncRunMethod?.Invoke(null, [_mutants]); +} diff --git a/src/Stryker.TestRunner/Tests/TestCase.cs b/src/Stryker.TestRunner/Tests/TestCase.cs new file mode 100644 index 0000000000..e8d70bede4 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestCase.cs @@ -0,0 +1,37 @@ +using System; +using Microsoft.Testing.Extensions.TrxReport.Abstractions; +using Microsoft.Testing.Platform.Extensions.Messages; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +public class TestCase : ITestCase +{ + public TestCase(string source, Uri executor, TestNode testNode) + { + var fileLocation = testNode.Properties.Single(); + var fullyQualifiedName = testNode.Properties.Single(); + + Id = Identifier.Create(testNode.Uid); + Name = testNode.DisplayName; + Source = source; + CodeFilePath = fileLocation.FilePath; + FullyQualifiedName = fullyQualifiedName.FullyQualifiedTypeName; + Uri = executor; + LineNumber = fileLocation.LineSpan.Start.Line; + } + + public Identifier Id { get; } + + public string Name { get; } + + public string Source { get; } + + public string CodeFilePath { get; } + + public string FullyQualifiedName { get; } + + public Uri Uri { get; } + + public int LineNumber { get; } +} diff --git a/src/Stryker.TestRunner/Tests/TestCoverageInfo.cs b/src/Stryker.TestRunner/Tests/TestCoverageInfo.cs new file mode 100644 index 0000000000..57ca964a55 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestCoverageInfo.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Microsoft.Testing.Platform.Extensions.Messages; + +namespace Stryker.TestRunner.Tests; + +internal class TestCoverageInfo +{ + private readonly IList _coveredMutations; + private readonly IList _coveredStaticMutations; + private readonly IList _leakedMutationsFromPreviousTest; + + public TestCoverageInfo(TestNode testNode, IList coveredMutations, IList coveredStaticMutations, IList leakedMutationsFromPreviousTest) + { + TestNode = testNode; + _coveredMutations = coveredMutations; + _coveredStaticMutations = coveredStaticMutations; + _leakedMutationsFromPreviousTest = leakedMutationsFromPreviousTest; + } + + public TestNode TestNode { get; } + + public IList CoveredMutations => [.. _coveredMutations]; + public IList CoveredStaticMutations => [.. _coveredStaticMutations]; + public IList LeakedMutations => [.. _leakedMutationsFromPreviousTest]; + + public bool HasLeakedMutations => LeakedMutations.Count > 0; +} diff --git a/src/Stryker.TestRunner/Tests/TestDescription.cs b/src/Stryker.TestRunner/Tests/TestDescription.cs new file mode 100644 index 0000000000..d28a4688e6 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestDescription.cs @@ -0,0 +1,18 @@ +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; +internal class TestDescription : ITestDescription +{ + public TestDescription(string id, string name, string testFilePath) + { + Id = Identifier.Create(id); + Name = name; + TestFilePath = testFilePath; + } + + public Identifier Id { get; } + + public string Name { get; } + + public string TestFilePath { get; } +} diff --git a/src/Stryker.TestRunner/Tests/TestGuidsList.cs b/src/Stryker.TestRunner/Tests/TestGuidsList.cs new file mode 100644 index 0000000000..cc82cb4626 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestGuidsList.cs @@ -0,0 +1,89 @@ +using Stryker.Abstractions.Testing; +using System.Collections.Generic; +using System; +using System.Linq; + +namespace Stryker.TestRunner.Tests; + +public class TestGuidsList : ITestIdentifiers +{ + private readonly HashSet? _identifiers; + + private static readonly TestGuidsList everyTests = new(); + private static readonly TestGuidsList noTestAtAll = new(Array.Empty()); + + private TestGuidsList() => _identifiers = null; + + public TestGuidsList(IEnumerable testDescriptions) : this(testDescriptions.Select(t => t.Id.ToGuid())) + { } + + public TestGuidsList(IEnumerable identifiers) => _identifiers = new HashSet(identifiers); + + public TestGuidsList(HashSet identifiers) => _identifiers = identifiers; + + public TestGuidsList(HashSet set) => _identifiers = set.Select(Identifier.Create).ToHashSet(); + + public TestGuidsList(IEnumerable? guids) => _identifiers = guids is not null ? new HashSet(guids.Select(Identifier.Create)) : null; + + public TestGuidsList(params Guid[] guids) : this((IEnumerable)guids) + { } + + public bool IsEmpty => _identifiers is { Count: 0 }; + + public bool IsEveryTest => _identifiers is null; + + public int Count => _identifiers?.Count ?? 0; + + public ITestIdentifiers Merge(ITestIdentifiers other) + { + if (IsEveryTest) + { + return this; + } + + var result = new HashSet(_identifiers ?? []); + result.UnionWith(other.GetIdentifiers()); + return new TestGuidsList(result); + } + + public bool Contains(Identifier testId) => IsEveryTest || _identifiers?.Contains(testId) is false; + + public bool IsIncludedIn(ITestIdentifiers other) => other.IsEveryTest || _identifiers?.IsSubsetOf(other.GetIdentifiers()) is true; + + public ITestIdentifiers Excluding(ITestIdentifiers testsToSkip) + { + if (IsEmpty || testsToSkip.IsEmpty) + { + return this; + } + + if (IsEveryTest) + { + throw new InvalidOperationException("Can't exclude from EveryTest"); + } + + return testsToSkip.IsEveryTest ? NoTest() : new TestGuidsList(_identifiers.Except(testsToSkip.GetIdentifiers())); + } + + public static TestGuidsList EveryTest() => everyTests; + + public static TestGuidsList NoTest() => noTestAtAll; + + public IEnumerable GetIdentifiers() => _identifiers ?? []; + + public bool ContainsAny(ITestIdentifiers other) + { + if (other.IsEmpty || IsEmpty) + { + return false; + } + if (IsEveryTest || other.IsEveryTest) + { + return true; + } + + return GetIdentifiers().Intersect(other.GetIdentifiers()).Any(); + } + + public ITestIdentifiers Intersect(ITestIdentifiers other) => IsEveryTest ? new TestGuidsList(other.GetIdentifiers()) : new TestGuidsList(GetIdentifiers().Intersect(other.GetIdentifiers())); +} diff --git a/src/Stryker.TestRunner/Tests/TestIdentifierList.cs b/src/Stryker.TestRunner/Tests/TestIdentifierList.cs new file mode 100644 index 0000000000..0a26b59329 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestIdentifierList.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +public class TestIdentifierList : ITestIdentifiers +{ + private readonly HashSet? _identifiers; + + private static readonly TestIdentifierList everyTests = new(); + private static readonly TestIdentifierList noTestAtAll = new(Array.Empty()); + + private TestIdentifierList() => _identifiers = null; + + public TestIdentifierList(IEnumerable testDescriptions) : this(testDescriptions.Select(t => t.Id.ToString())) + { } + + public TestIdentifierList(IEnumerable identifiers) => _identifiers = identifiers != null ? new HashSet(identifiers) : null; + + public TestIdentifierList(HashSet identifiers) => _identifiers = identifiers; + + public TestIdentifierList(HashSet set) => _identifiers = set?.Select(Identifier.Create).ToHashSet(); + + public TestIdentifierList(IEnumerable? ids) => _identifiers = ids is not null ? new HashSet(ids.Select(Identifier.Create)) : null; + + public TestIdentifierList(params string[] ids) : this((IEnumerable)ids) + { } + + public static ITestIdentifiers EveryTest() => everyTests; + + public static ITestIdentifiers NoTest() => noTestAtAll; + + public int Count => _identifiers?.Count ?? 0; + + public bool IsEmpty => _identifiers is { Count: 0 }; + + public bool IsEveryTest => _identifiers is null; + + public void AddIdentifier(Identifier identifier) + { + _identifiers?.Add(identifier); + } + + public IEnumerable GetIdentifiers() => _identifiers ?? []; + + public bool Contains(Identifier testId) => IsEveryTest || _identifiers?.Contains(testId) is false; + + public ITestIdentifiers Intersect(ITestIdentifiers other) => IsEveryTest ? new TestIdentifierList(other.GetIdentifiers()) : new TestIdentifierList(GetIdentifiers().Intersect(other.GetIdentifiers())); + + public bool IsIncludedIn(ITestIdentifiers other) => other.IsEveryTest || _identifiers?.IsSubsetOf(other.GetIdentifiers()) is true; + + public bool ContainsAny(ITestIdentifiers other) + { + if (other.IsEmpty || IsEmpty) + { + return false; + } + if (IsEveryTest || other.IsEveryTest) + { + return true; + } + + return GetIdentifiers().Intersect(other.GetIdentifiers()).Any(); + } + + public ITestIdentifiers Merge(ITestIdentifiers other) + { + if (IsEveryTest) + { + return this; + } + + var result = new HashSet(_identifiers ?? []); + result.UnionWith(other.GetIdentifiers()); + return new TestIdentifierList(result); + } + + public ITestIdentifiers Excluding(ITestIdentifiers testsToSkip) + { + if (IsEmpty || testsToSkip.IsEmpty) + { + return this; + } + + if (IsEveryTest) + { + throw new InvalidOperationException("Can't exclude from EveryTest"); + } + + return testsToSkip.IsEveryTest ? NoTest() : new TestIdentifierList(_identifiers.Except(testsToSkip.GetIdentifiers())); + } +} diff --git a/src/Stryker.TestRunner/Tests/TestSet.cs b/src/Stryker.TestRunner/Tests/TestSet.cs new file mode 100644 index 0000000000..4af60eff04 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/TestSet.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +internal class TestSet : ITestSet +{ + private readonly IDictionary _tests = new Dictionary(); + public int Count => _tests.Count; + public ITestDescription this[Identifier id] => _tests[id.ToString()]; + + public void RegisterTests(IEnumerable tests) + { + foreach (var test in tests) + { + RegisterTest(test); + } + } + + public void RegisterTest(ITestDescription test) => _tests[test.Id.ToString()] = test; + + public IEnumerable Extract(IEnumerable ids) => ids.Select(i => _tests[i.ToString()]); +} diff --git a/src/Stryker.TestRunner/Tests/WrappedGuidsEnumeration.cs b/src/Stryker.TestRunner/Tests/WrappedGuidsEnumeration.cs new file mode 100644 index 0000000000..a593f1b40d --- /dev/null +++ b/src/Stryker.TestRunner/Tests/WrappedGuidsEnumeration.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +public class WrappedGuidsEnumeration : ITestIdentifiers +{ + private readonly IEnumerable _identifiers; + + public int Count => _identifiers.Count(); + + public bool IsEmpty => _identifiers is null || !_identifiers.Any(); + + public bool IsEveryTest => false; + + public ITestIdentifiers Merge(ITestIdentifiers other) => MergeList(this, other); + + public bool Contains(Identifier testId) => _identifiers.Any(g => g == testId); + + public bool ContainsAny(ITestIdentifiers other) => _identifiers.Any(other.Contains); + + public bool IsIncludedIn(ITestIdentifiers other) => _identifiers.All(other.Contains); + + public WrappedGuidsEnumeration(IEnumerable guids) => _identifiers = guids.Select(Identifier.Create); + + public WrappedGuidsEnumeration(IEnumerable identifiers) => _identifiers = identifiers; + + public static ITestIdentifiers MergeList(ITestIdentifiers a, ITestIdentifiers b) + { + if (a.GetIdentifiers() is null) + { + return b; + } + + return b.GetIdentifiers() is null ? a : new WrappedGuidsEnumeration(a.GetIdentifiers().Union(b.GetIdentifiers())); + } + + public IEnumerable GetIdentifiers() => _identifiers; + + public ITestIdentifiers Intersect(ITestIdentifiers other) => IsEveryTest ? new WrappedGuidsEnumeration(other.GetIdentifiers()) : new WrappedGuidsEnumeration(_identifiers.Intersect(other.GetIdentifiers())); + + public ITestIdentifiers Excluding(ITestIdentifiers testsToSkip) => throw new NotImplementedException(); +} diff --git a/src/Stryker.TestRunner/Tests/WrappedIdentifierEnumeration.cs b/src/Stryker.TestRunner/Tests/WrappedIdentifierEnumeration.cs new file mode 100644 index 0000000000..f1bdd664e5 --- /dev/null +++ b/src/Stryker.TestRunner/Tests/WrappedIdentifierEnumeration.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Stryker.Abstractions.Testing; + +namespace Stryker.TestRunner.Tests; + +public class WrappedIdentifierEnumeration : ITestIdentifiers +{ + private readonly IEnumerable _identifiers; + + public WrappedIdentifierEnumeration(IEnumerable ids) => _identifiers = ids.Select(Identifier.Create); + public WrappedIdentifierEnumeration(IEnumerable identifiers) => _identifiers = identifiers; + + public int Count => _identifiers.Count(); + public bool IsEmpty => _identifiers is null || !_identifiers.Any(); + public bool IsEveryTest => false; + + public ITestIdentifiers Merge(ITestIdentifiers other) => MergeList(this, other); + + public bool Contains(Identifier testId) => _identifiers.Any(g => g == testId); + + public bool ContainsAny(ITestIdentifiers other) => _identifiers.Any(other.Contains); + + public bool IsIncludedIn(ITestIdentifiers other) => _identifiers.All(other.Contains); + + public static ITestIdentifiers MergeList(ITestIdentifiers a, ITestIdentifiers b) + { + if (a.GetIdentifiers() is null) + { + return b; + } + + return b.GetIdentifiers() is null ? a : new WrappedIdentifierEnumeration(a.GetIdentifiers().Union(b.GetIdentifiers())); + } + + public IEnumerable GetIdentifiers() => _identifiers; + + public ITestIdentifiers Intersect(ITestIdentifiers other) => IsEveryTest ? new WrappedIdentifierEnumeration(other.GetIdentifiers()) : new WrappedIdentifierEnumeration(_identifiers.Intersect(other.GetIdentifiers())); + + public ITestIdentifiers Excluding(ITestIdentifiers testsToSkip) => throw new NotImplementedException(); +} diff --git a/src/Stryker.TestRunner/packages.lock.json b/src/Stryker.TestRunner/packages.lock.json new file mode 100644 index 0000000000..299534e402 --- /dev/null +++ b/src/Stryker.TestRunner/packages.lock.json @@ -0,0 +1,364 @@ +{ + "version": 2, + "dependencies": { + "net8.0": { + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.2.25, )", + "resolved": "1.2.25", + "contentHash": "xCXiw7BCxHJ8pF6wPepRUddlh2dlQlbr81gXA72hdk4FLHkKXas7EH/n+fk5UCA/YfMqG1Z6XaPiUjDbUNBUzg==" + }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "+AW10NEScLAiErRKzek5U1Kv0B337EktcLt6ruzJXFTbtdQgK+3j0jxWbnfSs1N+R1eX2AsNF9/en7hWW8DDfg==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.0", + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "Microsoft.Testing.Platform": { + "type": "Direct", + "requested": "[1.5.0, )", + "resolved": "1.5.0", + "contentHash": "L6MsgthfCEuqx4Z3VWmUzilFN4I4hrRIXY0UgGTP9sv9upt1V9m5x9m7fWUKRrnzoE8yTFeRxw1KaI9XmXIzRA==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Direct", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Buildalyzer.Logger": { + "type": "Transitive", + "resolved": "7.1.0", + "contentHash": "a0T+Se+HSCxOvP2s7kUbgHBVeeJghliN9CO3pSl8JfqPhKD9JaE7ZxS3iTEgKglDsRibcqbdIxhYvvvIdLOvuQ==" + }, + "Microsoft.Build": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "ZmGA8vhVXFzC4oo48ybQKlEybVKd0Ntfdr+Enqrn5ES1R6e/krIK9hLk0W33xuT0/G6QYd3YdhJZh+Xle717Ag==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.MetadataLoadContext": "8.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.Tasks.Dataflow": "8.0.0" + } + }, + "Microsoft.Build.Framework": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "4qXCwNOXBR1dyCzuks9SwTwFJQO/xmf2wcMislotDWJu7MN/r3xDNoU8Ae5QmKIHPaLG1xmfDkYS7qBVzxmeKw==" + }, + "Microsoft.Build.Tasks.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "k1sefpk2VvJNwcexMjisH+TdzhspCVRtYvh4fAez5qRM20VvsNxcOIjfDe3h3StZRIGI2aiFKGxBZYkwM+WV+A==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.Build.Utilities.Core": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.CodeDom": "8.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Resources.Extensions": "8.0.0", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Security.Cryptography.Xml": "8.0.0" + } + }, + "Microsoft.Build.Utilities.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "eEB/tcXkSV+nQgvoa/l53UPtn+KVtKZ8zBceDZsXVTrfE4fA+4+/olrx9W8n2tq4XiESsL9UuGJgCKzqBwQCoQ==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NET.StringTools": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "wyABaqY+IHCMMSTQmcc3Ca6vbmg5BaEPgicnEgpll+4xyWZWlkQqUwafweUd9VAhBb4jqplMl6voUHQ6yfdUcg==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "3vMXWbqqy3rSXYlPshR7CPqG0bgGDOhasyhVtqhAOy2tMED6VKU/IbKNMUmEuqgPNjMkCaicDTfNdXsrJPKcsw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.0" + } + }, + "MSBuild.StructuredLogger": { + "type": "Transitive", + "resolved": "2.2.158", + "contentHash": "A7hI65/MrDKdPpu4rsnqimDdAs42B05gpfOIyzWPJ+pqw6Q3p4r1I/AjWVe3joKGHIQSpL+0AX2tzLVVCaR0ug==", + "dependencies": { + "Microsoft.Build.Framework": "17.5.0", + "Microsoft.Build.Utilities.Core": "17.5.0" + } + }, + "MsBuildPipeLogger.Server": { + "type": "Transitive", + "resolved": "1.1.6", + "contentHash": "rls0hb7plSfVFCqScDxTqtGpIlMfoQEchqjmK/YtXDML11GU5jI+oCi9YsikGulJVUv/vLSY6Ktah0uXwv25EA==", + "dependencies": { + "Microsoft.Build": "15.3.409" + } + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==", + "dependencies": { + "System.Diagnostics.EventLog": "8.0.0", + "System.Security.Cryptography.ProtectedData": "8.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AJukBuLoe3QeAF+mfaRKQb2dgyrvt340iMBHYv+VdBzCUM06IxGlvl0o/uPOS7lHnXPN6u8fFRHSHudx5aTi8w==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Reflection.MetadataLoadContext": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "System.Resources.Extensions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.Cryptography.Pkcs": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "dependencies": { + "System.Formats.Asn1": "8.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==" + }, + "System.Security.Cryptography.Xml": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==", + "dependencies": { + "System.Security.Cryptography.Pkcs": "8.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Threading.Tasks.Dataflow": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "7V0I8tPa9V7UxMx/+7DIwkhls5ouaEMQx6l/GwGm1Y8kJQ61On9B/PxCXFLbgu5/C47g0BP2CUYs+nMv1+Oaqw==" + }, + "TestableIO.System.IO.Abstractions": { + "type": "Transitive", + "resolved": "21.2.1", + "contentHash": "47NQXrfVUF+0b8W5EMnERR7FpgWE04wuYR1s9WvlNyh1hnRMGDPOvmewBLIZUG88Rhj9buzG3VVR8sAgH7TzjA==" + }, + "stryker.abstractions": { + "type": "Project", + "dependencies": { + "Buildalyzer": "[7.1.0, )", + "DotNet.Glob": "[3.1.3, )", + "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", + "Microsoft.CodeAnalysis.Common": "[4.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Serilog": "[4.2.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + } + }, + "Buildalyzer": { + "type": "CentralTransitive", + "requested": "[7.1.0, )", + "resolved": "7.1.0", + "contentHash": "U6e7mHdQC672lfvqNVp70jQGb8g3aPnLafnFnnrzUwFfPX+4tK5uk3Ah+1R3svyG5kc3Qu9ZjBrhcvml/IwXrw==", + "dependencies": { + "Buildalyzer.Logger": "7.1.0", + "MSBuild.StructuredLogger": "2.2.158", + "Microsoft.Build": "17.10.4", + "Microsoft.Build.Tasks.Core": "17.10.4", + "Microsoft.CodeAnalysis.CSharp": "4.0.0", + "Microsoft.CodeAnalysis.VisualBasic": "4.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "MsBuildPipeLogger.Server": "1.1.6", + "NuGet.Frameworks": "6.9.1" + } + }, + "DotNet.Glob": { + "type": "CentralTransitive", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "hOfHw7MLJw/tbXaFwR1oiDb+dIXDp8URTxp5Pco42OOhiw77wrUNx6v6syNygHZbWwYdXQocL2Mo1l5FnfDVjg==" + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "CentralTransitive", + "requested": "[3.11.0, )", + "resolved": "3.3.4", + "contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.12.0", + "contentHash": "c1kNYihL2gdcuU1dqm8R8YeA4YkB43TpU3pa2r66Uooh6AAhRtENzj9A4Kj0a+H8JDDyuTjNZql9XlVUzV+UjA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.12.0", + "contentHash": "30vVQ1MizeC22iEdEvI2w0eTIYG43/L20yBzuQH01xKzJgHAoWehzI2F8u07o4mXh4DGMOjQF7aEm0zzvsG3Mg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "Microsoft.CodeAnalysis.Common": "[4.12.0]", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "Microsoft.CodeAnalysis.VisualBasic": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.0.0", + "contentHash": "FK+OGUMUh9O6/GCwyIy4c/sOrarF36/yEY07BbXVYMql1qCqHGWfyWXyCQKQ6m/KqReCqW6aO4cK7kK/AYBpyA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[4.0.0]" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[9.0.0, )", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[9.0.0, )", + "resolved": "6.0.0", + "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" + }, + "NuGet.Frameworks": { + "type": "CentralTransitive", + "requested": "[6.12.1, )", + "resolved": "6.9.1", + "contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA==" + }, + "Serilog": { + "type": "CentralTransitive", + "requested": "[4.2.0, )", + "resolved": "4.2.0", + "contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA==" + }, + "TestableIO.System.IO.Abstractions.Wrappers": { + "type": "CentralTransitive", + "requested": "[21.2.1, )", + "resolved": "21.2.1", + "contentHash": "a0jzTAZRIic40USnf8b59EbJ6+hh/kndLV3mTxgSGBkjei/H9qjULOtk/ZHQtRD8lLaUav7ZsMZn6JiwCgDmEw==", + "dependencies": { + "TestableIO.System.IO.Abstractions": "21.2.1" + } + } + } + } +} \ No newline at end of file diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultCSharpExtensions.cs b/src/Stryker.Utilities/Buildalyzer/IAnalyzerResultCSharpExtensions.cs similarity index 96% rename from src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultCSharpExtensions.cs rename to src/Stryker.Utilities/Buildalyzer/IAnalyzerResultCSharpExtensions.cs index aaa53d02dc..6b11389856 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultCSharpExtensions.cs +++ b/src/Stryker.Utilities/Buildalyzer/IAnalyzerResultCSharpExtensions.cs @@ -2,10 +2,9 @@ using Buildalyzer; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; -using Stryker.Abstractions; using Stryker.Abstractions.Options; -namespace Stryker.Core.Initialisation.Buildalyzer; +namespace Stryker.Utilities.Buildalyzer; public static class IAnalyzerResultCSharpExtensions { diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultExtensions.cs b/src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs similarity index 90% rename from src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultExtensions.cs rename to src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs index c4cad977ef..b55e94fddc 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/Buildalyzer/IAnalyzerResultExtensions.cs +++ b/src/Stryker.Utilities/Buildalyzer/IAnalyzerResultExtensions.cs @@ -10,10 +10,11 @@ using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.Extensions.Logging; using NuGet.Frameworks; +using Stryker.Abstractions; using Stryker.Abstractions.Exceptions; -using Stryker.Utilities; +using Stryker.Utilities.EmbeddedResources; -namespace Stryker.Core.Initialisation.Buildalyzer; +namespace Stryker.Utilities.Buildalyzer; public static class IAnalyzerResultExtensions { @@ -118,7 +119,7 @@ public static IEnumerable LoadReferences(this IAnalyzerResult } } - private sealed class AnalyzerAssemblyLoader : IAnalyzerAssemblyLoader + public sealed class AnalyzerAssemblyLoader : IAnalyzerAssemblyLoader { public static readonly IAnalyzerAssemblyLoader Instance = new AnalyzerAssemblyLoader(); @@ -132,7 +133,7 @@ public Assembly LoadFromPath(string fullPath) => Assembly.LoadFrom(fullPath); //NOSONAR we actually need to load a specified file, not a specific assembly } - internal static NuGetFramework GetNuGetFramework(this IAnalyzerResult analyzerResult) + public static NuGetFramework GetNuGetFramework(this IAnalyzerResult analyzerResult) { var framework = NuGetFramework.Parse(analyzerResult.TargetFramework); if (framework != NuGetFramework.UnsupportedFramework) @@ -148,7 +149,7 @@ internal static NuGetFramework GetNuGetFramework(this IAnalyzerResult analyzerRe throw new InputException(message); } - internal static bool TargetsFullFramework(this IAnalyzerResult analyzerResult) => analyzerResult.GetNuGetFramework().IsDesktop(); + public static bool TargetsFullFramework(this IAnalyzerResult analyzerResult) => analyzerResult.GetNuGetFramework().IsDesktop(); public static Language GetLanguage(this IAnalyzerResult analyzerResult) => analyzerResult.GetPropertyOrDefault("Language") switch @@ -176,7 +177,7 @@ public static bool IsTestProject(this IAnalyzerResult analyzerResult) return isTestProject || hasTestProjectTypeGuid; } - internal static OutputKind GetOutputKind(this IAnalyzerResult analyzerResult) => + public static OutputKind GetOutputKind(this IAnalyzerResult analyzerResult) => analyzerResult.GetPropertyOrDefault("OutputType") switch { "Exe" => OutputKind.ConsoleApplication, @@ -187,16 +188,16 @@ internal static OutputKind GetOutputKind(this IAnalyzerResult analyzerResult) => _ => OutputKind.DynamicallyLinkedLibrary }; - internal static bool IsSignedAssembly(this IAnalyzerResult analyzerResult) => + public static bool IsSignedAssembly(this IAnalyzerResult analyzerResult) => analyzerResult.GetPropertyOrDefault("SignAssembly", false); - internal static string GetAssemblyOriginatorKeyFile(this IAnalyzerResult analyzerResult) + public static string GetAssemblyOriginatorKeyFile(this IAnalyzerResult analyzerResult) { var assemblyKeyFileProp = analyzerResult.GetPropertyOrDefault("AssemblyOriginatorKeyFile"); return assemblyKeyFileProp is null ? null : Path.Combine(Path.GetDirectoryName(analyzerResult.ProjectFilePath) ?? ".", assemblyKeyFileProp); } - internal static ImmutableDictionary GetDiagnosticOptions( + public static ImmutableDictionary GetDiagnosticOptions( this IAnalyzerResult analyzerResult) { var noWarnString = analyzerResult.GetPropertyOrDefault("NoWarn"); @@ -234,18 +235,18 @@ private static IEnumerable ParseDiagnostics(string diagnostics) .Split(";") .Distinct() .Where(x => !string.IsNullOrWhiteSpace(x)); - } + } - internal static int GetWarningLevel(this IAnalyzerResult analyzerResult) => + public static int GetWarningLevel(this IAnalyzerResult analyzerResult) => int.Parse(analyzerResult.GetPropertyOrDefault("WarningLevel", "4")); - private static string GetRootNamespace(this IAnalyzerResult analyzerResult) => + public static string GetRootNamespace(this IAnalyzerResult analyzerResult) => analyzerResult.GetPropertyOrDefault("RootNamespace") ?? analyzerResult.GetAssemblyName(); - internal static bool GetPropertyOrDefault(this IAnalyzerResult analyzerResult, string name, bool defaultBoolean) => + public static bool GetPropertyOrDefault(this IAnalyzerResult analyzerResult, string name, bool defaultBoolean) => bool.Parse(analyzerResult.GetPropertyOrDefault(name, defaultBoolean.ToString())); - internal static string GetPropertyOrDefault(this IAnalyzerResult analyzerResult, string name, + public static string GetPropertyOrDefault(this IAnalyzerResult analyzerResult, string name, string defaultValue = default) => analyzerResult.Properties.GetValueOrDefault(name, defaultValue); diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/CrossPlatformAssemblyResolver.cs b/src/Stryker.Utilities/EmbeddedResources/CrossPlatformAssemblyResolver.cs similarity index 99% rename from src/Stryker.Core/Stryker.Core/Initialisation/CrossPlatformAssemblyResolver.cs rename to src/Stryker.Utilities/EmbeddedResources/CrossPlatformAssemblyResolver.cs index 0caf641e26..c11fcab3da 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/CrossPlatformAssemblyResolver.cs +++ b/src/Stryker.Utilities/EmbeddedResources/CrossPlatformAssemblyResolver.cs @@ -5,7 +5,7 @@ using System.Text; using Mono.Cecil; -namespace Stryker.Core.Initialisation; +namespace Stryker.Utilities.EmbeddedResources; // This (CrossPlatformAssemblyResolver) is a copy of Mono.Cecil's BaseAssemblyResolver with all the conditional compilation removed and changes made to "Resolve" // Original: https://github.com/jbevain/cecil/blob/7b8ee049a151204997eecf587c69acc2f67c8405/Mono.Cecil/BaseAssemblyResolver.cs diff --git a/src/Stryker.Core/Stryker.Core/Initialisation/EmbeddedResourcesGenerator.cs b/src/Stryker.Utilities/EmbeddedResources/EmbeddedResourcesGenerator.cs similarity index 99% rename from src/Stryker.Core/Stryker.Core/Initialisation/EmbeddedResourcesGenerator.cs rename to src/Stryker.Utilities/EmbeddedResources/EmbeddedResourcesGenerator.cs index 6085b719cf..45e7278ad4 100644 --- a/src/Stryker.Core/Stryker.Core/Initialisation/EmbeddedResourcesGenerator.cs +++ b/src/Stryker.Utilities/EmbeddedResources/EmbeddedResourcesGenerator.cs @@ -1,8 +1,8 @@ // Partially borrowed from https://github.com/Testura/Testura.Mutation/blob/ca2785dba8997ab814be4bb69113739db357810f/src/Testura.Mutation.Core/Execution/Compilation/EmbeddedResourceCreator.cs using System; -using System.Collections.Generic; using System.Collections.Concurrent; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; @@ -12,7 +12,7 @@ using Microsoft.CodeAnalysis; using Mono.Cecil; -namespace Stryker.Core.Initialisation; +namespace Stryker.Utilities.EmbeddedResources; [ExcludeFromCodeCoverage] public static class EmbeddedResourcesGenerator diff --git a/src/Stryker.Utilities/EnumExtension.cs b/src/Stryker.Utilities/EnumExtension.cs index 01fe9ab852..9b4ebf9ea7 100644 --- a/src/Stryker.Utilities/EnumExtension.cs +++ b/src/Stryker.Utilities/EnumExtension.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Linq; using System.Reflection; -using Stryker.Utilities.Attributes; +using Stryker.Abstractions; namespace Stryker.Utilities; diff --git a/src/Stryker.Utilities/Stryker.Utilities.csproj b/src/Stryker.Utilities/Stryker.Utilities.csproj index ab7f97533d..06b70c2dc7 100644 --- a/src/Stryker.Utilities/Stryker.Utilities.csproj +++ b/src/Stryker.Utilities/Stryker.Utilities.csproj @@ -6,8 +6,15 @@ + + + + + + + diff --git a/src/Stryker.Utilities/packages.lock.json b/src/Stryker.Utilities/packages.lock.json index 6c28373616..eaf4c91f10 100644 --- a/src/Stryker.Utilities/packages.lock.json +++ b/src/Stryker.Utilities/packages.lock.json @@ -2,6 +2,23 @@ "version": 2, "dependencies": { "net8.0": { + "Buildalyzer": { + "type": "Direct", + "requested": "[7.1.0, )", + "resolved": "7.1.0", + "contentHash": "U6e7mHdQC672lfvqNVp70jQGb8g3aPnLafnFnnrzUwFfPX+4tK5uk3Ah+1R3svyG5kc3Qu9ZjBrhcvml/IwXrw==", + "dependencies": { + "Buildalyzer.Logger": "7.1.0", + "MSBuild.StructuredLogger": "2.2.158", + "Microsoft.Build": "17.10.4", + "Microsoft.Build.Tasks.Core": "17.10.4", + "Microsoft.CodeAnalysis.CSharp": "4.0.0", + "Microsoft.CodeAnalysis.VisualBasic": "4.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "MsBuildPipeLogger.Server": "1.1.6", + "NuGet.Frameworks": "6.9.1" + } + }, "DotNet.ReproducibleBuilds": { "type": "Direct", "requested": "[1.2.25, )", @@ -30,21 +47,157 @@ "System.Diagnostics.DiagnosticSource": "9.0.0" } }, + "Mono.Cecil": { + "type": "Direct", + "requested": "[0.11.6, )", + "resolved": "0.11.6", + "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" + }, + "ResXResourceReader.NetStandard": { + "type": "Direct", + "requested": "[1.3.0, )", + "resolved": "1.3.0", + "contentHash": "voW0VHwFGIvbJ4Pp/wfHKFGn9kxZD97H/mnD6LziBJCi4FJZtetYQpQQnpYp0IkL2+PQ6VOzkMvhK1+s7+NJnA==" + }, + "Buildalyzer.Logger": { + "type": "Transitive", + "resolved": "7.1.0", + "contentHash": "a0T+Se+HSCxOvP2s7kUbgHBVeeJghliN9CO3pSl8JfqPhKD9JaE7ZxS3iTEgKglDsRibcqbdIxhYvvvIdLOvuQ==" + }, + "Microsoft.Build": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "ZmGA8vhVXFzC4oo48ybQKlEybVKd0Ntfdr+Enqrn5ES1R6e/krIK9hLk0W33xuT0/G6QYd3YdhJZh+Xle717Ag==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.MetadataLoadContext": "8.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.Tasks.Dataflow": "8.0.0" + } + }, + "Microsoft.Build.Framework": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "4qXCwNOXBR1dyCzuks9SwTwFJQO/xmf2wcMislotDWJu7MN/r3xDNoU8Ae5QmKIHPaLG1xmfDkYS7qBVzxmeKw==" + }, + "Microsoft.Build.Tasks.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "k1sefpk2VvJNwcexMjisH+TdzhspCVRtYvh4fAez5qRM20VvsNxcOIjfDe3h3StZRIGI2aiFKGxBZYkwM+WV+A==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.Build.Utilities.Core": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.CodeDom": "8.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Resources.Extensions": "8.0.0", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Security.Cryptography.Xml": "8.0.0" + } + }, + "Microsoft.Build.Utilities.Core": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "eEB/tcXkSV+nQgvoa/l53UPtn+KVtKZ8zBceDZsXVTrfE4fA+4+/olrx9W8n2tq4XiESsL9UuGJgCKzqBwQCoQ==", + "dependencies": { + "Microsoft.Build.Framework": "17.10.4", + "Microsoft.NET.StringTools": "17.10.4", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", "resolved": "9.0.0", "contentHash": "+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==" }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NET.StringTools": { + "type": "Transitive", + "resolved": "17.10.4", + "contentHash": "wyABaqY+IHCMMSTQmcc3Ca6vbmg5BaEPgicnEgpll+4xyWZWlkQqUwafweUd9VAhBb4jqplMl6voUHQ6yfdUcg==" + }, + "MSBuild.StructuredLogger": { + "type": "Transitive", + "resolved": "2.2.158", + "contentHash": "A7hI65/MrDKdPpu4rsnqimDdAs42B05gpfOIyzWPJ+pqw6Q3p4r1I/AjWVe3joKGHIQSpL+0AX2tzLVVCaR0ug==", + "dependencies": { + "Microsoft.Build.Framework": "17.5.0", + "Microsoft.Build.Utilities.Core": "17.5.0" + } + }, + "MsBuildPipeLogger.Server": { + "type": "Transitive", + "resolved": "1.1.6", + "contentHash": "rls0hb7plSfVFCqScDxTqtGpIlMfoQEchqjmK/YtXDML11GU5jI+oCi9YsikGulJVUv/vLSY6Ktah0uXwv25EA==", + "dependencies": { + "Microsoft.Build": "15.3.409" + } + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" + }, "System.Collections.Immutable": { "type": "Transitive", "resolved": "8.0.0", "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==", + "dependencies": { + "System.Diagnostics.EventLog": "8.0.0", + "System.Security.Cryptography.ProtectedData": "8.0.0" + } + }, "System.Diagnostics.DiagnosticSource": { "type": "Transitive", "resolved": "9.0.0", "contentHash": "ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==" }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AJukBuLoe3QeAF+mfaRKQb2dgyrvt340iMBHYv+VdBzCUM06IxGlvl0o/uPOS7lHnXPN6u8fFRHSHudx5aTi8w==" + }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "8.0.0", @@ -53,6 +206,79 @@ "System.Collections.Immutable": "8.0.0" } }, + "System.Reflection.MetadataLoadContext": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "System.Resources.Extensions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.Cryptography.Pkcs": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "dependencies": { + "System.Formats.Asn1": "8.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==" + }, + "System.Security.Cryptography.Xml": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==", + "dependencies": { + "System.Security.Cryptography.Pkcs": "8.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Threading.Tasks.Dataflow": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "7V0I8tPa9V7UxMx/+7DIwkhls5ouaEMQx6l/GwGm1Y8kJQ61On9B/PxCXFLbgu5/C47g0BP2CUYs+nMv1+Oaqw==" + }, + "TestableIO.System.IO.Abstractions": { + "type": "Transitive", + "resolved": "21.2.1", + "contentHash": "47NQXrfVUF+0b8W5EMnERR7FpgWE04wuYR1s9WvlNyh1hnRMGDPOvmewBLIZUG88Rhj9buzG3VVR8sAgH7TzjA==" + }, + "stryker.abstractions": { + "type": "Project", + "dependencies": { + "Buildalyzer": "[7.1.0, )", + "DotNet.Glob": "[3.1.3, )", + "Microsoft.CodeAnalysis.CSharp": "[4.12.0, )", + "Microsoft.CodeAnalysis.Common": "[4.12.0, )", + "Microsoft.TestPlatform.ObjectModel": "[17.12.0, )", + "Serilog": "[4.2.0, )", + "TestableIO.System.IO.Abstractions.Wrappers": "[21.2.1, )" + } + }, + "DotNet.Glob": { + "type": "CentralTransitive", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "hOfHw7MLJw/tbXaFwR1oiDb+dIXDp8URTxp5Pco42OOhiw77wrUNx6v6syNygHZbWwYdXQocL2Mo1l5FnfDVjg==" + }, "Microsoft.CodeAnalysis.Analyzers": { "type": "CentralTransitive", "requested": "[3.11.0, )", @@ -69,6 +295,58 @@ "System.Collections.Immutable": "8.0.0", "System.Reflection.Metadata": "8.0.0" } + }, + "Microsoft.CodeAnalysis.VisualBasic": { + "type": "CentralTransitive", + "requested": "[4.12.0, )", + "resolved": "4.0.0", + "contentHash": "FK+OGUMUh9O6/GCwyIy4c/sOrarF36/yEY07BbXVYMql1qCqHGWfyWXyCQKQ6m/KqReCqW6aO4cK7kK/AYBpyA==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[4.0.0]" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[9.0.0, )", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "CentralTransitive", + "requested": "[17.12.0, )", + "resolved": "17.12.0", + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "NuGet.Frameworks": { + "type": "CentralTransitive", + "requested": "[6.12.1, )", + "resolved": "6.9.1", + "contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA==" + }, + "Serilog": { + "type": "CentralTransitive", + "requested": "[4.2.0, )", + "resolved": "4.2.0", + "contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA==" + }, + "TestableIO.System.IO.Abstractions.Wrappers": { + "type": "CentralTransitive", + "requested": "[21.2.1, )", + "resolved": "21.2.1", + "contentHash": "a0jzTAZRIic40USnf8b59EbJ6+hh/kndLV3mTxgSGBkjei/H9qjULOtk/ZHQtRD8lLaUav7ZsMZn6JiwCgDmEw==", + "dependencies": { + "TestableIO.System.IO.Abstractions": "21.2.1" + } } } } diff --git a/src/Stryker.sln b/src/Stryker.sln index e4fb926a9c..3f856ef016 100644 --- a/src/Stryker.sln +++ b/src/Stryker.sln @@ -40,7 +40,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stryker.Abstractions", "Str EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stryker.Configuration", "Stryker.Options\Stryker.Configuration.csproj", "{E80FD63A-510D-49E2-B1FE-B6CDD5BA106D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stryker.Utilities", "Stryker.Utilities\Stryker.Utilities.csproj", "{BDD19501-B2E3-4EFE-ACCD-8D11C99CCCED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stryker.Utilities", "Stryker.Utilities\Stryker.Utilities.csproj", "{BDD19501-B2E3-4EFE-ACCD-8D11C99CCCED}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stryker.TestRunner.VsTest", "Stryker.TestRunner.VsTest\Stryker.TestRunner.VsTest.csproj", "{20D3DADD-890F-4F78-8B2B-2335F2E8FEC2}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{EB4DEFF1-7BA1-43E4-86ED-B8E6808CCD44}" ProjectSection(SolutionItems) = preProject @@ -52,6 +54,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ ..\.github\workflows\integration-test.yaml = ..\.github\workflows\integration-test.yaml EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stryker.TestRunner", "Stryker.TestRunner\Stryker.TestRunner.csproj", "{A19D156E-844E-4C8F-8D82-6051CBFBF910}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -98,6 +102,14 @@ Global {BDD19501-B2E3-4EFE-ACCD-8D11C99CCCED}.Debug|Any CPU.Build.0 = Debug|Any CPU {BDD19501-B2E3-4EFE-ACCD-8D11C99CCCED}.Release|Any CPU.ActiveCfg = Release|Any CPU {BDD19501-B2E3-4EFE-ACCD-8D11C99CCCED}.Release|Any CPU.Build.0 = Release|Any CPU + {20D3DADD-890F-4F78-8B2B-2335F2E8FEC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20D3DADD-890F-4F78-8B2B-2335F2E8FEC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20D3DADD-890F-4F78-8B2B-2335F2E8FEC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20D3DADD-890F-4F78-8B2B-2335F2E8FEC2}.Release|Any CPU.Build.0 = Release|Any CPU + {A19D156E-844E-4C8F-8D82-6051CBFBF910}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A19D156E-844E-4C8F-8D82-6051CBFBF910}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A19D156E-844E-4C8F-8D82-6051CBFBF910}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A19D156E-844E-4C8F-8D82-6051CBFBF910}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE