Skip to content

dump-logs? #15187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

using FluentAssertions;
Expand Down Expand Up @@ -158,6 +161,27 @@ public void RunAllTestsWithMixedTFMsWillProvideAdditionalInformationToTheDebugge
vstestConsoleWrapper.RunTestsWithCustomTestHost(new[] { netFrameworkDll, netDll }, runsettingsXml, runEventHandler, testHostLauncher);

// Assert
if (runEventHandler.Errors.Any())
{
var tempPath = TempDirectory.Path;
var files = System.IO.Directory.GetFiles(tempPath, "*.txt").ToList();
if (files.Count == 0)
{
throw new InvalidOperationException($"No error files found in {tempPath}. {string.Join("\n", Directory.GetFiles(tempPath))}");
}

var allText = new StringBuilder();
foreach (var file in files)
{
#pragma warning disable CA1305 // Specify IFormatProvider
allText.AppendLine($"Error file: {file}");
allText.AppendLine(File.ReadAllText(file));
allText.AppendLine();
#pragma warning restore CA1305 // Specify IFormatProvider
}
throw new InvalidOperationException($"Logs: {allText}");
}

runEventHandler.Errors.Should().BeEmpty();
testHostLauncher.AttachDebuggerInfos.Should().HaveCount(2);
var targetFrameworks = testHostLauncher.AttachDebuggerInfos.Select(i => i.TargetFramework).ToList();
Expand Down
Loading