ionide/ionide-vscode-fsharp

Test runner conflicts with other test runners when running a single test in Continous Run

Closed this issue · 5 comments

Describe the bug

In my project, I am using both F# via Fable and Vitest as my test runner because I need to run the tests on JavaScript.

It looks like because Ionide set its Run F# tests as a default profile this conflict with Vitest Continuous Run for a single test.

You can find the discussion history on there repo vitest-dev/vscode#287

I am unsure if the problem is with Ionide or Vitest extension.

Steps to reproduce

  1. Clone glutinum-org/cli@vitest_continous_mode_bug

    Make sure to select the correct branch, otherwise you will need to generate the tests files etc.

  2. pnpm install

  3. Open VSCode (with both Ionide and Vitest)

  4. Try to run the tests using Vitest UI + Continuous mode

Expected behaviour

Expected behaviour depends, on where the source of the issue is 😅.

I believe right now, the test request is passed to Ionide. If this is the case, then Ionide should notify the user that something is wrong is the test is not an F# test or forward the tests to the next test runner is possible.

I think the first approach is good enough and will help the user think about choosing a Test profile.

Machine info

  • OS: Mac
  • .NET SDK version: 8.0.100
  • Ionide version: 7.18.2

Additional context

Add any other context about the problem here.

we do set the Run F# tests profile as the default - this happens at

testController.createRunProfile ("Run F# Tests", TestRunProfileKind.Run, runHandler, true)
|> unbox
|> context.subscriptions.Add

We could change that - what behavior happens when you try to run tests with no default profile selected?

We could change that - what behavior happens when you try to run tests with no default profile selected?

Great question as I cannot have a no default profile selected once one is selected. Let me build a local version of Ionide to test it out.

It looks like we can use 'tags' to target test run profiles - perhaps vite should consider tagging their discovered tests, and we should consider tagging our discovered tests as well. A brief description of how this works is here: https://code.visualstudio.com/api/extension-guides/testing#test-tags

I can't seems to find a way to not have a Default profile selected.

I tried to create a new folder on my machine in case this was due to as cache but no nothing seems to allow me to not have a default profile selected.

However, if both F# and Vitest are selected as default then it works: vitest-dev/vscode#287 (comment)

The test 'tags', seems interesting indeed.

I am closing because it seems like the problem is how Vitest is implemented.

I will re-open if needed.

Thank you for looking into it Chet