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

Port NUnit based tests to Core CLR #690

Closed
PatrickMcDonald opened this issue Oct 19, 2015 · 18 comments
Closed

Port NUnit based tests to Core CLR #690

PatrickMcDonald opened this issue Oct 19, 2015 · 18 comments

Comments

@PatrickMcDonald
Copy link
Contributor

coreclr status: https://github.com/Microsoft/visualfsharp/wiki/F%23-for-CoreCLR---Status

I can start looking at this task for the CoreCLR project

@KevinRansom
Copy link
Member

Thank you, that would be awesome. You will have to make the tests build on coreclr first. Which is going to be an interesting challenge. Good luck.

@PatrickMcDonald
Copy link
Contributor Author

Have reached first hurdle well before looking at actually compiling on coreclr. I can't get the project to compile against Profile47 using xUnit.net. Is this surprising or expected?

xUnit.net seems to support portable-net45+win8+wp8+wpa81, whereas Profile47 includes Silverlight 5

The workaround for a similar issue with FsCheck was to exclude those tests for 47, but I have a feeling that won't fly this time.

Edit: Code so far is in this branch

@PatrickMcDonald
Copy link
Contributor Author

Also, @KevinRansom, I hope your comment yesterday wasn't intended to be encouraging, because it wasn't ;)

@enricosada
Copy link
Contributor

xunit require .net desktop > 4.5 , we cannot use it for .net 3.5

@forki
Copy link
Contributor

forki commented Oct 21, 2015

why is this change of framework needed?

@enricosada
Copy link
Contributor

see #688 ,

  1. Port the Nunit tests to XUnit 2.0. (XUnit is what Roslyn and .NetCore use).

@forki
Copy link
Contributor

forki commented Oct 21, 2015

but that's only a fact not a real reason.
AFAIK NUnit is also working on coreclr support.

@enricosada
Copy link
Contributor

yes, not ready yet but maybe we can meawhile upgrade nunit 2.1 -> 3.0, and wait for dnx support

ref nunit/nunit#575

in the last bet5, there is support for coreclr (need build from sourcecode) see Release-Notes nunit-300-beta-5

The NUnit framework may now be built for the .NET Core framework. Note that this is only available through building the source code. A binary will be available in the next release

Ihmo is better to stay on nunit, upgrade to 3.0 in main branch, port fsharp/fsharpqa to use nunit runner, and wait for full compatibility of nunit.
If nunit drop a target profile, we can anyway stub methods, and run with nunit 2.x, easier than xunit -> nunit migration

@KevinRansom
Copy link
Member

@forki Where possible we will use the same tooling as dotnet and coreclr OSS projects. This allows us to leverage work they do.

@rprouse
Copy link

rprouse commented Oct 21, 2015

NUnit has a new PR nunit/nunit#915 that adds .NET core support. We still need to test on various platforms and get 3.0 out, but we are close 👍

@forki
Copy link
Contributor

forki commented Oct 21, 2015

Yes reusing other people's work is a good idea. But here we should be
careful if that's really helpful. Changing test frameworks comes with lots
of trouble (but keeping outdated ones too ;-) ).

When nunit allows us to keep working with it, then I personally would not
want to change. Especially xunit2 has been a nightmare for me in the past.
On Oct 21, 2015 9:28 PM, "Kevin Ransom (msft)" [email protected]
wrote:

@forki https://github.com/forki Where possible we will use the same
tooling as dotnet and coreclr OSS projects. This allows us to leverage work
they do.


Reply to this email directly or view it on GitHub
#690 (comment)
.

@radekm
Copy link
Contributor

radekm commented Oct 21, 2015

Does xUnit.net 2 work with Mono?

@forki
Copy link
Contributor

forki commented Oct 22, 2015

Yes latest mono versions should support latest xunit2.
On Oct 22, 2015 12:08 AM, "radekm" [email protected] wrote:

Does xUnit.net 2 work with Mono?


Reply to this email directly or view it on GitHub
#690 (comment)
.

@KevinRansom
Copy link
Member

@PatrickMcDonald It's worth investigating the coreclr implementation of nunit. I doubt that converting the specific test framework will be anywhere near as hard as making the tests work on coreclr. But nunit is perfectly decent framework. The main goal is really to get this stuff working cross platform on coreclr anyway.

@PatrickMcDonald PatrickMcDonald changed the title Port NUnit based tests to XUnit 2.0 Port NUnit based tests to Core CLR Oct 26, 2015
@ctaggart
Copy link
Contributor

The NUnit support for CoreCLR already got merged to master. There is not a build with it in the NuGet Gallery yet. I just created this PR for them to add CI builds to the AppVeyor NuGet feed nunit/nunit#932.

Until that happens, it is available in my feed: https://ci.appveyor.com/nuget/ctaggart-nunit
Build history: https://ci.appveyor.com/project/ctaggart/nunit/history

@PatrickMcDonald
Copy link
Contributor Author

NUnit is now 3.0 RC, from the release notes:

NOTE: The nunit3-console runner cannot run tests that reference the portable build. You may run such tests using NUnitLite or a platform-specific runner.

Does this mean that running CoreCLR unit tests will not be supported in NUnit 3.0 without writing a custom console app?

@rprouse
Copy link

rprouse commented Nov 3, 2015

@PatrickMcDonald, the nunit3-console is a standard desktop app, so it does not run the DNX code. We plan on releasing runners for various platforms, but we are doing so out of band of the normal release. We are concentrating on getting 3.0 out the door then will be looking to creating runners for other platforms. The Xamarin runners are already done and at simple console runner shouldn't take too long.

In the meantime, you can reference NUnitLite making the tests themselves self-executable. All you need to do is add a couple of lines of code to Main and your tests are a console runner and tests all wrapped into one assembly.

@dsyme
Copy link
Contributor

dsyme commented Jul 7, 2016

Closing old discussion

@dsyme dsyme closed this as completed Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants