Skip to content

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

@arialdomartini

Description

@arialdomartini

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions