Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of frozen VsTest runs #1977

Merged
merged 14 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ stages:
inputs:
command: test
projects: '**/Validation.csproj'
arguments: --filter Traits=SingleTestProject
arguments: --filter Category=SingleTestProject

- job: LinuxTests
displayName: Run tests on Linux
Expand All @@ -217,7 +217,7 @@ stages:
inputs:
command: test
projects: '**/Validation.csproj'
arguments: --filter Traits=SingleTestProject
arguments: --filter Category=SingleTestProject

- job: MacOsTests
displayName: Run tests on Mac OS
Expand All @@ -234,7 +234,7 @@ stages:
inputs:
command: test
projects: '**/Validation.csproj'
arguments: --filter Traits=SingleTestProject
arguments: --filter Category=SingleTestProject
- template: pipeline-templates/run-integration-test-steps.yml
parameters:
testName: 'macos-netcore-multi-test-project'
Expand All @@ -244,7 +244,7 @@ stages:
inputs:
command: test
projects: '**/Validation.csproj'
arguments: --filter Traits=MultipleTestProjects
arguments: --filter Category=MultipleTestProjects

- stage: PublishMasterReleaseArtifact
displayName: Publish Release Artifact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExampleLibrary</RootNamespace>
<AssemblyName>ExampleLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FullFrameworkApp.Test</RootNamespace>
<AssemblyName>FullFrameworkApp.Test</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
Expand All @@ -21,6 +21,7 @@
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
".NETFramework,Version=v4.6.1": {
".NETFramework,Version=v4.7.2": {
"MSTest.TestAdapter": {
"type": "Direct",
"requested": "[2.2.8, 2.2.8]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand All @@ -8,9 +8,10 @@
<OutputType>Exe</OutputType>
<RootNamespace>FullFrameworkApp</RootNamespace>
<AssemblyName>FullFrameworkApp</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -60,4 +61,4 @@
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
6 changes: 3 additions & 3 deletions integrationtest/ValidationProject/ValidateStrykerResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void NetFullFramework()

var report = JsonConvert.DeserializeObject<JsonReport>(strykerRunOutput);

CheckReportMutantCounts(report, total: 12, ignored: 0, survived: 1, killed: 4, timeout: 0, nocoverage: 7);
CheckReportMutantCounts(report, total: 24, ignored: 0, survived: 1, killed: 8, timeout: 0, nocoverage: 15);
}
}

Expand All @@ -49,7 +49,7 @@ public void NetCore()

var report = JsonConvert.DeserializeObject<JsonReport>(strykerRunOutput);

CheckReportMutantCounts(report, total: 63, ignored: 21, survived: 2, killed: 2, timeout: 2, nocoverage: 34);
CheckReportMutantCounts(report, total: 103, ignored: 36, survived: 4, killed: 9, timeout: 2, nocoverage: 50);
}

[Fact]
Expand All @@ -67,7 +67,7 @@ public void NetCoreWithTwoTestProjects()

var report = JsonConvert.DeserializeObject<JsonReport>(strykerRunOutput);

CheckReportMutantCounts(report, total: 63, ignored: 21, survived: 2, killed: 2, timeout: 2, nocoverage: 34);
CheckReportMutantCounts(report, total: 103, ignored: 6, survived: 9, killed: 11, timeout: 2, nocoverage: 73);
}

private void CheckReportMutantCounts(JsonReport report, int total, int ignored, int survived, int killed, int timeout, int nocoverage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public void InitialisationProcess_ShouldCallNeededResolvers()
var initialTestProcessMock = new Mock<IInitialTestProcess>(MockBehavior.Strict);
var assemblyReferenceResolverMock = new Mock<IAssemblyReferenceResolver>(MockBehavior.Strict);

testRunnerMock.Setup(x => x.RunAll(It.IsAny<ITimeoutValueCalculator>(), null, null))
.Returns(new TestRunResult(true)); // testrun is successful
testRunnerMock.Setup(x => x.DiscoverTests()).Returns(new TestSet());
testRunnerMock.Setup(x => x.Dispose());
var projectContents = new CsharpFolderComposite();
Expand Down Expand Up @@ -80,7 +78,6 @@ public void InitialisationProcess_ShouldThrowOnFailedInitialTestRun()
var initialTestProcessMock = new Mock<IInitialTestProcess>(MockBehavior.Strict);
var assemblyReferenceResolverMock = new Mock<IAssemblyReferenceResolver>(MockBehavior.Strict);

testRunnerMock.Setup(x => x.RunAll(It.IsAny<ITimeoutValueCalculator>(), null, null));
var folder = new CsharpFolderComposite();
folder.Add(new CsharpFileLeaf());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private TestsGuidList GetCoveringTests(int id)
return TestsGuidList.NoTest();
}

private TestRunResult GetRunResult(int id) => new(TestsGuidList.EveryTest(), GetFailedTests(id), TestsGuidList.NoTest(), string.Empty, TimeSpan.Zero);
private TestRunResult GetRunResult(int id) => new(GetCoveringTests(id), GetFailedTests(id), TestsGuidList.NoTest(), string.Empty, TimeSpan.Zero);

public TestRunResult GetInitialRunResult() => GetRunResult(InitialRunID);

Expand All @@ -157,7 +157,7 @@ public Mock<ITestRunner> GetTestRunnerMock()
var successResult = new TestRunResult(GetGuidList(),
TestsGuidList.NoTest(),
TestsGuidList.NoTest(),
String.Empty,
string.Empty,
TimeSpan.Zero);
runnerMock.Setup(x => x.DiscoverTests()).Returns(TestSet);
runnerMock.Setup(x => x.InitialTest()).Returns(GetRunResult(InitialRunID));
Expand Down
Loading