ppparihar / GoTestExplorer

A Go Test Explorer for VS code (https://marketplace.visualstudio.com/items?itemName=premparihar.gotestexplorer)
46 stars 8 forks source link

Run tests for testOnSave setting #16

Closed kroppt closed 1 year ago

kroppt commented 4 years ago

This fixes #8

Any improvements welcome.

It seems to me that it's running tests in addition to the Go extension's tests, but I guess that's how it's always been. But intensive tests will be twice as long, due to the duplicate tests.

Another point of pain is that all tests will be run, but I am not sure how one would go about shrinking that set.

kroppt commented 4 years ago

file.go and file_test.go are now matched up, so saving either of these files runs the tests in file_test.go. I think people expect the feature to behave this way.

kroppt commented 4 years ago

The tests should be re-discoverable now when saving, but I cannot figure out how to get the different components linked up. Currently, it's sending a command and that command is being handled elsewhere at some point, with no way to wait on the command. So, when the tests re-run, they aren't necessarily going to run the newly discovered tests, and it will also try to run tests that have been deleted.

ppparihar commented 4 years ago

@kroppt I apologies for the delay in the response. I was busy in lots of things and wasn't able to get some time to respond.

I think we can delete all the tests which belong to a changed file and rediscover all the tests which belong to that file and then we can run them.