jakemcc / test-refresh

Refreshes and reruns clojure.tests in your project.
393 stars 28 forks source link

Deleting a test file makes me restart everything - solution idea! #90

Open gleenn opened 2 months ago

gleenn commented 2 months ago

Use the template below when reporting bugs. Please make sure the problem is still a problem with the latest version of lein-test-refresh before submitting.

What version of lein-test-refresh? 0.25.0

What version of Leiningen or Clojure (for deps.edn projects)? 2.9.8

Can you recreate the issue with a minimal project? Yes, super easy, just start a test runner with any test file, and then delete the file. Now it throws an irrecoverable exception where you must restart the test runner.

Simple solution suggestion hopefully: Make it so hitting "enter" in this state will force a reload of the watched/loaded files so I don't have to restart my very slow suite runner :)

jakemcc commented 2 months ago

Yeah, this is a definite pain point that I've never felt came up often enough to warrant figuring out a solution besides quit + restart. test-refresh itself leans heavily on tools.namespace for doing the reloading.

I'll try to spend some time digging into this. Maybe there is some way to fully unload and try again.

jakemcc commented 2 months ago

I thought this would be easy to reproduce but I've failed to recreate a problem with deleting files while lein-test-refresh is running that weren't actual problems (such as a require referencing the just deleted namespace).

I recall there is some problem with deleting files but am actually stumped on recreating this problem. If you can create a sample project with steps to reproduce, I'm willing to take a shot at looking into fixing it (though, I think this is a problem I've punted on fixing before due to the relative rarity of someone deleting files and the solution being "just restart the test runner", so I'm lacking some confidence that it is an easy fix.)

gleenn commented 2 months ago

When I have some time I will try and make a little example to repro. Thanks for responding back quickly and love the tool overall! It's saved me countless hours waiting for larger projects to boot up!