Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude/docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dotnet build TUnit.Dev.slnx --no-restore -graphBuild:True

Use `TUnit.slnx` for the full solution, including Roslyn version variants. Run `dotnet test` from the relevant test project directory. Core generator snapshots live in `tests/TUnit.Core.SourceGenerator.Tests`; public API snapshots live in `tests/TUnit.PublicAPI`.

Test projects target net8.0, net9.0 and net10.0; only installed runtimes can run, so pass `--framework net10.0` (or another installed one) when the machine lacks the others. The PublicAPI and generator snapshot projects add a net472 leg on Windows only; off Windows, `.Net4_7` snapshot updates come from the `ReceivedSnapshots-windows-latest` CI artifact.
Test projects target net10.0 and net11.0; only installed runtimes can run, so pass `--framework net10.0` (or another installed one) when the machine lacks the other. The PublicAPI and generator snapshot projects add a net472 leg on Windows only; off Windows, `.Net4_7` snapshot updates come from the `ReceivedSnapshots-windows-latest` CI artifact.

Scripts in `scripts/` need PowerShell 7. On Linux and macOS, quote any argument containing `*` when calling a native command from PowerShell: unquoted arguments are glob-expanded, so a treenode filter becomes a list of file paths.

Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/install-runtimes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# The SDK image ships a single runtime, but the test projects target net8.0, net9.0 and
# net10.0 (eng/TestProject.props). Install every runtime they need next to the image's SDK.
# The SDK image ships a single runtime, but the test projects target net10.0 and net11.0
# (eng/TestProject.props). Install every runtime they need next to the image's SDK.
set -euo pipefail

dotnet_root="$(dirname "$(readlink -f "$(command -v dotnet)")")"
Expand All @@ -9,7 +9,7 @@ trap 'rm -f "$installer"' EXIT

curl -sSL https://dot.net/v1/dotnet-install.sh -o "$installer"

for channel in 8.0 9.0 10.0; do
for channel in 10.0 11.0; do
for runtime in dotnet aspnetcore; do
bash "$installer" --channel "$channel" --runtime "$runtime" --install-dir "$dotnet_root" --no-path
done
Expand Down
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ TUnit builds and tests on Windows, Linux and macOS.
### Prerequisites

- **.NET SDK** matching [`global.json`](../global.json).
- **.NET 8, 9 and 10 runtimes.** The test projects target all three, and a target framework whose
- **.NET 10 and 11 runtimes.** The test projects target both, and a target framework whose
runtime is missing fails with "You must install or update .NET". Either run a single framework
(`--framework net10.0`, see below) or install the others, including the ASP.NET Core runtime, with
[dotnet-install](https://learn.microsoft.com/dotnet/core/tools/dotnet-install-script)
(`--channel 8.0 --runtime dotnet`, `--channel 8.0 --runtime aspnetcore`, and so on). Homebrew's
(`--channel 10.0 --runtime dotnet`, `--channel 10.0 --runtime aspnetcore`, and so on). Homebrew's
`dotnet` formula ships one runtime only.
- **PowerShell 7** (`pwsh`) for the scripts in `scripts/`. On Linux and macOS they run directly, e.g.
`./scripts/run-reflection-tests.ps1`, or as `pwsh scripts/run-reflection-tests.ps1`.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ body:
attributes:
label: .NET Version
description: What .NET version are you targeting?
placeholder: "e.g., .NET 8.0, .NET 9.0"
placeholder: "e.g., .NET 10.0, .NET 11.0"
validations:
required: true

Expand Down
12 changes: 6 additions & 6 deletions .github/scripts/process-benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ sidebar_position: ${Object.keys(categories.runtime).indexOf(testClass) + 3}
:::info Last Updated
This benchmark was automatically generated on **${timestamp}** from the latest CI run.
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}
:::
## 📊 Results
Expand Down Expand Up @@ -291,7 +291,7 @@ sidebar_position: ${Object.keys(categories.runtime).length + 3}
:::info Last Updated
This benchmark was automatically generated on **${timestamp}** from the latest CI run.
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}
:::
## 📊 Results
Expand Down Expand Up @@ -385,7 +385,7 @@ sidebar_position: 1
:::info Last Updated
These benchmarks were automatically generated on **${timestamp}** from the latest CI run.
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}
:::
## 🚀 Runtime Benchmarks
Expand Down Expand Up @@ -429,8 +429,8 @@ The benchmarks measure real-world testing patterns:
### Environment
- **OS**: ${environmentInfo.os || 'Ubuntu Latest (GitHub Actions)'}
- **Runtime**: ${environmentInfo.host || '.NET 10'}
- **SDK**: ${environmentInfo.sdk || '.NET 10 SDK'}
- **Runtime**: ${environmentInfo.host || '.NET 11'}
- **SDK**: ${environmentInfo.sdk || '.NET 11 SDK'}
- **Hardware**: GitHub Actions Standard Runner (Ubuntu)
- **Tool**: ${environmentInfo.benchmarkDotNetVersion || 'BenchmarkDotNet'}
Expand Down Expand Up @@ -507,7 +507,7 @@ const benchmarkSummary = {
runtime: Object.keys(categories.runtime),
build: Object.keys(categories.build),
timestamp: timestamp,
environment: `${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}`
environment: `${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}`
};

fs.writeFileSync(
Expand Down
8 changes: 4 additions & 4 deletions .github/scripts/process-mock-benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ sidebar_position: ${index + 2}
:::info Last Updated
This benchmark was automatically generated on **${timestamp}** from the latest CI run.
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}
:::
## 📊 Results
Expand Down Expand Up @@ -370,7 +370,7 @@ sidebar_position: 4
:::info Last Updated
These benchmarks were automatically generated on **${timestamp}** from the latest CI run.
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}
**Environment:** ${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}
:::
## 🚀 Overview
Expand Down Expand Up @@ -401,7 +401,7 @@ ${Object.entries(categoryDescriptions).map(([cat, desc]) =>
- **Tool**: ${environmentInfo.benchmarkDotNetVersion || 'BenchmarkDotNet'}
- **OS**: ${environmentInfo.os || 'Ubuntu Latest (GitHub Actions)'}
- **Runtime**: ${environmentInfo.host || '.NET 10'}
- **Runtime**: ${environmentInfo.host || '.NET 11'}
- **Statistical Rigor**: Multiple iterations with warm-up and outlier detection
- **Memory**: Allocation tracking enabled via \`[MemoryDiagnoser]\`
Expand Down Expand Up @@ -454,7 +454,7 @@ console.log(` ✓ Created ${STATIC_DIR}/latest.json`);
const summary = {
categories: Object.keys(categories),
timestamp,
environment: `${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 10'}`,
environment: `${environmentInfo.os || 'Ubuntu Latest'} • ${environmentInfo.sdk || '.NET 11'}`,
libraries: discoveredLibraries
};

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/aot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
- name: Enable Long Paths on Windows
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -181,6 +185,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
- name: Enable Long Paths on Windows
if: matrix.os == 'windows-latest'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/cloudshop-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ jobs:
steps:
- uses: actions/checkout@v7.0.1

- name: Setup .NET 10
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.x
dotnet-version: |
10.0.x
11.0.x
- name: Cache NuGet packages
uses: actions/cache@v6
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET 9
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.403
dotnet-version: |
10.0.x
11.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dotnet-build-different-locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
global-json-file: global.json
dotnet-version: |
10.0.x
11.0.x
- name: Generate and set locale for subsequent steps
run: |
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
# then spent up to 3 minutes saving an entry that was evicted within the hour.
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
- name: Enable Long Paths on Windows
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -307,6 +311,10 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
# TUnit.Mocks.Aot.Tests sets TreatWarningsAsErrors, so any trim/AOT warning ILC reports
# for everyday mock usage fails its publish (#7027). Every framework still runs after an
Expand All @@ -315,7 +323,7 @@ jobs:
shell: bash
run: |
failed=()
for framework in net8.0 net9.0 net10.0; do
for framework in net10.0 net11.0; do
for project in TUnit.Mocks.Tests TUnit.Mocks.Aot.Tests; do
echo "::group::$project ($framework)"
if dotnet publish "tests/$project/$project.csproj" -c Release --use-current-runtime \
Expand Down Expand Up @@ -364,6 +372,10 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
- name: Enable Long Paths
run: |
Expand Down Expand Up @@ -440,6 +452,10 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: |
10.0.x
11.0.x
# Packing reads the Roslyn analyzer/generator variants from their own bin folders, so build
# every library project, not just the packed ones.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mock-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Run Benchmark
run: dotnet run -c Release -f net10.0 -- --filter "*${{ matrix.benchmark }}*" --exporters json github
run: dotnet run -c Release -f net11.0 -- --filter "*${{ matrix.benchmark }}*" --exporters json github
working-directory: "benchmarks/TUnit.Mocks.Benchmarks"

- name: Upload Results
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/platform-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ jobs:
workload: wasm-tools
- platform: Android
workload: android
- platform: WASI
workload: wasi-experimental
env:
SmokePlatform: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 11.0.100-rc.3.26522.148
dotnet-version: 11.0.x
- uses: actions/cache@v6
with:
path: ~/.nuget/packages
Expand Down Expand Up @@ -79,18 +77,6 @@ jobs:
script: |
mkdir -p artifacts/platform-smoke/Android
bash -o pipefail -c 'dotnet test --project "$GITHUB_WORKSPACE/tests/TUnit.PlatformSmoke/TUnit.PlatformSmoke.csproj" --no-build 2>&1 | tee artifacts/platform-smoke/Android/test.log'
- uses: bytecodealliance/actions/wasmtime/setup@v1.1.3
if: matrix.platform == 'WASI'
with:
version: v49.0.1
- name: Execute the TUnit smoke test on WASI
if: matrix.platform == 'WASI'
working-directory: tests/TUnit.PlatformSmoke/bin/Debug/net11.0/wasi-wasm
shell: bash
run: |
mkdir -p "$GITHUB_WORKSPACE/artifacts/platform-smoke/WASI"
wasmtime run -S http --dir . dotnet.wasm TUnit.PlatformSmoke \
2>&1 | tee "$GITHUB_WORKSPACE/artifacts/platform-smoke/WASI/run.log"
- uses: actions/upload-artifact@v7.0.2
if: always()
with:
Expand All @@ -112,7 +98,7 @@ jobs:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 11.0.100-rc.3.26522.148
dotnet-version: 11.0.x
- uses: actions/cache@v6
with:
path: ~/.nuget/packages
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/speed-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Build All Frameworks
run: |
Expand All @@ -30,8 +30,8 @@ jobs:

- name: Publish AOT
run: |
dotnet publish -c Release -p:TestFramework=TUNIT -p:Aot=true --use-current-runtime --output bin/Release-TUNIT-AOT/net10.0
dotnet publish -c Release -p:TestFramework=XUNIT3 -p:Aot=true --use-current-runtime --output bin/Release-XUNIT3-AOT/net10.0
dotnet publish -c Release -p:TestFramework=TUNIT -p:Aot=true --use-current-runtime --output bin/Release-TUNIT-AOT/net11.0
dotnet publish -c Release -p:TestFramework=XUNIT3 -p:Aot=true --use-current-runtime --output bin/Release-XUNIT3-AOT/net11.0
working-directory: "tools/speed-comparison/UnifiedTests"

- name: Upload Build Artifacts
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Download Build Artifacts
uses: actions/download-artifact@v8
Expand All @@ -76,7 +76,7 @@ jobs:
working-directory: ${{ github.workspace }}

- name: Run Benchmark
run: dotnet run -c Release --framework net10.0 --allCategories=Runtime
run: dotnet run -c Release --framework net11.0 --allCategories=Runtime
working-directory: "tools/speed-comparison/Tests.Benchmark"
env:
CLASS_NAME: ${{ matrix.class }}
Expand Down Expand Up @@ -105,15 +105,15 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v6.1.0
with:
dotnet-version: 10.0.x
dotnet-version: 11.0.x

- name: Prepare builds
run: |
dotnet restore UnifiedTests/UnifiedTests.csproj
working-directory: "tools/speed-comparison"

- name: Run Benchmark
run: dotnet run -c Release --allCategories=Build --framework net10.0
run: dotnet run -c Release --allCategories=Build --framework net11.0
working-directory: "tools/speed-comparison/Tests.Benchmark"

- name: Upload Markdown
Expand Down
4 changes: 2 additions & 2 deletions .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY . /src
WORKDIR /src

# Install the SDK pinned by global.json, plus the net8.0/net9.0 runtimes so every
# Install the SDK pinned by global.json, plus the net10.0 runtime so every
# test target framework can run offline.
RUN curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \
&& chmod +x /tmp/dotnet-install.sh \
&& /tmp/dotnet-install.sh --jsonfile /src/global.json --install-dir "$DOTNET_ROOT" \
&& for channel in 8.0 9.0; do \
&& for channel in 10.0; do \
/tmp/dotnet-install.sh --channel "$channel" --runtime dotnet --install-dir "$DOTNET_ROOT" || exit 1; \
/tmp/dotnet-install.sh --channel "$channel" --runtime aspnetcore --install-dir "$DOTNET_ROOT" || exit 1; \
done \
Expand Down
2 changes: 1 addition & 1 deletion .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The boundaries are:

- The image is built in Debug from `TUnit.CI.slnx`, plus `src/TUnit.Reporting.Tool`.
- Test projects are TUnit apps. Run them with
`cd tests/<Project> && dotnet run -c Debug --no-restore --framework net10.0`. net8.0 and net9.0 runtimes are
`cd tests/<Project> && dotnet run -c Debug --no-restore --framework net10.0`. The net11.0 runtime is
also installed.
- `tunit-oss-test` runs the offline-safe suites for the areas above.
- Relevant suites:
Expand Down
Loading
Loading