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

Tests discovery stops working when defining FsCheck's generators of DateOnly #476

Open
arialdomartini opened this issue Aug 13, 2023 · 1 comment

Comments

@arialdomartini
Copy link
Contributor

I stumbled upon a weird behavior with Expecto and FsCheck
I'm not sure if it depends on one or the other, though.

TL;DR changing

let randomDate = Arb.toGen Arb.from<DateTime>

to

let randomDate = Arb.toGen Arb.from<DateOnly>

prevents Riders from discovering the Expecto tests.

I've got this dummy module:

module FSharpBits.PropertyBasedTesting.WithFsCheck.Puzzling

open FsCheck
open Expecto
open System

let randomDate = Arb.toGen Arb.from<DateTime>

[<Tests>]
let treeTests =
    test "just fail please"
        { Tests.failtest "I'm just failing" }

Notice how that randomDate is unused.

Tests are discovered with YoloDev.Expecto.TestSdk and by checking Enable VSTest adapters support, as per #326.

When randomDate generates a DateTime the test explorer shows:

image

When it is set to generate DateOnly instead of DateTime, all the Expecto tests, from all the modules, just stop being discovered:

image

The few tests still being discovered are the xUnit tests only.

Any idea how I could debug this weird behavior?

@farlee2121
Copy link
Collaborator

Hmm. The first thing I'd do is try to see if upstream steps are working.

In particular you could run the test project with dotnet run to see if Expecto alone is discovering tests. Then you can run with dotnet test to see if the transition from Execto to YoloDev/dotnet test is working correctly. If all of that is ok, then it's probably an issue in Rider that Jetbrains would need to fix.

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

2 participants