-
Notifications
You must be signed in to change notification settings - Fork 293
feat: add xUnit testing harness #3044
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
Conversation
Yes.
If you wait a little xunit.v3 will be released and it contains new features like a |
Maybe we could follow their name
Yes. That was a headache. We were using |
3dc5819 to
81d6e53
Compare
|
I don't have any comments to the code, it all looks pretty good / standard to me. I would name the namespace, And the nuget Microsoft.Playwright.XUnit. Because I see the capitalization with existing packages all over the place. @bradwilson do you have different preferences on the capitalization of the xunit name? |
|
In theory, the only capitalization "rules" are:
In practice, people do whatever they want. 😁 The product name being "xUnit.net" is really because back in the day, "xUnit" meant "replace 'x' with something that represents your programming environment". SUnit = Smalltalk, JUnit = Java, NUnit = .NET. Since NUnit was already taken, we opted for "xUnit.net" as the next best name. (And by "we" I mean @jnewkirk who also was part of creating NUnit. 😉) File names or package names, we don't care about. We use all lowercase for ours, but we've never asked anybody to follow that pattern. Frankly it's like that mostly because I'm an Extra Oldster™️ who likes lowercase file names because of case sensitive file systems. |
|
I will say, |
|
I don’t feel strongly about the name, but I do prefer I prefer Xunit over xUnit in the package name. |
| return await browserType.LaunchAsync(PlaywrightSettingsProvider.LaunchOptions).ConfigureAwait(false); | ||
| } | ||
|
|
||
| var exposeNetwork = Environment.GetEnvironmentVariable("PLAYWRIGHT_SERVICE_EXPOSE_NETWORK") ?? "<loopback>"; |
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.
Do we need all this service code right away? If so, can it at least be shared with other runners?
First stab for adding xUnit testing harness for Playwright since they changed their parallelism algorithm which unblocked us. So far I found the following questions along the way:
Microsoft.Playwright.xUnitvsMicrosoft.Playwright.XUnitConsole.WriteLinedoesn't work in the test method? I had to follow this guide instead to make it work. Looks like we can use Console / Trace / Debugger capture support xunit/xunit#1730 (comment) once its released.AppDomain.CurrentDomain.FirstChanceExceptionto determine if a test failed and restart the worker services (mostly Browser) appropriately? Inspired by @SimonCropp from here. We need some hack since there is no TestContext in xUnit.net8.0fine?AppDomainis only available innet5.0+. xUnit itself targetsnet472;net6.0. Maybe we should target both as well and provideAppDomainsupport only for thenet6.0output.Curious about your inputs @kblok @campersau @nohwnd thank you in advance!
Relates #2977