Skip to content

Commit

Permalink
Merge pull request #1876 from fluentassertions/develop
Browse files Browse the repository at this point in the history
Release 6.6
  • Loading branch information
dennisdoomen committed Apr 3, 2022
2 parents 5a24482 + ef914ec commit 6419939
Show file tree
Hide file tree
Showing 159 changed files with 22,518 additions and 12,322 deletions.
29 changes: 29 additions & 0 deletions .github/release.yml
@@ -0,0 +1,29 @@
changelog:
exclude:
labels:
- changelog-ignore
authors: [ ]
categories:
- title: Breaking Changes
labels:
- "breaking change"
- title: New features
labels:
- "feature"
- title: Improvements
labels:
- "enhancement"
- "performance"
- title: Fixes
labels:
- "bug"
- "regression"
- title: Fixes (extensibility)
labels:
- "extensibility"
- title: Documentation
labels:
- "documentation"
- title: Others
labels:
- "*"
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Expand Up @@ -13,36 +13,36 @@ jobs:

runs-on: windows-latest

env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Setup .NET 3.1
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
dotnet-version: |
2.1.x
3.1.x
6.0.x
- name: Run NUKE
run: ./build.ps1
env:
BranchSpec: ${{ github.ref }}
BuildNumber: ${{ github.run_number}}
BuildNumber: ${{ github.run_number }}
ApiKey: ${{ secrets.NUGETAPIKEY }}

- name: coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: TestResults/reports/lcov.info

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: ./Artifacts/*


2 changes: 2 additions & 0 deletions .nuke/build.schema.json
Expand Up @@ -78,6 +78,7 @@
"ApiChecks",
"CalculateNugetVersion",
"Clean",
"CodeCoverage",
"Compile",
"Pack",
"Push",
Expand All @@ -100,6 +101,7 @@
"ApiChecks",
"CalculateNugetVersion",
"Clean",
"CodeCoverage",
"Compile",
"Pack",
"Push",
Expand Down
68 changes: 58 additions & 10 deletions Build/Build.cs
Expand Up @@ -8,10 +8,12 @@
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.ReportGenerator;
using Nuke.Common.Tools.Xunit;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.ReportGenerator.ReportGeneratorTasks;
using static Nuke.Common.Tools.Xunit.XunitTasks;

[CheckBuildProjectConfigurations]
Expand Down Expand Up @@ -40,20 +42,23 @@ class Build : NukeBuild
[Solution(GenerateProjects = true)]
readonly Solution Solution;

[GitVersion(Framework = "net5.0")]
[GitVersion(Framework = "net6.0")]
readonly GitVersion GitVersion;

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

AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";

AbsolutePath TestResultsDirectory => RootDirectory / "TestResults";

string SemVer;

Target Clean => _ => _
.Executes(() =>
{
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(TestResultsDirectory);
});

Target CalculateNugetVersion => _ => _
Expand All @@ -66,7 +71,7 @@ class Build : NukeBuild
"Branch spec {branchspec} is a pull request. Adding build number {buildnumber}",
BranchSpec, BuildNumber);
SemVer = string.Join('.', GitVersion.SemVer.Split('.').Take(3).Union(new [] { BuildNumber }));
SemVer = string.Join('.', GitVersion.SemVer.Split('.').Take(3).Union(new[] { BuildNumber }));
}
Serilog.Log.Information("SemVer = {semver}", SemVer);
Expand All @@ -91,6 +96,7 @@ class Build : NukeBuild
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration("CI")
.EnableNoLogo()
.EnableNoRestore()
.SetAssemblyVersion(GitVersion.AssemblySemVer)
.SetFileVersion(GitVersion.AssemblySemFileVer)
Expand All @@ -112,13 +118,18 @@ class Build : NukeBuild
.DependsOn(Compile)
.Executes(() =>
{
Project[] projects = new[]
{
Solution.Specs.FluentAssertions_Specs,
Solution.Specs.FluentAssertions_Equivalency_Specs
};
if (EnvironmentInfo.IsWin)
{
Xunit2(s =>
{
IReadOnlyCollection<string> testAssemblies = GlobFiles(
Solution.Specs.FluentAssertions_Specs.Directory,
"bin/Debug/net47/*.Specs.dll");
IEnumerable<string> testAssemblies = projects
.SelectMany(project => GlobFiles(project.Directory, "bin/Debug/net47/*.Specs.dll"));
Assert.NotEmpty(testAssemblies.ToList());
Expand All @@ -129,12 +140,42 @@ class Build : NukeBuild
}
DotNetTest(s => s
.SetProjectFile(Solution.Specs.FluentAssertions_Specs)
.SetConfiguration("Debug")
.EnableNoBuild()
.SetDataCollector("XPlat Code Coverage")
.SetResultsDirectory(TestResultsDirectory)
.AddRunSetting(
"DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DoesNotReturnAttribute",
"DoesNotReturnAttribute")
.CombineWith(
Solution.Specs.FluentAssertions_Specs.GetTargetFrameworks().Except(new[] { "net47" }),
(_, v) => _.SetFramework(v)));
projects,
(_, project) => _
.SetProjectFile(project)
.CombineWith(
project.GetTargetFrameworks().Except(new[] { "net47" }),
(_, framework) => _.SetFramework(framework)
)
)
);
});

Target CodeCoverage => _ => _
.DependsOn(TestFrameworks)
.DependsOn(UnitTests)
.Executes(() =>
{
ReportGenerator(s => s
.SetProcessToolPath(ToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
.SetTargetDirectory(TestResultsDirectory / "reports")
.AddReports(TestResultsDirectory / "**/coverage.cobertura.xml")
.AddReportTypes("HtmlInline_AzurePipelines_Dark", "lcov")
.SetClassFilters(
"-System.Diagnostics.CodeAnalysis.StringSyntaxAttribute",
"-System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute")
.SetAssemblyFilters("+FluentAssertions"));
string link = TestResultsDirectory / "reports" / "index.html";
Serilog.Log.Information($"Code coverage report: \x1b]8;;file://{link.Replace('\\', '/')}\x1b\\{link}\x1b]8;;\x1b\\");
});

Target TestFrameworks => _ => _
Expand All @@ -157,6 +198,11 @@ class Build : NukeBuild
DotNetTest(s => s
.SetConfiguration("Debug")
.EnableNoBuild()
.SetDataCollector("XPlat Code Coverage")
.SetResultsDirectory(TestResultsDirectory)
.AddRunSetting(
"DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DoesNotReturnAttribute",
"DoesNotReturnAttribute")
.CombineWith(
testCombinations,
(_, v) => _.SetProjectFile(v.project).SetFramework(v.framework)));
Expand All @@ -171,13 +217,16 @@ class Build : NukeBuild
.DependsOn(ApiChecks)
.DependsOn(TestFrameworks)
.DependsOn(UnitTests)
.DependsOn(CodeCoverage)
.DependsOn(CalculateNugetVersion)
.Executes(() =>
{
DotNetPack(s => s
.SetProject(Solution.Core.FluentAssertions)
.SetOutputDirectory(ArtifactsDirectory)
.SetConfiguration("Release")
.EnableNoLogo()
.EnableNoRestore()
.EnableContinuousIntegrationBuild() // Necessary for deterministic builds
.SetVersion(SemVer));
});
Expand All @@ -187,7 +236,7 @@ class Build : NukeBuild
.OnlyWhenDynamic(() => IsTag)
.Executes(() =>
{
var packages = GlobFiles(ArtifactsDirectory, "*.nupkg");
IReadOnlyCollection<string> packages = GlobFiles(ArtifactsDirectory, "*.nupkg");
Assert.NotEmpty(packages.ToList());
Expand All @@ -201,5 +250,4 @@ class Build : NukeBuild
});

bool IsTag => BranchSpec != null && BranchSpec.Contains("refs/tags", StringComparison.InvariantCultureIgnoreCase);

}
5 changes: 3 additions & 2 deletions Build/_build.csproj
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..\</NukeRootDirectory>
<NukeScriptDirectory>..\</NukeScriptDirectory>
</PropertyGroup>
<ItemGroup>
<PackageDownload Include="GitVersion.Tool" Version="[5.8.1]" />
<PackageDownload Include="GitVersion.Tool" Version="[5.9.0]" />
<PackageDownload Include="NSpec" Version="[3.1.0]" />
<PackageDownload Include="ReportGenerator" Version="[5.1.3]" />
<PackageDownload Include="xunit.runner.console" Version="[2.4.1]" />
<PackageReference Include="Nuke.Common" Version="6.0.1" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -2,9 +2,9 @@

No open-source project is going to be successful without contributions. After we decided to move to Github, the involvement of the .NET community has increased significantly. However, contributing to this project involves a few steps that will seriously increase the chance we will accept it.

* The [Pull Request](https://help.github.com/articles/using-pull-requests) is targeted at the `master` branch.
* The [Pull Request](https://help.github.com/articles/using-pull-requests) is targeted at the `develop` branch.
* The code complies with the [Coding Guidelines for C#](https://csharpcodingguidelines.com/).
* The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33).
* If the contribution adds a feature or fixes a bug, please update the [**release notes**](https://github.com/fluentassertions/fluentassertions/blob/master/docs/_pages/releases.md), which is published on the [website](https://fluentassertions.com/releases).
* If the contribution changes the public API, the changes needs to be included by running [`AcceptApiChanges.ps1`](https://github.com/fluentassertions/fluentassertions/tree/master/AcceptApiChanges.ps1)/[`AcceptApiChanges.sh`](https://github.com/fluentassertions/fluentassertions/tree/master/AcceptApiChanges.sh) or using Rider's [Verify Support](https://plugins.jetbrains.com/plugin/17240-verify-support) plug-in.
* If the contribution affects the documentation, please update the [**documentation**](https://github.com/fluentassertions/fluentassertions/tree/master/docs/_pages), under the appropriate file (i.e. [strings.md](https://github.com/fluentassertions/fluentassertions/blob/master/docs/_pages/strings.md) for changes to string assertions), which is published on the [website](https://fluentassertions.com/introduction).
* If the contribution adds a feature or fixes a bug, please update the [**release notes**](https://github.com/fluentassertions/fluentassertions/blob/develop/docs/_pages/releases.md), which is published on the [website](https://fluentassertions.com/releases).
* If the contribution changes the public API, the changes needs to be included by running [`AcceptApiChanges.ps1`](https://github.com/fluentassertions/fluentassertions/tree/develop/AcceptApiChanges.ps1)/[`AcceptApiChanges.sh`](https://github.com/fluentassertions/fluentassertions/tree/develop/AcceptApiChanges.sh) or using Rider's [Verify Support](https://plugins.jetbrains.com/plugin/17240-verify-support) plug-in.
* If the contribution affects the documentation, please update the [**documentation**](https://github.com/fluentassertions/fluentassertions/tree/develop/docs/_pages), under the appropriate file (i.e. [strings.md](https://github.com/fluentassertions/fluentassertions/blob/develop/docs/_pages/strings.md) for changes to string assertions), which is published on the [website](https://fluentassertions.com/introduction).
3 changes: 2 additions & 1 deletion FluentAssertions.sln.DotSettings
@@ -1,4 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/AutoCompleteBasicCompletion/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/LookupWindow/ShowSignatures/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/TypingAssist/FormatBlockOnRBrace/@EntryValue">False</s:Boolean>
Expand All @@ -14,6 +14,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_REDUNDANT/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
Expand Down
9 changes: 5 additions & 4 deletions README.md
Expand Up @@ -3,17 +3,18 @@
[![](https://img.shields.io/nuget/dt/FluentAssertions.svg?label=nuget%20downloads)](https://www.nuget.org/packages/FluentAssertions)
[![](https://img.shields.io/librariesio/dependents/nuget/FluentAssertions.svg?label=dependent%20libraries)](https://libraries.io/nuget/FluentAssertions)
![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg)
[![Coverage Status](https://coveralls.io/repos/github/fluentassertions/fluentassertions/badge.svg?branch=develop)](https://coveralls.io/github/fluentassertions/fluentassertions?branch=develop)

# About this project
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET Standard 2.0 and 2.1.
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET 6, .NET Standard 2.0 and 2.1.

See https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/).

# Who created this?
Originally authored by Dennis Doomen with Jonas Nyrup as the productive side-kick. Notable contributions were provided by Artur Krajewski, Lukas Grützmacher and David Omid.

# How do I build this?
Install Visual Studio 2019 16.9+ or JetBrains Rider 2021.1.0 as well as the Build Tools 2019 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 5.0 SDK installed. Check [global.json](global.json) for the current minimum required version.
Install Visual Studio 2022 17.0+ or JetBrains Rider 2021.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 6.0 SDK installed. Check [global.json](global.json) for the current minimum required version.

# What are these Approval.Tests?
This is a special set of tests that use the [Verify](https://github.com/VerifyTests/Verify) project to verify whether you've introduced any breaking changes in the public API of the library.
Expand All @@ -23,5 +24,5 @@ If you've verified the changes and decided they are valid, you can accept them
`build.ps1`

# Powered By
<a href="https://www.jetbrains.com/rider/"><img src="docs/assets/images/jetbrainsrider.svg" style="width:150px"/></a> <br/>and <br>
<a href="https://www.semanticmerge.com/"><img src="docs/assets/images/semantic-merge.png" style="width:150px"/></a>
<a href="https://www.jetbrains.com/rider/"><img src="docs/assets/images/jetbrainsrider.svg" style="width:150px"/></a> <br/>and <br>
<a href="https://www.semanticmerge.com/"><img src="docs/assets/images/semantic-merge.png" style="width:150px"/></a>

0 comments on commit 6419939

Please sign in to comment.