From f4ab6510b8bfcf3d626dde7d60e73b9d95ab937a Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Mon, 11 Aug 2025 16:21:47 +0200 Subject: [PATCH 1/2] Clarify assertion message in a run-file test --- test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs index 809dc83780f7..e0649b6414fc 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs @@ -2090,7 +2090,7 @@ public static IEnumerable GetPathsOfCscInputsFromNuGetCache() { Log.WriteLine($"{codeFilePath.FullName} needs to be updated:"); Log.WriteLine(newText); - if (Environment.GetEnvironmentVariable("CI") == "true") + if (Env.GetEnvironmentVariableAsBool("CI")) { throw new InvalidOperationException($"Not updating file in CI: {codeFilePath.FullName}"); } @@ -2217,7 +2217,7 @@ Hello from {programName} var msbuildFileText = File.ReadAllText(msbuildFile); if (cscOnlyFileText.ReplaceLineEndings() != msbuildFileText.ReplaceLineEndings()) { - Log.WriteLine($"File differs between MSBuild and CSC-only runs: {cscOnlyFile}"); + Log.WriteLine($"File differs between MSBuild and CSC-only runs (if this is expected, find the template in '{nameof(CSharpCompilerCommand)}.cs' and update it: {cscOnlyFile}"); const int limit = 3_000; if (cscOnlyFileText.Length < limit && msbuildFileText.Length < limit) { From 132881218edb19fe2e5c6fffedebbe489e409448 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Mon, 11 Aug 2025 17:08:18 +0200 Subject: [PATCH 2/2] Add missing parenthesis Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs index e0649b6414fc..772db534eb19 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs @@ -2217,7 +2217,7 @@ Hello from {programName} var msbuildFileText = File.ReadAllText(msbuildFile); if (cscOnlyFileText.ReplaceLineEndings() != msbuildFileText.ReplaceLineEndings()) { - Log.WriteLine($"File differs between MSBuild and CSC-only runs (if this is expected, find the template in '{nameof(CSharpCompilerCommand)}.cs' and update it: {cscOnlyFile}"); + Log.WriteLine($"File differs between MSBuild and CSC-only runs (if this is expected, find the template in '{nameof(CSharpCompilerCommand)}.cs' and update it): {cscOnlyFile}"); const int limit = 3_000; if (cscOnlyFileText.Length < limit && msbuildFileText.Length < limit) {