Skip to content

test: enable parallelism, add NSubstitute, document test infrastructure (TEST-M4, H1)#418

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/test-quality
May 18, 2026
Merged

test: enable parallelism, add NSubstitute, document test infrastructure (TEST-M4, H1)#418
laurentiu021 merged 1 commit into
mainfrom
fix/test-quality

Conversation

@laurentiu021

@laurentiu021 laurentiu021 commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses test quality findings TEST-M4 and TEST-H1 from the full review.

Changes

TEST-M4: Enable test parallelism

  • Changed xunit.runner.json: parallelizeTestCollections true, maxParallelThreads 0 (auto)
  • Tests using shared OS resources remain serialized via [Collection] attributes
  • Reduced longRunningTestSeconds from 120 to 30 for faster flaky detection

TEST-H1: Add mocking framework

  • Added NSubstitute 5.3.0 to the test project
  • Enables interface-based mocking for future tests that need to isolate OS dependencies
  • No existing tests modified — this is infrastructure for new tests going forward

Documentation

  • Updated TESTING.md with test infrastructure section (frameworks table, parallelism strategy, conventions)

Note

This is a test: commit — no release triggered. TEST-H2 (coverage gaps), TEST-M1 (flaky tests), and TEST-M2 (thread-safety assertions) are tracked in issue #320 for incremental improvement.

Testing

  • Build: 0 errors (tests project compiles with NSubstitute)

Summary by CodeRabbit

  • Documentation

    • Added test infrastructure documentation covering frameworks, parallelization strategy, and testing best practices.
  • Chores

    • Optimized test execution speed through enhanced parallel processing configuration.
    • Updated testing framework dependencies to the latest versions.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7841042e-3769-4118-9505-02ec6543d0d3

📥 Commits

Reviewing files that changed from the base of the PR and between c6c335b and 1c95865.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • SysManager/SysManager.Tests/SysManager.Tests.csproj
  • SysManager/SysManager.Tests/xunit.runner.json
  • TESTING.md
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & unit tests
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (4)
SysManager/SysManager.Tests/xunit.runner.json (1)

3-5: LGTM!

SysManager/SysManager.Tests/SysManager.Tests.csproj (1)

16-16: LGTM!

TESTING.md (1)

52-77: LGTM!

CHANGELOG.md (1)

9-20: LGTM!


📝 Walkthrough

Walkthrough

The PR enables xUnit test collection parallelization, adds NSubstitute 5.3 to test dependencies, adjusts test runner configuration thresholds, and documents the test infrastructure setup and testing conventions.

Changes

Test Infrastructure Configuration and Documentation

Layer / File(s) Summary
Test parallelization and NSubstitute dependency
SysManager/SysManager.Tests/xunit.runner.json, SysManager/SysManager.Tests/SysManager.Tests.csproj
xUnit runner configuration enables parallelizeTestCollections, sets maxParallelThreads to 0 (unlimited), and reduces longRunningTestSeconds to 30. NSubstitute 5.3.0 is added as a test project package reference.
Test infrastructure and changelog documentation
TESTING.md, CHANGELOG.md
TESTING.md documents test frameworks, explains collection-based parallelism with isolation for resource-sharing tests, and lists testing conventions for speed and determinism. CHANGELOG.md records version 0.48.31 with notes on parallelism enabling, NSubstitute addition, and TESTING.md documentation.

Possibly Related PRs

  • laurentiu021/SystemManager#368: Applies [Collection("OperationLock")] attributes to specific tests to ensure they are isolated under the parallel execution model enabled in this PR.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 hop hop – tests in parallel we go,
NSubstitute mocks make chaos flow,
Collections grouped, no races to know,
Config and docs together grow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the three main changes: enabling test parallelism, adding NSubstitute dependency, and documenting test infrastructure, making it clear and specific to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/test-quality

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@laurentiu021
laurentiu021 merged commit 9ec2e90 into main May 18, 2026
5 checks passed
@laurentiu021
laurentiu021 deleted the fix/test-quality branch May 18, 2026 08:45
laurentiu021 added a commit that referenced this pull request May 22, 2026
…re (TEST-M4, H1) (#418)

Co-authored-by: laurentiu021 <laurentiu021@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants