Skip to content

xUnit v3 migration, source-generated logging, scoped Copilot instructions & dependency bumps#34

Merged
f2calv merged 11 commits into
mainfrom
f2calv/2026-06-updates
Jun 12, 2026
Merged

xUnit v3 migration, source-generated logging, scoped Copilot instructions & dependency bumps#34
f2calv merged 11 commits into
mainfrom
f2calv/2026-06-updates

Conversation

@f2calv

@f2calv f2calv commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Overview

A maintenance/modernisation pass on SmartHaus covering the test stack, structured logging, repository conventions and dependency updates. No functional behaviour changes to the running application beyond richer log output and event environment tagging.

Changes

Testing — migrate to xUnit v3

  • Replace xunit 2.9.3 with xunit.v3 3.2.2 (keeping xunit.runner.visualstudio) in Directory.Packages.props, updated across all *.Tests.csproj projects.
  • Update IAsyncLifetime implementations to the v3 signature (TaskValueTask) in WebApiTestBase.
  • Thread TestContext.Current.CancellationToken through async HTTP/assertion calls (HealthTests, SystemControllerTests, SignalCli* tests, etc.).
  • Remove now-redundant global using Xunit; from per-project GlobalUsings.cs.

Source-generated logging in CommunicationsBgService

  • New CommunicationsBgService.Logging.cs partial holding [LoggerMessage] definitions for the stream, polling, inbound-processing and reply-queue paths.
  • Replace inline _logger.LogXxx(...) calls in the .Messaging, .Stream and main partials with the generated strongly-typed methods.
  • Add global using System.Threading.Channels; to the project's GlobalUsings.cs.

Event environment tagging (HostEnvironment fixes)

  • Inject IHostEnvironment and stamp Environment = env.GetAcronym() onto emitted CommsEvents across DDnsBgService, MediaBgService and the *SinkCommsStreamService comms-stream sinks (Buderus, DoorBird, EdgeHardware, Fronius, Knx, Miele, Shelly, Sicce, Ubiquiti, Wiz).

Repository conventions — scoped Copilot instructions

  • Slim the monolithic .github/copilot-instructions.md down to a synced overview.
  • Split detailed conventions into scoped .github/instructions/*.instructions.md files (csharp, csharp.testing, csharp.mcp, csharp.azure, dotnet, github-actions, documentation, configuration) auto-applied by file type.

Dependency bumps (Directory.Packages.props)

  • CasCap.Common.* 4.11.94.12.0
  • CasCap.Api.Azure.* 1.4.131.5.0
  • OpenTelemetry / OpenTelemetry.Extensions.Hosting 1.15.31.16.0
  • Spectre.Console* 0.56.00.57.0

Testing

dotnet build SmartHaus.Debug.slnx succeeds. dotnet test reports 490 passed / 10 skipped; the remaining failures are integration tests requiring external infrastructure not available locally (Buderus KM200 device, local Ollama/LLM endpoint, and the WebApplicationFactory-hosted health probes).

f2calv added 10 commits June 10, 2026 16:44
Replace ConcurrentQueue+SemaphoreSlim with Channel<ReplyRequest> to align
with the SignalCli JSON-RPC client pattern.

Add CommunicationsBgService.Logging.cs with [LoggerMessage]-attributed
static partial methods for all hot-path log calls in the Stream and
Messaging partials, eliminating params boxing allocations in the poll loop,
stream consumer, and reply queue drain.
@f2calv f2calv self-assigned this Jun 12, 2026
@f2calv f2calv added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels Jun 12, 2026
@f2calv f2calv changed the title F2calv/2026 06 updates xUnit v3 migration, source-generated logging, scoped Copilot instructions & dependency bumps Jun 12, 2026
@f2calv f2calv merged commit 5db9f8b into main Jun 12, 2026
2 checks passed
@f2calv f2calv deleted the f2calv/2026-06-updates branch June 12, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant