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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.48.31] - 2026-05-18

### Changed
- **Test parallelism** — enabled `parallelizeTestCollections` in xunit.runner.json
so pure-logic unit tests run concurrently, reducing CI test time. Tests that
touch shared OS resources remain serialized via `[Collection("Network")]`
(TEST-M4).
- **Mocking framework** — added NSubstitute 5.3 to the test project, enabling
interface-based mocking for future tests that need to isolate OS dependencies
(TEST-H1).
- **TESTING.md** — documented test infrastructure (frameworks, parallelism
strategy, conventions for mocking and time-dependent tests).

## [0.48.30] - 2026-05-18

### Fixed
Expand Down
1 change: 1 addition & 0 deletions SysManager/SysManager.Tests/SysManager.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="Xunit.StaFact" Version="1.1.11" />
Expand Down
6 changes: 3 additions & 3 deletions SysManager/SysManager.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parallelizeAssembly": false,
"parallelizeTestCollections": false,
"maxParallelThreads": 1,
"longRunningTestSeconds": 120
"parallelizeTestCollections": true,
"maxParallelThreads": 0,
"longRunningTestSeconds": 30
}
27 changes: 27 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,33 @@ Coverage is collected automatically on CI via `coverlet` and uploaded to
[Codecov](https://codecov.io/gh/laurentiu021/SystemManager). The badge in
`README.md` reflects the latest `main` branch result.

## Test infrastructure

### Frameworks

| Package | Purpose |
|---|---|
| xUnit 2.9 | Test framework |
| NSubstitute 5.3 | Mocking/substitution for interface-based testing |
| coverlet | Code coverage collection |
| Xunit.StaFact | STA thread support for WPF-dependent tests |

### Parallelism

Unit tests run in parallel by default (`parallelizeTestCollections: true`).
Tests that share state or touch OS resources are isolated via xUnit
collection definitions:

- `[Collection("Network")]` — tests using ICMP sockets run sequentially.

### Conventions

- Pure logic tests (parsers, analyzers, converters) need no mocking.
- Tests that depend on OS services should use NSubstitute to mock the
service interface, keeping the test fast and deterministic.
- Time-dependent tests should use injectable time sources or generous
tolerances to avoid flakiness on slow CI runners.

To generate a local coverage report:

```powershell
Expand Down
Loading