Skip to content

Commit 61cffbd

Browse files
committed
Fix gRPC interop tests
1 parent 4d4f2fe commit 61cffbd

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Grpc/test/testassets/InteropClient/InteropClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
using Grpc.Testing;
3535
using Microsoft.Extensions.DependencyInjection;
3636
using Microsoft.Extensions.Logging;
37+
using Microsoft.Extensions.Logging.Console;
3738
using Newtonsoft.Json.Linq;
3839

3940
namespace InteropTestsClient
@@ -96,11 +97,11 @@ private InteropClient(ClientOptions options)
9697
var services = new ServiceCollection();
9798
services.AddLogging(configure =>
9899
{
99-
configure.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
100+
configure.SetMinimumLevel(LogLevel.Trace);
100101
configure.AddSimpleConsole(loggerOptions =>
101102
{
102103
loggerOptions.IncludeScopes = true;
103-
loggerOptions.DisableColors = true;
104+
loggerOptions.ColorBehavior = LoggerColorBehavior.Disabled;
104105
});
105106
});
106107

src/Grpc/test/testassets/InteropWebsite/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using Microsoft.Extensions.Configuration;
2424
using Microsoft.Extensions.Hosting;
2525
using Microsoft.Extensions.Logging;
26+
using Microsoft.Extensions.Logging.Console;
2627

2728
namespace InteropTestsWebsite
2829
{
@@ -37,7 +38,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
3738
Host.CreateDefaultBuilder(args)
3839
.ConfigureLogging(builder =>
3940
{
40-
builder.AddSimpleConsole(o => o.DisableColors = true);
41+
builder.AddSimpleConsole(o => o.ColorBehavior = LoggerColorBehavior.Disabled);
4142
builder.SetMinimumLevel(LogLevel.Trace);
4243
})
4344
.ConfigureWebHostDefaults(webBuilder =>

src/Shared/Process/ProcessEx.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null)
218218
private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE")))
219219
? typeof(ProcessEx).Assembly
220220
.GetCustomAttributes<AssemblyMetadataAttribute>()
221-
.First(attribute => attribute.Key == "TestPackageRestorePath")
222-
.Value
221+
.FirstOrDefault(attribute => attribute.Key == "TestPackageRestorePath")
222+
?.Value
223223
: Environment.GetEnvironmentVariable("NUGET_RESTORE");
224224

225225
public void Dispose()

0 commit comments

Comments
 (0)