Skip to content

Debug correctnss #78417

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
Expand Up @@ -640,6 +640,8 @@ await checkHelpLinkAsync(helpLinkUri).ConfigureAwait(false))
{
await Console.Error.WriteLineAsync($"Missing entry in {fileWithPath}").ConfigureAwait(false);
await Console.Error.WriteLineAsync(line).ConfigureAwait(false);
await Console.Error.WriteLineAsync("Actual:").ConfigureAwait(false);
await Console.Error.WriteLineAsync(string.Join(Environment.NewLine, actualContent)).ConfigureAwait(false);
// The file is missing an entry. Mark it as invalid and break the loop as there is no need to continue validating.
fileNamesWithValidationFailures.Add(fileWithPath);
break;
Expand All @@ -664,6 +666,7 @@ async Task<bool> checkHelpLinkAsync(string helpLink)
{
if (!Uri.TryCreate(helpLink, UriKind.Absolute, out var uri))
{
await Console.Error.WriteLineAsync($"Failed to create URI for {helpLink}:").ConfigureAwait(false);
return false;
}

Expand All @@ -674,10 +677,15 @@ async Task<bool> checkHelpLinkAsync(string helpLink)

var request = new HttpRequestMessage(HttpMethod.Head, uri);
using var response = await httpClient.SendAsync(request).ConfigureAwait(false);
await Console.Error.WriteLineAsync("Response: " + response).ConfigureAwait(false);
await Console.Error.WriteLineAsync("Status code: " + response?.StatusCode).ConfigureAwait(false);
await Console.Error.WriteLineAsync("content: " + response?.Content).ConfigureAwait(false);
return response?.StatusCode == HttpStatusCode.OK;
}
catch (WebException)
catch (WebException ex)
{
await Console.Error.WriteLineAsync($"Exception checking {helpLink}:").ConfigureAwait(false);
await Console.Error.WriteLineAsync(ex.ToString()).ConfigureAwait(false);
return false;
}
}
Expand Down Expand Up @@ -1185,6 +1193,10 @@ private static void Validate(string fileWithPath, string fileContents, List<stri
string actual = File.ReadAllText(fileWithPath);
if (actual != fileContents)
{
Console.Error.WriteLine($"{fileWithPath} is different. We built:");
Console.Error.WriteLine(fileContents);
Console.Error.WriteLine($"But actually had:");
Console.Error.WriteLine(actual);
fileNamesWithValidationFailures.Add(fileWithPath);
}
}
Expand Down
Loading