Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
98f0126
Upgrade nuget packages, rename TestContext to FluentTestContext and r…
BDisp Mar 3, 2026
75ab6b6
Fix recursive events
BDisp Mar 3, 2026
7504ef7
Fix unit tests
BDisp Mar 3, 2026
1a7484a
Upgrade ReportGenerator
BDisp Mar 4, 2026
54ee0ff
Code cleanup
BDisp Mar 4, 2026
6af30ef
Rename FluentTestContext to AppTestHelper
BDisp Mar 4, 2026
d65df27
Resolving merge conflicts
BDisp Mar 4, 2026
d5a7044
Fix TestContext.Current.CancellationToken warnings
BDisp Mar 4, 2026
217baeb
Add <OutputType>Exe</OutputType> in the unit tests projects
BDisp Mar 4, 2026
abf604b
Add <UseAppHost>true</UseAppHost>
BDisp Mar 4, 2026
be3e69e
Remove xunit.runner.visualstudio and Microsoft.NET.Test.Sdk nuget pac…
BDisp Mar 4, 2026
82e245d
Remove Microsoft.Net.Compilers.Toolset unused nuget package
BDisp Mar 4, 2026
7e4a8f0
Add <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
BDisp Mar 4, 2026
013a3a2
Trying to fix integrations tests
BDisp Mar 4, 2026
0f62080
Remove <IsTestProject>true</IsTestProject> to prevent ghost transitiv…
BDisp Mar 4, 2026
365e6bf
Keep parameter consistency with the generator
BDisp Mar 4, 2026
c8dbe87
Prevent UICatalog test fail in WSL using VS2026
BDisp Mar 4, 2026
d08381f
Resolving merge conflicts
BDisp Mar 4, 2026
fe3cc4a
Fix merge errors
BDisp Mar 4, 2026
bcc8eeb
Renamed to AppTestHelpers and AppTestHelpers.XunitHelpers
BDisp Mar 5, 2026
c0b3d70
Merge branch 'v2_develop' into v2_4787__upgrade-nuget-packages
BDisp Mar 5, 2026
839638f
Fix test discovery for dotnet test and ReSharper after xUnit v3 upgrade
tig Mar 5, 2026
f677a6d
Fix AppTestHelper XML doc summary
tig Mar 5, 2026
98fbbb3
Update CI workflows for Microsoft Testing Platform (MTP)
tig Mar 5, 2026
f40d7ad
Fix Linux/macOS CI: chmod +x test executables after artifact download
tig Mar 5, 2026
56d23aa
Remove --coverage flag (not supported by xUnit v3 MTP)
tig Mar 5, 2026
c529754
Build per-OS instead of sharing Linux artifacts across platforms
tig Mar 5, 2026
6101243
Add --diagnostic flag (required by --diagnostic-output-directory)
tig Mar 5, 2026
0a29c24
Update all docs to use MTP-compatible dotnet test syntax
tig Mar 5, 2026
1dce13f
Fix duplicate --diagnostic flag; update stale coverage docs
tig Mar 5, 2026
fead444
Merge branch 'v2_develop' into v2_4787__upgrade-nuget-packages
BDisp Mar 5, 2026
cf31f2a
Fix help arg
BDisp Mar 5, 2026
4bdfeb0
Microsoft.CodeAnalysis.CSharp is now consistent with version 4.14.0 a…
BDisp Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .claude/rules/testing-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
- **Never decrease code coverage** - PRs must maintain or increase coverage
- Target: **70%+ coverage** for new code
- Coverage collection:
- Centralized in `TestResults/` directory at repository root
- Collected only on Linux (ubuntu-latest) runners in CI for performance
- Windows and macOS runners skip coverage collection to reduce execution time
- Coverage reports uploaded to Codecov automatically from Linux runner
- CI monitors coverage on each PR
- Temporarily disabled in CI during xUnit v3 / MTP migration
- Will be re-enabled once an MTP-compatible coverage solution is integrated

## Test Patterns

Expand Down Expand Up @@ -47,11 +44,11 @@
- ~10 min timeout
- Uses `Application.Init` and static state
- Cannot run in parallel
- Includes `--blame` flags for crash diagnostics
- Includes `--diagnostic` flag for logging

**Command:**
```bash
dotnet test Tests/UnitTests --no-build --verbosity normal
dotnet test --project Tests/UnitTests --no-build --verbosity normal
```

### 2. Parallel Tests (`Tests/UnitTestsParallelizable/`) - **PREFERRED**
Expand All @@ -67,7 +64,7 @@ dotnet test Tests/UnitTests --no-build --verbosity normal

**Command:**
```bash
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal
dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal
```

### 3. Integration Tests (`Tests/IntegrationTests/`)
Expand All @@ -78,13 +75,13 @@ dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal

**Command:**
```bash
dotnet test Tests/IntegrationTests --no-build --verbosity normal
dotnet test --project Tests/IntegrationTests --no-build --verbosity normal
```

## Test Configuration Files

- `xunit.runner.json` - xUnit configuration
- `coverlet.runsettings` - Coverage settings (OpenCover format)
- `coverlet.runsettings` - Coverage settings (currently unused, pending MTP integration)

## Example Test Pattern

Expand Down
6 changes: 3 additions & 3 deletions .claude/tasks/clean-code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Run these for each commit:

```bash
dotnet build --no-restore
dotnet test Tests/IntegrationTests --no-build
dotnet test Tests/UnitTests --no-build
dotnet test Tests/UnitTestsParallelizable --no-build
dotnet test --project Tests/IntegrationTests --no-build
dotnet test --project Tests/UnitTests --no-build
dotnet test --project Tests/UnitTestsParallelizable --no-build
```

## Terminal.Gui Specific Requirements
Expand Down
12 changes: 6 additions & 6 deletions .claude/workflows/build-test-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ dotnet build --configuration Release --no-restore
**Time:** ~10 min timeout

```bash
dotnet test Tests/UnitTests --no-build --verbosity normal
dotnet test --project Tests/UnitTests --no-build --verbosity normal
```

- Uses `Application.Init` and static state
- Cannot run in parallel
- Includes `--blame` flags for crash diagnostics
- Includes `--diagnostic` flag for logging

### Run Parallel Tests (Preferred)

**Time:** ~10 min timeout

```bash
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal
dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal
```

- No dependencies on static state
Expand All @@ -69,13 +69,13 @@ dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal
### Run Integration Tests

```bash
dotnet test Tests/IntegrationTests --no-build --verbosity normal
dotnet test --project Tests/IntegrationTests --no-build --verbosity normal
```

### Run All Tests

```bash
dotnet test --no-build --verbosity normal
dotnet test --project Tests/UnitTests --no-build --verbosity normal && dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal
```

## Common Build Issues
Expand All @@ -94,7 +94,7 @@ dotnet restore ./Examples/SelfContained/SelfContained.csproj -f
**For clean builds, always run in this order:**

```bash
dotnet restore && dotnet build --no-restore && dotnet test --no-build
dotnet restore && dotnet build --no-restore && dotnet test --project Tests/UnitTests --no-build && dotnet test --project Tests/UnitTestsParallelizable --no-build
```

This ensures:
Expand Down
8 changes: 3 additions & 5 deletions .claude/workflows/pr-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before submitting a PR, ensure:

- [ ] **Build passes** locally: `dotnet build --no-restore`

- [ ] **Tests pass** locally: `dotnet test --no-build`
- [ ] **Tests pass** locally: `dotnet test --project Tests/UnitTests --no-build && dotnet test --project Tests/UnitTestsParallelizable --no-build`

## PR Description Template

Expand Down Expand Up @@ -70,16 +70,14 @@ dotnet build --configuration Debug --no-restore
### 2. Run Tests

```bash
dotnet test --no-build --verbosity normal
dotnet test --project Tests/UnitTests --no-build --verbosity normal && dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal
```

**Expected:** All tests pass

### 3. Check Coverage

Coverage is automatically collected on Linux runners in CI.

**Verify coverage didn't decrease** by checking Codecov report on PR.
Coverage collection is temporarily disabled in CI during the xUnit v3 / MTP migration.

### 4. Format Code

Expand Down
48 changes: 20 additions & 28 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,37 @@

The repository uses multiple GitHub Actions workflows. What runs and when:

### 1) Build Solution (`.github/workflows/build.yml`)
> **Note:** Tests use xUnit v3 with Microsoft Testing Platform (MTP). The test runner is
> configured in `global.json` via `"test": { "runner": "Microsoft.Testing.Platform" }`.
> MTP runs test projects as standalone executables, so each OS must build its own binaries.

- **Triggers**: push and pull_request to `v2_release`, `v2_develop` (ignores `**.md`); supports `workflow_call`
### 1) Build Validation (`.github/workflows/build-validation.yml`)

- **Triggers**: push and pull_request to `v2_release`, `v2_develop` (ignores `**.md`)
- **Runner/timeout**: `ubuntu-latest`, 10 minutes
- **Steps**:
- Checkout and setup .NET 8.x GA
- Checkout and setup .NET 10.x GA
- `dotnet restore`
- Build Debug: `dotnet build --configuration Debug --no-restore -property:NoWarn=0618%3B0612`
- Build Release (library): `dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release --no-incremental --force -property:NoWarn=0618%3B0612`
- Pack Release: `dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages -property:NoWarn=0618%3B0612`
- Restore NativeAot/SelfContained examples, then restore solution again
- Build Release for `Examples/NativeAot` and `Examples/SelfContained`
- Build Release solution
- Upload artifacts named `build-artifacts`, retention 1 day

### 2) Build & Run Unit Tests (`.github/workflows/unit-tests.yml`)

- **Triggers**: push and pull_request to `v2_release`, `v2_develop` (ignores `**.md`)
- **Matrix**: Ubuntu/Windows/macOS
- **Timeout**: 15 minutes per job
- **Timeout**: 15 minutes (non-parallel), 60 minutes (parallel)
- **Process**:
1. Calls build workflow to build solution once
2. Downloads build artifacts
3. Runs `dotnet restore` (required for `--no-build` to work)
4. **Performance optimizations**:
1. Each OS checks out code, restores, and builds locally
2. **Performance optimizations**:
- Disables Windows Defender on Windows runners (significant speedup)
- Collects code coverage **only on Linux** (ubuntu-latest) for performance
- Windows and macOS skip coverage collection to reduce test time
- Increased blame-hang-timeout to 120s for Windows/macOS (60s for Linux)
5. Runs two test jobs:
- **Non-parallel UnitTests**: `Tests/UnitTests` with blame/diag flags; `xunit.stopOnFail=false`
- **Parallel UnitTestsParallelizable**: `Tests/UnitTestsParallelizable` with blame/diag flags; `xunit.stopOnFail=false`
6. Uploads test logs and diagnostic data from all runners
7. **Uploads code coverage to Codecov only from Linux runner**
3. Runs two test jobs:
- **Non-parallel UnitTests**: `Tests/UnitTests` with diagnostic output
- **Parallel UnitTestsParallelizable**: `Tests/UnitTestsParallelizable` with diagnostic output
4. Uploads test logs and diagnostic data from all runners

**Test results**: All tests output to unified `TestResults/` directory at repository root

Expand All @@ -45,16 +42,11 @@ The repository uses multiple GitHub Actions workflows. What runs and when:
- **Matrix**: Ubuntu/Windows/macOS
- **Timeout**: 15 minutes
- **Process**:
1. Calls build workflow
2. Downloads build artifacts
3. Runs `dotnet restore`
4. **Performance optimizations** (same as unit tests):
1. Each OS checks out code, restores, and builds locally
2. **Performance optimizations**:
- Disables Windows Defender on Windows runners
- Collects code coverage **only on Linux**
- Increased blame-hang-timeout to 120s for Windows/macOS
5. Runs IntegrationTests with blame/diag flags; `xunit.stopOnFail=true`
6. Uploads logs per-OS
7. **Uploads coverage to Codecov only from Linux runner**
3. Runs IntegrationTests with diagnostic output
4. Uploads logs per-OS

### 4) Create Release (`.github/workflows/release.yml`)

Expand Down Expand Up @@ -95,7 +87,7 @@ The repository uses multiple GitHub Actions workflows. What runs and when:
# Full CI sequence:
dotnet restore
dotnet build --configuration Debug --no-restore
dotnet test Tests/UnitTests --no-build --verbosity normal
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal
dotnet test --project Tests/UnitTests --no-build --verbosity normal
dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal
dotnet build --configuration Release --no-restore
```
63 changes: 9 additions & 54 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ on:
- '**.md'

jobs:
build:
uses: ./.github/workflows/quick-build.yml

integration_tests:
name: Integration Tests
runs-on: ${{ matrix.os }}
needs: build
strategy:
fail-fast: false # Let all OSes finish even if one fails
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
timeout-minutes: 15
Expand All @@ -33,57 +29,27 @@ jobs:
dotnet-version: 10.x
dotnet-quality: ga

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: test-build-artifacts
path: .

- name: Restore NuGet packages
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Disable Windows Defender (Windows only)
if: runner.os == 'Windows'
shell: powershell
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionProcess "dotnet.exe"
Add-MpPreference -ExclusionProcess "testhost.exe"
Add-MpPreference -ExclusionProcess "VSTest.Console.exe"

- name: Set VSTEST_DUMP_PATH
shell: bash
run: echo "VSTEST_DUMP_PATH=logs/IntegrationTests/${{ runner.os }}/" >> $GITHUB_ENV

- name: Run IntegrationTests
shell: bash
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
# Run with coverage on Linux only
dotnet test Tests/IntegrationTests \
--no-build \
--verbosity minimal \
--collect:"XPlat Code Coverage" \
--settings Tests/IntegrationTests/runsettings.coverage.xml \
--diag:logs/IntegrationTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
else
# Run without coverage on Windows/macOS for speed
dotnet test Tests/IntegrationTests \
--no-build \
--verbosity minimal \
--settings Tests/IntegrationTests/runsettings.xml \
--diag:logs/IntegrationTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
fi
dotnet test \
--project Tests/IntegrationTests \
--no-build \
--verbosity minimal \
--diagnostic --diagnostic-output-directory logs/IntegrationTests/${{ runner.os }}

- name: Upload Integration Test Logs
if: always()
Expand All @@ -93,14 +59,3 @@ jobs:
path: |
logs/IntegrationTests/
TestResults/

- name: Upload Integration Tests Coverage to Codecov
if: matrix.os == 'ubuntu-latest' && always()
uses: codecov/codecov-action@v4
with:
files: TestResults/**/coverage.cobertura.xml
flags: integrationtests
name: IntegrationTests-${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

Loading
Loading