Skip to content

Commit

Permalink
fix: missed dotnet tool restore and stryker dashboard report
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-shirbandi committed Oct 8, 2023
1 parent 7210c9b commit 3dc3b90
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -673,3 +673,4 @@ fabric.properties
ocelot.json
/src/2-Services/Identity/Api/Identity.Api/keys
/src/6-Docker/mssqldata/Entropy.bin
/.nuke/temp/execution-plan.html
2 changes: 2 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Information",
"Preparation",
"Restore",
"RestoreDotNetTool",
"RunMutationTests",
"RunUnitTests"
]
Expand All @@ -96,6 +97,7 @@
"Information",
"Preparation",
"Restore",
"RestoreDotNetTool",
"RunMutationTests",
"RunUnitTests"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
],
"reporters": [
"html",
"progress",
"dashboard"
"progress"
],
"project-info": {
"module": "TaskoMask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
],
"reporters": [
"html",
"progress",
"dashboard"
"progress"
],
"project-info": {
"module": "TaskoMask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
],
"reporters": [
"html",
"progress",
"dashboard"
"progress"
],
"project-info": {
"module": "TaskoMask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
],
"reporters": [
"html",
"progress",
"dashboard"
"progress"
],
"project-info": {
"module": "TaskoMask",
Expand Down
32 changes: 22 additions & 10 deletions src/6-Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Build : NukeBuild
AbsolutePath TestResultDirectory = RootDirectory + "/Artifacts/Test-Results/";

Target Information => _ => _
.Before(Preparation)
.Executes(() =>
{
Log.Information($"Solution path : {Solution}");
Expand All @@ -45,6 +44,13 @@ class Build : NukeBuild
TestResultDirectory.CreateOrCleanDirectory();
});

Target RestoreDotNetTool => _ => _
.DependsOn(RunUnitTests)
.Executes(() =>
{
DotNet(arguments: "tool restore");
});

Target Clean => _ => _
.DependsOn(Preparation)
.Executes(() =>
Expand Down Expand Up @@ -91,14 +97,20 @@ class Build : NukeBuild
.SetCoverletOutput(TestResultDirectory + $"{z.Name}.xml")));
});


Target RunMutationTests => _ => _
.DependsOn(RunUnitTests)
.Executes(() =>
{
var testProjects = Solution.AllProjects.Where(s => s.Name.EndsWith(".Tests.Unit"));

foreach (var testProject in testProjects)
DotNet(workingDirectory: testProject.Directory, arguments: "stryker --since");
});
.DependsOn(RunUnitTests, RestoreDotNetTool)
.Executes(() =>
{
//It uses dashboard report for CI
string report = "--reporter dashboard";

//It uses reports specified in reports section in stryker-config.json
if (IsLocalBuild)
report = "";

var testProjects = Solution.AllProjects.Where(s => s.Name.EndsWith(".Tests.Unit"));

foreach (var testProject in testProjects)
DotNet(workingDirectory: testProject.Directory, arguments: $"stryker --since {report}");
});
}

0 comments on commit 3dc3b90

Please sign in to comment.