Open halfdan opened 1 year ago
In simpler words: Only update the state of tests that were actively re-run.
I had in mind to solve this on the adapter side. The skips happen because when you run the nearest test, you are adding a filter to ExUnit and so ExUnit reports the other tests as skipped.
We can solve it by not reporting skipped tests if the type of position is "test".
@jfpedroza I might take a stab at it tomorrow on the adapter then. Would still be nice if neotest would be able to filter it out.
Yes I do agree that neotest should not accept results that were not in the original tree :+1:
I see you changed it to a bug. Would it be possible to set it as an option?
I got the Elixir adapter to work with the test watcher I mentioned, and since it allows me to change the files to run interactively, fixing this would make it not set the results for tests not initially run.
I might be misunderstanding, but shouldn't the test watcher only watch the tests that are chosen by the user? So if they select a specific file, then just that file is run?
Yes, but there is an interactive feature (apparently based on Jest's) that lets you change what is run, without restating the program.
You can run a file initially and then write p foo
or a
(and a few others) in stdin to run all tests that match foo
or all tests, respectively.
Does this just work right now then? Or is more required for this kind of functionality to be properly supported?
Yes, it works. I can run a file, then change to run all tests and open a file I hadn't run before and see the status.
I'm not sure if we'll want to support this even if it does work right now because it would have some implications for https://github.com/nvim-neotest/neotest/issues/169. I'll have to see how viable it is when implementing
I see. Even without the interactive feature, it is quite useful, so it's not a big deal if test status doesn't work for positions not initially run.
I frequently iterate through tests one by one - especially if I have multiple failing tests I will not rerun the entire file/suite but invoke neotest to run the nearest test.
In it's current implementation (with the Elixir plugin) all tests except one in a single file will be shown as skipped. I would like to keep the last known passing/failing state until I rerun the entire file.