Skip to content
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

[Merge-on-Red] - Implement XML log fixer for Helix #80751

Merged
merged 23 commits into from
Feb 14, 2023
Merged

[Merge-on-Red] - Implement XML log fixer for Helix #80751

merged 23 commits into from
Feb 14, 2023

Conversation

ivdiazsa
Copy link
Member

The XML fixer work item from #77735. This PR implements two main things:

  • The test work items XML logs are now written as they are occurring, rather than everything at the end. This will allow us to process the tests that did run before the work item crashed, and consequently, it'll be much easier to determine which test crashed.
  • When the case described by the previous point happens, it will be very likely the XML log will be incomplete, and therefore unreadable by programs and scripts. The log fixer reads through it all, and appends the missing closing tags, so the log can be processed accordingly, rather than crash everything later on as well.

@ivdiazsa ivdiazsa self-assigned this Jan 17, 2023
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

.Where(c => char.IsLetter(c))
.ToArray());

if (nextClosing.Equals(tags.Peek()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we flush all writes to the xUnit log? Otherwise a crash may end up with an incomplete log finishing with a partial close tag mismatching the corresponding open tag - I guess we may be able to work around it but I suspect it would require a more precise XML scanner - I leave it up to you and Jeremy to decide whether it's worth it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that would be an issue. For example, let's suppose we are running Methodical_d1.sh. If I click Ctrl-C midrun, it literally stops logging right then and there, so I don't think we would end up with this mismatching example.

using System.Collections.Generic;
using System.Text;
namespace XUnitWrapperLibrary;

public class TestSummary
{
readonly record struct TestResult(string Name, string ContainingTypeName, string MethodName, TimeSpan Duration, Exception? Exception, string? SkipReason, string? Output);
// readonly record struct TestResult(string Name, string ContainingTypeName, string MethodName, TimeSpan Duration, Exception? Exception, string? SkipReason, string? Output);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably obsolete comment worth deleting. Just for my education, what is the benefit of using record here, is that about something like automatically generated IComparer / Equals / GetHashCode implementations or is there more to it?

Copy link
Member Author

@ivdiazsa ivdiazsa Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there is a tangible benefit/degrade to using record here. It was already there so I opted to not touch it since I was able to adapt it easily :)

Also, yes that comment ought to be removed. I forgot about it when running some tests.

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall assuming is passes in the lab ;-), thanks Ivan!

@ivdiazsa ivdiazsa marked this pull request as draft February 8, 2023 02:01
@ivdiazsa ivdiazsa marked this pull request as ready for review February 9, 2023 02:01
@ivdiazsa ivdiazsa merged commit 3cb2dae into dotnet:main Feb 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 16, 2023
@ivdiazsa ivdiazsa deleted the xml-regearing branch April 24, 2023 22:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants