coder / coder/coder-desktop-windows

Avoid configuring DI for ILogger<T> in tests

Offen
#99 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
26
Forks
12
Ø Merge
6 Std. 50 Min.
Gemergte PRs (30 T.)
1

Beschreibung

In some test code we are creating a host application builder and instantiating serilog to do app logging.

https://github.com/coder/coder-desktop-windows/blob/a6f7bb67bb111628d3de1f46d7b404d4bab67717/App/Services/MutagenController.cs#L160-L162

We should probably just write an implementation for `ILogger` and `ILogger` that log to the test output. It can use serilog under the hood if that makes it easier.

IDK where we'd put it, though. Maybe we should add add a `Test.Utils` project or something

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by inspecting the test host setup and App/Services/MutagenController.cs around lines 160-162, where Serilog and dependency injection are configured for logging. Trace the affected tests and determine how their output is captured; the work is done when they can use a test logger without configuring a host application builder or Serilog instance.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
testing
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.