haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Filtering seems not to work #378

Closed blair55 closed 4 years ago

blair55 commented 4 years ago

I cannot replicate the documented filtering behaviour when running a test suite locally with Expecto 9.0.

I have taken the example below from the filtering unit test https://github.com/haf/expecto/blob/498a4d2c5a675ff068a842b70bdfe271f374ead5/Expecto.Tests/Tests.fs#L572

Main.fs

  [<EntryPoint>]
  let main argv =
    printfn "%A" argv
    let fn = ignore
    TestList (
      [
        testCase "a" fn
        testCase "a_x" fn
        testCase "b" fn
        testList "c" [
          testCase "d" fn
          testCase "e" fn
          testList "f" [
            testCase "g" fn
            testCase "h" fn
          ]
        ]
      ], Normal)
    |> runTestsWithCLIArgs [] argv

Terminal

→ dotnet run -p tests --filter c
[|"--filter"; "c"|]                     
[22:46:59 INF] EXPECTO? Running tests... <Expecto>
[22:46:59 INF] EXPECTO! 7 tests run in 00:00:00.1037682 for miscellaneous – 7 passed, 0 ignored, 0 failed, 0 errored. Success! <Expecto>

All tests are run despite the existence of the filter arg.