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

Plumb test failures through to github #15831

Merged
merged 8 commits into from
Aug 15, 2023
Merged

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Aug 14, 2023

This does two bits:

  1. correctly marks our tests as failed in xUnit, so that AzDo will pick up that the tests have failed.
  2. Actually intentionally mark skipped tests as skipped in xUnit. We were doing this accidentally before.
  3. Add a CI step to log test failures in a way that they can show up on GitHub

Probably regressed around #6992 and #4490.

details

Part the first

We were relying on the MUX build scripts to convert our WTT test logs to xUnit format, which AzDo then ingests. That script we used relied on some WinUI-specific logic around retrying tests. They have some logic to auto-retry failed tests. They then mark a test as "skipped" if it passed less than some threshold of times. Since we were never setting that variable, we would mark a test as "skipped" if it had 0 passes. So, all failures showed up on AzDo as "skipped".

Why didn't we notice this? Well, the Run-Tests.ps1 script will still return 1 if any tests failed. So the test job would fail if there was a failure, AzDo just wouldn't know which test it was.

part the second

Updates ConvertWttLogToXUnitLog in HelixTestHelpers.cs to understand that a test can be skipped, in addition to pass/fail. Removes all the logic for dealing with retries, cause we didn't need that.

part the third

TAEF doesn't emit error messages in a way that AzDo can immediately pick up on which tests failed. This means that Github gives us this useless error message:
image
That's the only "error" that AzDo knows about.

This PR changes that by adding a build step to manually parse the xUnit results, and log the names of any tests that failed. By logging them with a prefix of ##vso[task.logissue type=error], then AzDo will surface that text as an error message. GitHub can then grab that text and surface it too.

Addenda: Why aren't we using the VsTest module

as noted in #4490 (comment), the vstest module is literally 6x slower than just running TAEF directly.

closes #7286

@zadjii-msft zadjii-msft changed the title Attempt to plumb test failures through to github Plumb test failures through to github Aug 14, 2023
@zadjii-msft zadjii-msft added Area-Build Issues pertaining to the build system, CI, infrastructure, meta Product-Meta The product is the management of the products. Issue-Task It's a feature request, but it doesn't really need a major design. labels Aug 14, 2023
build/Helix/HelixTestHelpers.cs Outdated Show resolved Hide resolved
Comment on lines 22 to +23
public bool Passed { get; set; }
public bool Skipped { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

nit: This could be an enum to make the if() / if(!) code a bit simpler.

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
@zadjii-msft zadjii-msft merged commit 8f4c63e into main Aug 15, 2023
@zadjii-msft zadjii-msft deleted the dev/migrie/some-tests-in-azdo branch August 15, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Task It's a feature request, but it doesn't really need a major design. Product-Meta The product is the management of the products.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of Skipped Tests in Helix framework
3 participants