coder / coder/coder-desktop-windows

Avoid configuring DI for ILogger<T> in tests

Ouverte
#99 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C#
Étoiles
26
Forks
12
Merge moyen
6 h 50 min
PR mergées (30 j)
1

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp
Domaine
testing
Type d'issue
Refactorisation
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.