Skip to content

Commit d248b2f

Browse files
committed
Merge branch 'main' into v2
# Conflicts: # .editorconfig # .github/workflows/release.yml # Directory.Build.props # benchmark/Directory.Build.props # benchmark/bunit.benchmarks/bunit.benchmarks.csproj # docs/samples/components/bunit.docs.samples.csproj # docs/samples/tests/Directory.Build.props # docs/site/docs/test-doubles/persistentcomponentstate.md # src/bunit.core/Rendering/ITestRenderer.cs # src/bunit.core/Rendering/TestRenderer.cs # src/bunit.core/TestContextBase.cs # src/bunit.core/bunit.core.csproj # src/bunit.template/template/.template.config/template.json # src/bunit.template/template/Company.BlazorTests1.csproj # src/bunit.template/template/CounterCSharpTests.cs # src/bunit.template/template/CounterRazorTests.razor # src/bunit.web.query/bunit.web.query.csproj # src/bunit.web/TestContextWrapper.cs # src/bunit.web/bunit.web.csproj # src/bunit/ComponentParameterCollectionBuilder.cs # src/bunit/Extensions/WaitForHelpers/WaitForFailedException.cs # src/bunit/Extensions/WaitForHelpers/WaitForHelper.cs # src/bunit/Rendering/BunitComponentActivator.cs # src/bunit/Rendering/MissingRendererInfoException.cs # src/bunit/Rendering/RenderModeMisMatchException.cs # src/bunit/TestDoubles/NavigationManager/BunitNavigationManager.cs # src/bunit/bunit.csproj # tests/bunit.core.tests/TestDoubles/PersistentComponentState/FakePersistentComponentStateTest.cs # tests/bunit.generators.tests/bunit.generators.tests.csproj # tests/bunit.testassets/bunit.testassets.csproj # tests/bunit.tests/Asserting/MarkupMatchesTest.razor # tests/bunit.tests/Rendering/RenderModeTests.razor # tests/bunit.tests/TestDoubles/NavigationManager/BunitNavigationManagerTest.cs # tests/bunit.tests/bunit.tests.csproj # tests/bunit.tests/xunit.runner.json # tests/bunit.web.query.tests/bunit.web.query.tests.csproj # tests/bunit.web.tests/Rendering/RenderedComponentTest.cs # tests/bunit.web.tests/bunit.web.tests.csproj # version.json
2 parents e827e3e + 2284ed6 commit d248b2f

File tree

145 files changed

+1770
-741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+1770
-741
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66
"version": "1.10.175",
77
"commands": [
88
"dotnet-serve"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"docfx": {
12-
"version": "2.76.0",
13+
"version": "2.78.2",
1314
"commands": [
1415
"docfx"
15-
]
16+
],
17+
"rollForward": false
18+
},
19+
"dotnet-dump": {
20+
"version": "9.0.553101",
21+
"commands": [
22+
"dotnet-dump"
23+
],
24+
"rollForward": false
1625
}
1726
}
1827
}

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
{
44
"name": "Full",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/dotnet/sdk:9.0-preview",
6+
"image": "mcr.microsoft.com/dotnet/sdk:9.0",
77
"features": {
88
"ghcr.io/devcontainers/features/dotnet:2": {
99
"version": "latest",
10-
"additionalVersions": "7.0,6.0,5.0,3.1"
10+
"additionalVersions": "8.0"
1111
}
1212
},
1313

.devcontainer/post-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#/bin/bash
22

33
# Install docfx (should be aligned with docs-deploy.yml)
4-
dotnet tool install --global docfx --version 2.74.1
4+
dotnet tool restore
55

66
# Trust dotnet developer certs
77
dotnet dev-certs https --check --trust

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ dotnet_diagnostic.S112.severity = none # S112: General exceptions should never b
453453
dotnet_diagnostic.S1075.severity = suggestion # S1075: URIs should not be hardcoded
454454
dotnet_diagnostic.S1186.severity = suggestion # S1186: Methods should not be empty
455455
dotnet_diagnostic.S2292.severity = suggestion # S2292: Trivial properties should be auto-implemented
456+
dotnet_diagnostic.S3267.severity = suggestion # S3267: Convert foreach loop to LINQ query
456457
dotnet_diagnostic.S2743.severity = suggestion # S2743: A static field in a generic type is not shared among instances
457458
dotnet_diagnostic.S4158.severity = none # BUGGY with C#9 code - doesnt understand local methods
458459

.github/workflows/ci.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
5151
- name: ⚙️ Setup GIT versioning
5252
uses: dotnet/nbgv@v0.4.2
53+
id: nbgv
5354
with:
5455
setAllVars: true
5556

@@ -65,7 +66,7 @@ jobs:
6566
with:
6667
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
6768
env:
68-
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
69+
RELEASE_VERSION: ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
6970
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
7071

7172
# Create the NuGet package in the folder from the environment variable NuGetDirectory
@@ -127,29 +128,37 @@ jobs:
127128
8.0.x
128129
9.0.x
129130
131+
- name: ⚙️ Restore packages and tools
132+
run: |
133+
dotnet restore
134+
dotnet tool restore
135+
130136
- name: 🧪 Run unit tests
131-
run: dotnet test -c release -p:VSTestUseMSBuildOutput=false
137+
run: dotnet test -c release --no-restore
132138

133139
- name: 📛 Upload hang- and crash-dumps on test failure
134-
if: failure()
135-
uses: actions/upload-artifact@v3
140+
if: success() || failure()
141+
uses: actions/upload-artifact@v4
136142
with:
137143
if-no-files-found: ignore
138144
name: test-dumps
139145
path: |
140-
**/*hangdump.dmp
141-
**/*crashdump.dmp
146+
**/*.dmp
147+
**/*.dmp
142148
143-
validate_template:
149+
validate-template:
144150
runs-on: ubuntu-latest
145151
needs: [ create-nuget ]
146152
steps:
147153
- uses: actions/checkout@v4
148154
with:
149155
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
150156

151-
- name: Setup .NET
157+
- name: ⚙️ Setup dotnet
152158
uses: actions/setup-dotnet@v4
159+
with:
160+
dotnet-version: |
161+
9.0.x
153162
154163
- uses: actions/download-artifact@v4
155164
with:
@@ -169,20 +178,31 @@ jobs:
169178
run: |
170179
dotnet new bunit --no-restore -o ${{ github.workspace }}/TemplateTestXunit
171180
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Build.props
181+
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Packages.props
172182
dotnet restore ${{ github.workspace }}/TemplateTestXunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
173183
dotnet test ${{ github.workspace }}/TemplateTestXunit
174184
185+
- name: ✔ Verify xUnit.v3 template
186+
run: |
187+
dotnet new bunit --framework xunitv3 --no-restore -o ${{ github.workspace }}/TemplateTestXunitv3
188+
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Build.props
189+
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Packages.props
190+
dotnet restore ${{ github.workspace }}/TemplateTestXunitv3 --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
191+
dotnet test ${{ github.workspace }}/TemplateTestXunitv3
192+
175193
- name: ✔ Verify NUnit template
176194
run: |
177195
dotnet new bunit --framework nunit --no-restore -o ${{ github.workspace }}/TemplateTestNunit
178196
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Build.props
197+
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Packages.props
179198
dotnet restore ${{ github.workspace }}/TemplateTestNunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
180199
dotnet test ${{ github.workspace }}/TemplateTestNunit
181200
182201
- name: ✔ Verify MSTest template
183202
run: |
184203
dotnet new bunit --framework mstest --no-restore -o ${{ github.workspace }}/TemplateTestMstest
185204
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Build.props
205+
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Packages.props
186206
dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
187207
dotnet test ${{ github.workspace }}/TemplateTestMstest
188208
@@ -203,15 +223,23 @@ jobs:
203223
204224
- name: ⚙️ Setup GIT versioning
205225
uses: dotnet/nbgv@v0.4.2
226+
id: nbgv
206227
with:
207228
setAllVars: true
208229

230+
- name: 🛠️ Get Changelog Entry
231+
id: changelog_reader
232+
uses: mindsers/changelog-reader-action@v2
233+
with:
234+
version: Unreleased
235+
path: ./CHANGELOG.md
236+
209237
- name: 🍥 Replace tokens in files
210238
uses: cschleiden/replace-tokens@v1
211239
with:
212240
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props", "docs/site/docfx.json"]'
213241
env:
214-
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
242+
RELEASE_VERSION: ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
215243
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
216244

217245
- name: 📄 Build bUnit
@@ -241,7 +269,7 @@ jobs:
241269
release-preview:
242270
if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
243271
runs-on: ubuntu-latest
244-
needs: [ validate-nuget, run-test, validate_template, validate-docs ]
272+
needs: [ validate-nuget, run-test, validate-template, validate-docs ]
245273
steps:
246274
- uses: actions/download-artifact@v4
247275
with:

.github/workflows/docs-deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
5252
- name: ⚙️ Setup GIT versioning
5353
uses: dotnet/nbgv@v0.4.2
54+
id: nbgv
5455
with:
5556
setAllVars: true
5657

@@ -60,10 +61,10 @@ jobs:
6061
with:
6162
path: ./CHANGELOG.md
6263

63-
- name: 🛠️ Update tokens in project files
64+
- name: 🛠️ Update tokens in files
6465
uses: cschleiden/replace-tokens@v1
6566
with:
66-
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
67+
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/docfx.json", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
6768
env:
6869
RELEASE_VERSION: ${{ steps.changelog_reader.outputs.version }}
6970
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
@@ -119,9 +120,8 @@ jobs:
119120
- name: ⏭ Create pull request from stable to main when direct merge fails
120121
if: steps.mergeMainline.outcome == 'failure'
121122
uses: thomaseizinger/create-pull-request@1.4.0
122-
env:
123-
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
124123
with:
124+
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
125125
head: stable
126126
base: main
127127
title: Update main with documentation in stable

.github/workflows/prepare-release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
version: Unreleased
2929
path: ./CHANGELOG.md
3030

31+
- name: ⚙️ Setup GIT versioning
32+
uses: dotnet/nbgv@v0.4.2
33+
id: nbgv
34+
with:
35+
setAllVars: true
36+
3137
- name: ☑ Check that release contains changes
3238
if: steps.changelog_reader.outputs.changes == ''
3339
run: |
@@ -85,12 +91,11 @@ jobs:
8591

8692
- name: ⏭ Create pull request for release branch
8793
uses: thomaseizinger/create-pull-request@1.4.0
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
9094
with:
91-
head: release/v${{ env.NBGV_MajorMinorVersion }}
95+
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
96+
head: release/v${{ steps.nbgv.outputs.MajorMinorVersion }}
9297
base: stable
93-
title: Release of new ${{ github.event.inputs.versionIncrement }} version v${{ env.NBGV_MajorMinorVersion }}
98+
title: Release of new ${{ github.event.inputs.versionIncrement }} version v${{ steps.nbgv.outputs.MajorMinorVersion }}
9499
body: |
95100
This PR was created in response to a manual trigger of the [prepare-release workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
96101

.github/workflows/rebase-v2-on-main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ jobs:
4848
- name: ⏭ Create pull request
4949
if: steps.rebaseV2.outcome == 'failure'
5050
uses: thomaseizinger/create-pull-request@1.4.0
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
5351
with:
52+
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
5453
head: main
5554
base: v2
5655
title: Rebase v2 on main

.github/workflows/release.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
5151
- name: ⚙️ Setup GIT versioning
5252
uses: dotnet/nbgv@v0.4.2
53+
id: nbgv
5354
with:
5455
setAllVars: true
5556

@@ -61,9 +62,9 @@ jobs:
6162
9.0.x
6263
6364
- name: 🛠️ Update changelog
64-
uses: thomaseizinger/keep-a-changelog-new-release@3.0.0
65+
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
6566
with:
66-
version: ${{ env.NBGV_SemVer2 }}
67+
version: ${{ steps.nbgv.outputs.SemVer2 }}
6768

6869
- name: 🛠️ Update changelog compare URLs
6970
shell: bash
@@ -74,28 +75,30 @@ jobs:
7475
- name: 🛠️ Commit CHANGELOG.md to stable branch
7576
run: |
7677
git add CHANGELOG.md
77-
git commit -S -m "Updated CHANGELOG.md for ${{ env.NBGV_SimpleVersion }} release"
78+
git commit -S -m "Updated CHANGELOG.md for ${{ steps.nbgv.outputs.SimpleVersion }} release"
7879
echo "RELEASE_COMMIT_HASH=$(git rev-parse stable)" >> $GITHUB_ENV
7980
8081
- name: 🛠️ Get Changelog Entry
8182
id: changelog_reader
8283
uses: mindsers/changelog-reader-action@v2
8384
with:
84-
version: ${{ env.NBGV_SemVer2 }}
85+
version: ${{ steps.nbgv.outputs.SemVer2 }}
8586
path: ./CHANGELOG.md
8687

8788
- name: 🛠️ Update tokens in project files
8889
uses: cschleiden/replace-tokens@v1
8990
with:
9091
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
9192
env:
92-
RELEASE_VERSION: ${{ env.NBGV_NuGetPackageVersion }}
93+
RELEASE_VERSION: ${{ steps.nbgv.outputs.NuGetPackageVersion }}
9394
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
9495

9596
- name: 🛠️ Packing library in release mode
9697
run: |
9798
dotnet pack src/bunit/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
98-
dotnet pack src/bunit.template/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
99+
dotnet pack src/bunit.template/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
100+
dotnet pack src/bunit.generators/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
101+
dotnet pack src/bunit.web.query/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
99102
100103
- name: 🛠️ Upload library to NuGet.org repository
101104
run: |
@@ -105,16 +108,15 @@ jobs:
105108
run: git push origin stable
106109

107110
- name: 🛠️ Create GitHub release
108-
uses: thomaseizinger/create-release@1.0.0
109-
env:
110-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
uses: thomaseizinger/create-release@2.0.0
111112
with:
112-
tag_name: v${{ env.NBGV_SemVer2 }}
113+
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
113114
target_commitish: ${{ env.RELEASE_COMMIT_HASH }}
114-
name: ${{ env.NBGV_SemVer2 }}
115+
name: ${{ steps.nbgv.outputs.SemVer2 }}
115116
body: ${{ steps.changelog_reader.outputs.changes }}
116117
draft: false
117-
prerelease: ${{ env.NBGV_PublicRelease == 'False' }}
118+
prerelease: ${{ steps.nbgv.outputs.PublicRelease == 'False' }}
119+
github_token: ${{ secrets.GITHUB_TOKEN }}
118120

119121
- name: ⏩ Merge stable with main, push to origin
120122
id: mergeMainline
@@ -127,12 +129,11 @@ jobs:
127129
- name: ⏭ Create pull request from stable to main when direct merge fails
128130
if: steps.mergeMainline.outcome == 'failure'
129131
uses: thomaseizinger/create-pull-request@1.4.0
130-
env:
131-
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
132132
with:
133+
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
133134
head: stable
134135
base: main
135-
title: Update main with changes in stable after v${{ env.NBGV_SemVer2 }} release
136+
title: Update main with changes in stable after v${{ steps.nbgv.outputs.SemVer2 }} release
136137
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
137138
body: |
138139
Hi @${{ github.actor }}

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
{
77
"label": "Serve Docs (Without Build)",
88
"type": "shell",
9-
"command": "docfx metadata docs/site/docfx.json && docfx docs/site/docfx.json --serve"
9+
"command": "dotnet docfx metadata docs/site/docfx.json && dotnet docfx docs/site/docfx.json --serve"
1010
},
1111
{
1212
"label": "Serve Docs (With Build for API Documentation)",
1313
"type": "shell",
14-
"command": "dotnet build -c Release && docfx metadata docs/site/docfx.json && docfx docs/site/docfx.json --serve"
14+
"command": "dotnet build -c Release && dotnet docfx metadata docs/site/docfx.json && docfx docs/site/docfx.json --serve"
1515
},
1616
{
1717
"label": "Run all tests (Release Mode)",

0 commit comments

Comments
 (0)