Skip to content

Commit

Permalink
SAVEPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisdoomen committed May 7, 2023
1 parent 22a6039 commit 297da8e
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
Expand Down Expand Up @@ -128,4 +128,4 @@
}
}
}
}
}
32 changes: 17 additions & 15 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ class Build : NukeBuild
[GitRepository]
readonly GitRepository GitRepository;

[PackageExecutable("nspec", "NSpecRunner.exe", Version = "3.1.0")]
[NuGetPackage("nspec", "NSpecRunner.exe", Version = "3.1.0")]
Tool NSpec3;

#if OS_WINDOWS
[PackageExecutable("Node.js.redist", "node.exe", Version = "16.17.1", Framework = "win-x64")]
[NuGetPackage("Node.js.redist", "node.exe", Version = "16.17.1", Framework = "win-x64")]
#elif OS_MAC
[PackageExecutable("Node.js.redist", "node", Version = "16.17.1", Framework = "osx-x64")]
[NuGetPackage("Node.js.redist", "node", Version = "16.17.1", Framework = "osx-x64")]
#else
[PackageExecutable("Node.js.redist", "node", Version = "16.17.1", Framework = "linux-x64")]
[NuGetPackage("Node.js.redist", "node", Version = "16.17.1", Framework = "linux-x64")]
#endif
Tool Node;

string YarnCli => $"{ToolPathResolver.GetPackageExecutable("Yarn.MSBuild", "yarn.js", "1.22.19")} --silent";
string YarnCli => $"{NuGetToolPathResolver.GetPackageExecutable("Yarn.MSBuild", "yarn.js", "1.22.19")}";

AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";

Expand All @@ -84,8 +84,8 @@ class Build : NukeBuild
.OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges)
.Executes(() =>
{
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(TestResultsDirectory);
ArtifactsDirectory.CreateOrCleanDirectory();
TestResultsDirectory.CreateOrCleanDirectory();
});

Target CalculateNugetVersion => _ => _
Expand Down Expand Up @@ -171,8 +171,10 @@ class Build : NukeBuild
.OnlyWhenDynamic(() => EnvironmentInfo.IsWin && (RunAllTargets || HasSourceChanges))
.Executes(() =>
{
IEnumerable<string> testAssemblies = Projects
.SelectMany(project => GlobFiles(project.Directory, "bin/Debug/net47/*.Specs.dll"));
string[] testAssemblies = Projects
.SelectMany(project => project.Directory.GlobFiles("bin/Debug/net47/*.Specs.dll"))
.Select(_ => _.ToString())
.ToArray();
Assert.NotEmpty(testAssemblies.ToList());
Expand Down Expand Up @@ -248,7 +250,7 @@ void ReportTestOutcome(params string[] globFilters)
.Executes(() =>
{
ReportGenerator(s => s
.SetProcessToolPath(ToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
.SetProcessToolPath(NuGetToolPathResolver .GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
.SetTargetDirectory(TestResultsDirectory / "reports")
.AddReports(TestResultsDirectory / "**/coverage.cobertura.xml")
.AddReportTypes(
Expand Down Expand Up @@ -299,7 +301,7 @@ void ReportTestOutcome(params string[] globFilters)
if (EnvironmentInfo.IsWin)
{
NSpec3(Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll");
NSpec3( $"{Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll"}");
}
ReportTestOutcome(projects.Select(p => $"*{p.Name}*.trx").ToArray());
Expand Down Expand Up @@ -334,9 +336,9 @@ void ReportTestOutcome(params string[] globFilters)
.ProceedAfterFailure()
.Executes(() =>
{
IReadOnlyCollection<string> packages = GlobFiles(ArtifactsDirectory, "*.nupkg");
var packages = ArtifactsDirectory.GlobFiles("*.nupkg");
Assert.NotEmpty(packages.ToList());
Assert.NotEmpty(packages);
DotNetNuGetPush(s => s
.SetApiKey(NuGetApiKey)
Expand All @@ -352,8 +354,8 @@ void ReportTestOutcome(params string[] globFilters)
.ProceedAfterFailure()
.Executes(() =>
{
Node($"{YarnCli} install", workingDirectory: RootDirectory);
Node($"{YarnCli} run cspell", workingDirectory: RootDirectory,
Node($"{YarnCli} --silent install", workingDirectory: RootDirectory);
Node($"{YarnCli} --silent run cspell", workingDirectory: RootDirectory,
customLogger: (_, msg) => Error(msg));
});

Expand Down
8 changes: 4 additions & 4 deletions Build/_build.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -22,9 +22,9 @@
<PackageDownload Include="ReportGenerator" Version="[5.1.19]" />
<PackageDownload Include="xunit.runner.console" Version="[2.4.2]" />
<PackageDownload Include="Node.js.redist" Version="[16.17.1]" />
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182" />
<PackageReference Include="Nuke.Common" Version="6.3.0" />
<PackageReference Include="Nuke.Components" Version="6.3.0" />
<PackageReference Include="LibGit2Sharp" Version="0.27.2" />
<PackageReference Include="Nuke.Common" Version="7.0.0" />
<PackageReference Include="Nuke.Components" Version="7.0.0" />
<PackageDownload Include="Yarn.MSBuild" Version="[1.22.19]" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.2.0">
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.26">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.46">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/FluentAssertions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.12.1" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.13.1" PrivateAssets="all" />
<None Include="..\FluentAssertions.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
3 changes: 3 additions & 0 deletions Tests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ dotnet_diagnostic.MA0096.severity = none
# A class that implements IComparable<T> or IComparable should override comparison operators. Don't care about this.
dotnet_diagnostic.MA0097.severity = none

# Do not convert implicitly to DateTimeOffset. Fair point, but we need this in our tests
dotnet_diagnostic.MA0132.severity = suggestion

# Rename class to match pascal case naming rules
dotnet_diagnostic.S101.severity = none

Expand Down
8 changes: 4 additions & 4 deletions Tests/Approval.Tests/Approval.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -11,9 +11,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PublicApiGenerator" Version="10.3.0" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.0" />
<PackageReference Include="Verify.Xunit" Version="19.10.0" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="Verify.Xunit" Version="19.14.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net47;net6.0;netcoreapp2.0;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
Expand Down Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Chill" Version="4.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Xunit.StaFact" Version="1.1.11" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
Expand Down
6 changes: 3 additions & 3 deletions Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MSTestV2.Specs</RootNamespace>
Expand All @@ -12,7 +12,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MSpec.Specs</RootNamespace>
Expand All @@ -12,7 +12,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Machine.Specifications" Version="1.1.0" />
<PackageReference Include="Machine.Specifications" Version="1.1.1" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.10.2" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 297da8e

Please sign in to comment.