Skip to content

Commit 8faaf05

Browse files
committed
chore: Update copilot instructions and add claude instructions
1 parent 8d50541 commit 8faaf05

File tree

2 files changed

+454
-2
lines changed

2 files changed

+454
-2
lines changed

.github/copilot-instructions.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-ins
4848

4949
## 🛠️ Build & Test Commands
5050

51-
**Critical**: `dotnet workload restore` is required to compile. Do this before any `dotnet build` commands.
51+
This project uses **Microsoft Testing Platform (MTP)** with the **TUnit** testing framework. Test commands differ significantly from traditional VSTest.
52+
53+
See: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=dotnet-test-with-mtp
54+
55+
**CRITICAL:** `dotnet workload restore` is required to compile. Do this before any `dotnet build` commands.
5256

5357
**Run these commands in Windows PowerShell or CMD from the repository root:**
5458

@@ -67,11 +71,66 @@ dotnet restore src/ReactiveUI.sln
6771
6872
# Build the solution (requires Windows for platform-specific targets)
6973
dotnet build src/ReactiveUI.sln -c Release -warnaserror
74+
```
75+
76+
### Test Commands (Microsoft Testing Platform)
77+
78+
**CRITICAL:** This repository uses MTP configured in `src/global.json`. All TUnit-specific arguments must be passed after `--`.
7079

71-
# Run tests (includes AOT tests that require .NET 9.0)
80+
**Note:** Commands below assume repository root as working directory. Use `src/` prefix for paths.
81+
82+
```powershell
83+
# Run all tests
7284
dotnet test src/ReactiveUI.sln -c Release --no-build
85+
86+
# Run tests with code coverage (Microsoft Code Coverage)
87+
dotnet test src/ReactiveUI.sln -- --coverage --coverage-output-format cobertura
88+
89+
# Run specific test project
90+
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj
91+
92+
# Run single test using treenode-filter (syntax: /{Assembly}/{Namespace}/{Class}/{Method})
93+
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --treenode-filter "/*/*/*/MyTestMethod"
94+
95+
# Run tests in a specific class
96+
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --treenode-filter "/*/*/MyClassName/*"
97+
98+
# Filter by test property (e.g., Category)
99+
dotnet test src/ReactiveUI.sln -- --treenode-filter "/*/*/*/*[Category=Integration]"
100+
101+
# List all available tests
102+
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --list-tests
103+
104+
# Fail fast (stop on first failure)
105+
dotnet test src/ReactiveUI.sln -- --fail-fast
106+
107+
# Generate TRX report with coverage
108+
dotnet test src/ReactiveUI.sln -- --coverage --coverage-output-format cobertura --report-trx --output Detailed
73109
```
74110

111+
**TUnit Treenode-Filter Syntax:**
112+
113+
Pattern: `/{AssemblyName}/{Namespace}/{ClassName}/{TestMethodName}`
114+
115+
Examples:
116+
- Single test: `--treenode-filter "/*/*/*/MyTestMethod"`
117+
- All tests in class: `--treenode-filter "/*/*/MyClassName/*"`
118+
- All tests in namespace: `--treenode-filter "/*/MyNamespace/*/*"`
119+
- Filter by property: `--treenode-filter "/*/*/*/*[Category=Integration]"`
120+
121+
**Key TUnit Command-Line Flags:**
122+
- `--treenode-filter` - Filter tests by path or properties
123+
- `--coverage` - Enable Microsoft Code Coverage
124+
- `--coverage-output-format` - Set format (cobertura, xml, coverage)
125+
- `--report-trx` - Generate TRX reports
126+
- `--output` - Verbosity (Normal or Detailed)
127+
- `--list-tests` - Display tests without running
128+
- `--fail-fast` - Stop after first failure
129+
- `--maximum-parallel-tests` - Limit concurrent execution
130+
- `--disable-logo` - Remove TUnit logo
131+
132+
See https://tunit.dev/docs/reference/command-line-flags for complete reference.
133+
75134
> **Note:** The repository contains Windows-specific target frameworks (`net8.0-windows`, `net9.0-windows`) and AOT tests that require .NET 9.0. Building on Linux/macOS will fail due to these platform dependencies.
76135
77136
> **For non-Windows environments:** If working in this repository on Linux/macOS (such as in GitHub Codespaces), focus on documentation changes, code analysis, and understanding patterns rather than attempting to build. The build failure is expected and normal.

0 commit comments

Comments
 (0)