-
Notifications
You must be signed in to change notification settings - Fork 698
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
Change Apex tests from Xunit to MSTest #5428
Change Apex tests from Xunit to MSTest #5428
Conversation
This reverts commit 9a3d091.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks good. Thanks, @heng-liu!
test/NuGet.Tests.Apex/NuGet.Tests.Apex/Apex/SharedVisualStudioHostTestClass.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Tests.Apex/NuGet.Tests.Apex/Apex/SharedVisualStudioHostTestClass.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Tests.Apex/NuGet.Tests.Apex/NuGetEndToEndTests/IVsServicesTestCase.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Tests.Apex/NuGet.Tests.Apex/NuGetEndToEndTests/NetCoreProjectTestCase.cs
Outdated
Show resolved
Hide resolved
@@ -22,12 +21,15 @@ public class IVsServicesTestCase : SharedVisualStudioHostTestClass, IClassFixtur | |||
|
|||
private readonly SimpleTestPathContext _pathContext = new SimpleTestPathContext(); | |||
|
|||
public IVsServicesTestCase(VisualStudioHostFixtureFactory visualStudioHostFixtureFactory, ITestOutputHelper output) | |||
: base(visualStudioHostFixtureFactory, output) | |||
private const int Timeout = 5 * 60 * 1000; // 5 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move this to a shared location as a global default and reuse it everywhere, instead of redefining Timeout
in every test class. On a case-by-case basis, we can override the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Moved it to test/NuGet.Tests.Apex/NuGet.Tests.Apex/Apex/SharedVisualStudioHostTestClass.cs
test/NuGet.Tests.Apex/NuGet.Tests.Apex/NuGetEndToEndTests/NetCoreProjectTestCase.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this!
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/2379
Regression? Last working version:
Description
Background
MSTest is able to time out individual Apex test, and it could attach files for diagnosing the flakiness. So we decided to migrate Apex test from Xunit to MSTest.
1.Change Apex test from Xunit to MSTest:
Theory
->TestMethod
,InlineData
->DataRow
,Skip
->Ignore
, etc.Timeout
attribute for each Apex testsITestLogger
and follow the suggestions in the wiki.In the recent 11 runs, the Apex tests passed 8 times.
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation