-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Turn on Continuous Run
not working for single test
#287
Comments
Might be fixed by #253. |
This should be fixed in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher. |
I don't think this work. I still need to use the top level button for it to trigger, and it will still run all the tests depends on the file that changed. However, the startup time improvement is game changer thanks to the contributor for that 🎉 |
Cannot confirm. Works correctly in the basic example apart from the known issues: https://github.com/vitest-dev/vscode/tree/main/samples/basic |
Indeed, using the example your provided it seems to work. I trimmed down my project, to make a reproduction. https://github.com/glutinum-org/cli/tree/vitest_continous_mode_bug Make sure to use the Steps to reproduce should be:
Note I tried to not change my tests too much in case, it was due to how they are setup/what they execute. CleanShot.2024-03-15.at.23.51.50.mp4 |
Well, actually, it's not a bug. You need to wait for await expect(result).toMatchFileSnapshot(expectedFile) // the error is shown correctly here |
Thank you for pointing out that I think I found out what the problem is. It looks like the problem comes from using both Vitest and Ionide (F# support) at the same time. Ionide set If I change the default profile to Vitest, then the I am not familiar with the VSCode test API so I am not sure if the problem needs to be solved here or inside of Ionide. I opened an issue on Ionide repo too. ionide/ionide-vscode-fsharp#1995 |
Interesting. I would expect the button to use our profile when clicked 🤔 |
Does it work if you pick all of them as the default? |
It does use the selected profile, if I select CleanShot.2024-03-16.at.16.49.38.mp4It does not work if
If I select all of them as Default then it works indeed. I think I discovered something else which does not work. If I activate CleanShot.2024-03-16.at.16.53.31.mp4If you prefer, I can open a new issue to report this problem but as it seems on the same subject I thought it was fine to mention it here too. |
Quoting one of Ionide maintainer, it seems like VSCode allows to attach a tag to test runners.
ionide/ionide-vscode-fsharp#1995 (comment) But what I don't understand is why if I have only CleanShot.2024-03-16.at.17.30.19.mp4 |
I implemented tag support in 0.5.6. Please have a look when it hits the marketplace (should be around 5 minutes). |
The tag addition didn't improve the situation, I still need to have Vitest selected as one of the default profile.
Looking into how VSCode API works and trying to debug a local instance of Ionide, it seems like Ionide is never notified when a test request comes from Vitest. Would it be possible to be a bug in VSCode itself which doesn't dispatch the test request correctly when clicking the |
I can reproduce the bug. This is an issue with the Vitest extension. |
So, this happens because we set Line 36 in dad5884
This breaks Vitest watch mode - tests are only collected, they are not running. This is good when continuous mode is not enabled because we need to still collects tests on file change (in case the test is removed/renamed/moved), but when continues mode is enabled, we need to actually run tests in selected files, but still only collect tests in other files. Ideally, we need a way to manipulate Vitest watch mode to not run certain tests - we can provide this API on Vitest side in the next version. (There is already Another issue is here: Line 136 in dad5884
Even if we run tests, they are not reported in the UI because we use incorrect testRequest when starting a new testRun. I don't know the good solution for this problem yet. |
I updated the implementation in 0.5.8. The "Turn on Continues Mode" doesn't run tests anymore, it just marks it to be reported. Any subsequent change will trigger a rerun. Please try it out. |
Describe the bug
I am trying to activate Continuous Run for a single test, so I can focus on this one and have a faster feedback loop.
However, click on the
Turn on Continuous Run
icon for a single test does nothing:Reproduction
Create a test suite
Click on the icon mentioned above and see that nothing happens.
If you click on the top level icon, then all the tests are running in Continous Run
CleanShot.2024-03-14.at.22.32.39.mp4
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: