Skip to content

Commit 6026243

Browse files
authored
Merge pull request #912 from bUnit-dev/release/v1.12
Release of new minor version v1.12
2 parents ac4061c + f2d5955 commit 6026243

29 files changed

+468
-107
lines changed

.github/backmerge-failed.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/docs-deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ jobs:
6161
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
6262

6363
- name: ⚙️ Setup dotnet versions
64-
uses: actions/setup-dotnet@v2
64+
uses: actions/setup-dotnet@v3
6565
with:
6666
dotnet-version: |
6767
3.1.x
6868
5.0.x
6969
6.0.x
7070
7.0.x
7171
include-prerelease: true
72-
72+
7373
- name: 🎨 Setup color
7474
run: |
7575
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
@@ -84,7 +84,7 @@ jobs:
8484
- name: 🛠️ Building docs
8585
uses: nikeee/[email protected]
8686
with:
87-
args: docs/site/docfx.json
87+
args: docs/site/docfx.json
8888

8989
- name: 🛠️ Deploy to GitHub Pages
9090
if: success()
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: ⏩ Merge stable with main, push origin
105105
id: mergeMainline
106-
continue-on-error: true
106+
continue-on-error: true
107107
run: |
108108
git checkout main
109109
git merge -S stable

.github/workflows/release-preview.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: release-preview
22
concurrency: 'release-preview'
33

44
on:
5-
workflow_run:
5+
workflow_run:
66
workflows: [ 'verification' ]
77
types: [completed]
88
branches: [main, v2]
99

1010
workflow_dispatch:
1111
inputs:
1212
nugetRelease:
13-
description: 'Release to NuGet? Set to "true" to release to NuGet.org as well as GPR.'
13+
description: 'Release to NuGet? Set to "true" to release to NuGet.org as well as GPR.'
1414
required: true
1515
default: 'false'
1616

@@ -19,30 +19,30 @@ jobs:
1919
if: github.event_name == 'workflow_dispatch' || (github.ref == 'refs/heads/main' && ${{ github.event.workflow_run.conclusion == 'success' }}) || (github.ref == 'refs/heads/v2' && ${{ github.event.workflow_run.conclusion == 'success' }})
2020
runs-on: ubuntu-latest
2121
steps:
22-
22+
2323
- name: 🛒 Checkout repository
2424
uses: actions/checkout@v2
2525
with:
2626
fetch-depth: 0
2727

2828
- name: ⚙️ Setup GIT versioning
2929
uses: dotnet/[email protected]
30-
30+
3131
- name: ⚙️ Setup dotnet versions
32-
uses: actions/setup-dotnet@v2
32+
uses: actions/setup-dotnet@v3
3333
with:
3434
dotnet-version: |
3535
3.1.x
3636
5.0.x
3737
6.0.x
3838
7.0.x
3939
include-prerelease: true
40-
40+
4141
- name: 🎨 Setup color
4242
run: |
4343
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
4444
echo "TERM=xterm" >> $GITHUB_ENV
45-
45+
4646
- name: 🛠️ Update tokens in project files
4747
uses: cschleiden/replace-tokens@v1
4848
with:
@@ -53,7 +53,7 @@ jobs:
5353
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
5454
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
5555
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
56-
56+
5757
- name: 🛠️ Upload library to GitHub Package Repository
5858
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bunit-dev/index.json --skip-duplicate --no-symbols
5959

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323

2424
- name: 🛒 Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626
with:
2727
fetch-depth: 0
2828
token: ${{ secrets.BUNIT_BOT_TOKEN }}
@@ -60,7 +60,7 @@ jobs:
6060
setAllVars: true
6161

6262
- name: ⚙️ Setup dotnet versions
63-
uses: actions/setup-dotnet@v2
63+
uses: actions/setup-dotnet@v3
6464
with:
6565
dotnet-version: |
6666
3.1.x
@@ -118,7 +118,7 @@ jobs:
118118

119119
- name: ⏩ Merge stable with main, push to origin
120120
id: mergeMainline
121-
continue-on-error: true
121+
continue-on-error: true
122122
run: |
123123
git checkout main
124124
git merge -S stable

.github/workflows/verification.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ on:
1616
- reopened
1717

1818
workflow_dispatch:
19-
19+
2020
concurrency:
2121
group: verification-${{ github.ref }}-1
22-
cancel-in-progress: true
22+
cancel-in-progress: true
2323

2424
jobs:
2525
verify-bunit:
@@ -37,7 +37,7 @@ jobs:
3737
fetch-depth: 0
3838

3939
- name: ⚙️ Setup dotnet versions
40-
uses: actions/setup-dotnet@v2
40+
uses: actions/setup-dotnet@v3
4141
with:
4242
dotnet-version: |
4343
3.1.x
@@ -62,9 +62,12 @@ jobs:
6262
with:
6363
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
6464

65-
- name: 🧪 Run unit tests
65+
- name: 🧪 Run unit tests (async)
66+
run: |
67+
dotnet test --filter Category!=sync -c release --blame-hang-timeout 15s --blame-hang-dump-type full --blame-crash-dump-type full
68+
- name: 🧪 Run unit tests (sync)
6669
run: |
67-
dotnet test -c release --blame-hang-timeout 15s --blame-hang-dump-type full --blame-crash-dump-type full
70+
dotnet test --filter Category!=async -c release --blame-hang-timeout 15s --blame-hang-dump-type full --blame-crash-dump-type full
6871
- name: 📛 Upload hang- and crash-dumps on test failure
6972
if: failure()
7073
uses: actions/upload-artifact@v3

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ All notable changes to **bUnit** will be documented in this file. The project ad
66

77
## [Unreleased]
88

9+
### Fixed
10+
- The created HTML contained encoded strings. Reported by [@tobiasbrandstaedter](https://github.com/tobiasbrandstaedter). Fixed by [@linkdotnet](https://github.com/linkdotnet).
11+
912
## [1.11.7] - 2022-10-13
1013

1114
### Added

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<DotNet3Version>3.1.22</DotNet3Version>
66
<DotNet5Version>5.0.0</DotNet5Version>
77
<DotNet6Version>6.0.0</DotNet6Version>
8-
<DotNet7Version>7.0.0-*</DotNet7Version>
8+
<DotNet7Version>7.0.0</DotNet7Version>
99
</PropertyGroup>
1010

1111
<!-- Solution wide properties -->
@@ -48,7 +48,7 @@
4848
<!-- Shared code analyzers used for all projects in the solution -->
4949
<ItemGroup Label="Code Analyzers">
5050
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
51-
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.46.0.54807" PrivateAssets="All" />
51+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.47.0.55603" PrivateAssets="All" />
5252
</ItemGroup>
5353

5454
<ItemGroup Label="Implicit usings"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ A huge thank you to the [sponsors of my work with bUnit](https://github.com/spon
4444
<table border="0">
4545
<tr>
4646
<td align="center" width="120">
47-
<a href="https://github.com/Progress-Telerik">
48-
<img src="https://avatars.githubusercontent.com/u/57092419?s=460" alt="@Progress-Telerik" class="avatar" width="72" height="72" />
47+
<a href="https://github.com/telerik">
48+
<img src="https://avatars.githubusercontent.com/u/568561?s=200&v=4" alt="@Telerik" class="avatar" width="72" height="72" />
4949
<br />
50-
Progress Telerik
50+
Telerik
5151
</a>
5252
</td>
5353
<td align="center" width="120">

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<ItemGroup>
4545
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
46-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="All" />
46+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.119" PrivateAssets="All" />
4747

4848
</ItemGroup>
4949

src/bunit.core/Extensions/WaitForHelpers/RenderedFragmentWaitForHelperExtensions.cs

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,29 @@ public static void WaitForState(this IRenderedFragmentBase renderedFragment, Fun
3434
{
3535
ExceptionDispatchInfo.Capture(aggregateException.InnerExceptions[0]).Throw();
3636
}
37-
else
38-
{
39-
ExceptionDispatchInfo.Capture(e).Throw();
40-
}
37+
38+
throw;
4139
}
4240
}
4341

42+
/// <summary>
43+
/// Wait until the provided <paramref name="statePredicate"/> action returns true,
44+
/// or the <paramref name="timeout"/> is reached (default is one second).
45+
///
46+
/// The <paramref name="statePredicate"/> is evaluated initially, and then each time
47+
/// the <paramref name="renderedFragment"/> renders.
48+
/// </summary>
49+
/// <param name="renderedFragment">The render fragment or component to attempt to verify state against.</param>
50+
/// <param name="statePredicate">The predicate to invoke after each render, which must returns <c>true</c> when the desired state has been reached.</param>
51+
/// <param name="timeout">The maximum time to wait for the desired state.</param>
52+
/// <exception cref="WaitForFailedException">Thrown if the <paramref name="statePredicate"/> throw an exception during invocation, or if the timeout has been reached. See the inner exception for details.</exception>
53+
internal static async Task WaitForStateAsync(this IRenderedFragmentBase renderedFragment, Func<bool> statePredicate, TimeSpan? timeout = null)
54+
{
55+
using var waiter = new WaitForStateHelper(renderedFragment, statePredicate, timeout);
56+
57+
await waiter.WaitTask;
58+
}
59+
4460
/// <summary>
4561
/// Wait until the provided <paramref name="assertion"/> passes (i.e. does not throw an
4662
/// exception), or the <paramref name="timeout"/> is reached (default is one second).
@@ -66,10 +82,26 @@ public static void WaitForAssertion(this IRenderedFragmentBase renderedFragment,
6682
{
6783
ExceptionDispatchInfo.Capture(aggregateException.InnerExceptions[0]).Throw();
6884
}
69-
else
70-
{
71-
ExceptionDispatchInfo.Capture(e).Throw();
72-
}
85+
86+
throw;
7387
}
7488
}
89+
90+
/// <summary>
91+
/// Wait until the provided <paramref name="assertion"/> passes (i.e. does not throw an
92+
/// exception), or the <paramref name="timeout"/> is reached (default is one second).
93+
///
94+
/// The <paramref name="assertion"/> is attempted initially, and then each time the <paramref name="renderedFragment"/> renders.
95+
/// </summary>
96+
/// <param name="renderedFragment">The rendered fragment to wait for renders from and assert against.</param>
97+
/// <param name="assertion">The verification or assertion to perform.</param>
98+
/// <param name="timeout">The maximum time to attempt the verification.</param>
99+
/// <exception cref="WaitForFailedException">Thrown if the timeout has been reached. See the inner exception to see the captured assertion exception.</exception>
100+
[AssertionMethod]
101+
internal static async Task WaitForAssertionAsync(this IRenderedFragmentBase renderedFragment, Action assertion, TimeSpan? timeout = null)
102+
{
103+
using var waiter = new WaitForAssertionHelper(renderedFragment, assertion, timeout);
104+
105+
await waiter.WaitTask;
106+
}
75107
}

0 commit comments

Comments
 (0)