-
Notifications
You must be signed in to change notification settings - Fork 588
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
Exception System.InvalidCastException thrown when running NUnit and FsCheck tests #855
Comments
This issue was also reported on FsCheck: A possible work around is to specify -domain:None flag to the nunit console runner, however FAKE doesn't seem to give you an option. https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/UnitTest/NUnit/Common.fs type NUnitDomainModel =
/// No domain is created - the tests are run in the primary domain. This normally requires copying the NUnit assemblies into the same directory as your tests.
| DefaultDomainModel
/// A test domain is created - this is how NUnit worked prior to version 2.4
| SingleDomainModel
/// A separate test domain is created for each assembly
| MultipleDomainModel with
member x.ParamString =
match x with
| DefaultDomainModel -> ""
| SingleDomainModel -> "Single"
| MultipleDomainModel -> "Multiple" DefaultDomainModel claims to specify "No domain", but doesn't specify None in the ParamString method which seems to default to Single. I think Default should specify "None" as per Nunit docs but probably needs to Default to single as to not break things. |
Aligning Fake Nunit Domain model to what Nunit docs say http://www.nunit.org/index.php?p=consoleCommandLine&r=2.5
this bug is still present with you can see the log from travis |
@sideeffffect Make sure in your build.fsx you set the domain to DefaultDomainModel to specify no domain. |
I get the error
|
Whoops sorry, Copy paste is not my friend. Target "RunTests" (fun _ ->
!! testAssemblies
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
Domain = NUnitDomainModel.DefaultDomainModel
TimeOut = TimeSpan.FromMinutes 20.
OutputFile = "TestResults.xml" })
) |
great, that worked, seems to be fixed now. thank you! |
Not fixed for me. My build.fsx has:
and my tests are:
Still gives me the error
FAKE version is 4.17.1 |
Are changes required for this from the NUnit team? If so, please report to nunit/nunit#731 |
@DavidTheBugWriter Feel free to open a new issue if needed. |
Hello, I have a trivial project started from
ProjectScaffold
.I have a test file
tests/FSharpHello.Tests/Tests.fs
like this:and I get error like this
this exception is thrown only when I run the build script
./build.sh
from shell. when build or run tests in MonoDevelop, everything seems ok.is this a bug in FAKE? if not, where is the problem?
The text was updated successfully, but these errors were encountered: