Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
- Added new setting - BuildSolution. It's a true or false flag that decide if we should build the solution before creating mutations.
- Better error handling with the DotNet test runner.
  • Loading branch information
MilleBo authored Jan 15, 2020
1 parent c612c3a commit ad0a7ba
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public OpenProjectBuildHandler(ISolutionBuilder solutionBuilder)
{
cancellationToken.ThrowIfCancellationRequested();

_solutionBuilder.BuildSolution(fileConfig.SolutionPath);
if (fileConfig.BuildSolution)
{
_solutionBuilder.BuildSolution(fileConfig.SolutionPath);
}

return base.HandleAsync(fileConfig, applicationConfig, cancellationToken);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Testura.Mutation.Application/Models/MutationFileConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public MutationFileConfig()
CreateBaseline = true;
Mutators = new List<string>();
Filter = new MutationDocumentFilter();
BuildSolution = true;
}

public string SolutionPath { get; set; }
Expand Down Expand Up @@ -44,5 +45,7 @@ public MutationFileConfig()
public TargetFramework TargetFramework { get; set; }

public bool CreateBaseline { get; set; }

public bool BuildSolution { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Testura.Mutation.Console/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4Net.config", Watch = true)]
[assembly: LogMinimalMessage]
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void BuildSolution(string solutionPath)
LogTo.Error(standardOutput);
throw new Exception(error);
}

LogTo.Info("..build was successful");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\settings\Testura.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
4 changes: 2 additions & 2 deletions src/Testura.Mutation.VsExtension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,69 @@
</Grid.RowDefinitions>
<dragablz:TabablzControl HeaderMemberPath="Text" FixedHeaderCount="3" BorderThickness="0" Background="#2d2d30">
<TabItem Header="General" IsSelected="False">
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="120" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<GroupBox
<ScrollViewer Margin="16">
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="120" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<GroupBox
Header="Test framework"
Style="{DynamicResource MaterialDesignCardGroupBox}"
Margin="0, 10, 0, 0"
materialDesign:ShadowAssist.ShadowDepth="Depth3"
BorderThickness="0"
Foreground="White"
Grid.Row="0">
<ComboBox materialDesign:HintAssist.Hint="Test framework" Margin="0, 20, 0, 10" SelectedIndex="{Binding SelectedTestRunnerIndex}" ItemsSource="{Binding TestRunnerTypes}" Grid.Row="0">
</ComboBox>
</GroupBox>
<GroupBox
<ComboBox materialDesign:HintAssist.Hint="Test framework" Margin="0, 20, 0, 10" SelectedIndex="{Binding SelectedTestRunnerIndex}" ItemsSource="{Binding TestRunnerTypes}" Grid.Row="0">
</ComboBox>
</GroupBox>
<GroupBox
Header="Baseline"
Style="{DynamicResource MaterialDesignCardGroupBox}"
Margin="0, 15, 0, 0"
materialDesign:ShadowAssist.ShadowDepth="Depth3"
BorderThickness="0"
Foreground="White"
Grid.Row="1">
<CheckBox Style="{StaticResource MaterialDesignCheckBox}" IsChecked="{Binding RunBaseline}" Grid.Row="1">
Create baseline (I.E Run unit test before creating mutations)
</CheckBox>
</GroupBox>
<CheckBox Style="{StaticResource MaterialDesignCheckBox}" IsChecked="{Binding RunBaseline}" Grid.Row="1">
Create baseline (I.E Run unit test before creating mutations)
</CheckBox>
</GroupBox>

<GroupBox
<GroupBox
Header="Number of parallel test runs"
Style="{DynamicResource MaterialDesignCardGroupBox}"
Margin="0, 15, 0, 0"
materialDesign:ShadowAssist.ShadowDepth="Depth3"
BorderThickness="0"
Foreground="White"
Grid.Row="2">
<Slider
<Slider
Minimum="1"
Maximum="15"
Style="{StaticResource MaterialDesignDiscreteSlider}"
ToolTip="MaterialDesignDiscreteSlider"
Value="{Binding NumberOfParallelTestRuns}"
Width="280"
HorizontalAlignment="Left"/>
</GroupBox>
</Grid>
</TabItem>
</GroupBox>

<GroupBox
Header="Build"
Style="{DynamicResource MaterialDesignCardGroupBox}"
Margin="0, 15, 0, 0"
materialDesign:ShadowAssist.ShadowDepth="Depth3"
BorderThickness="0"
Foreground="White"
Grid.Row="3">
<CheckBox IsChecked="{Binding BuildSolution}" Content="Build solution before creating mutations"></CheckBox>
</GroupBox>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="Project info" IsSelected="False">
<GroupBox
Header="Test projects"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public MutationConfigWindowViewModel(EnvironmentService environmentService, Solu

public int NumberOfParallelTestRuns { get; set; }

public bool BuildSolution { get; set; }

public void Initialize()
{
_environmentService.JoinableTaskFactory.RunAsync(async () =>
Expand Down Expand Up @@ -97,6 +99,7 @@ public void Initialize()
}

RunBaseline = mutationFileConfig?.CreateBaseline ?? true;
BuildSolution = mutationFileConfig?.BuildSolution ?? true;
});
}

Expand All @@ -113,6 +116,7 @@ private void UpdateConfig()
CreateBaseline = RunBaseline,
Mutators = settings.ToList(),
NumberOfTestRunInstances = NumberOfParallelTestRuns,
BuildSolution = BuildSolution
};

File.WriteAllText(GetConfigPath(), JsonConvert.SerializeObject(config, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void CreateMutations()

if (_tokenSource.Token.IsCancellationRequested)
{
IsStopButtonEnabled = false;
return;
}

Expand Down Expand Up @@ -159,7 +160,7 @@ public void Initialize(IEnumerable<MutationDocumentFilterItem> filterItems = nul
return;
}

IsStopButtonEnabled = false;
IsStopButtonEnabled = true;
_tokenSource = new CancellationTokenSource();

if (!_configService.ConfigExist())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Testura.MutationVsExtension.71e8249a-b76c-4035-af2b-0304cbf33623" Version="1.1.0" Language="en-US" Publisher="Mille Boström" />
<Identity Id="Testura.MutationVsExtension.71e8249a-b76c-4035-af2b-0304cbf33623" Version="1.2.0" Language="en-US" Publisher="Mille Boström" />
<DisplayName>Testura.Mutation</DisplayName>
<Description xml:space="preserve">Testura is a mutation testing extension for visual studio that verifies the quality of your unit tests by injecting different mutations in your production code and then checks whether your unit tests catch them.</Description>
<MoreInfo>https://github.com/Testura/Testura.Mutation</MoreInfo>
Expand Down

0 comments on commit ad0a7ba

Please sign in to comment.