A REPL mode for ReTest.jl

I’ve wanted a REPL mode for running tests for a while now to get a more pytest-like experience with Julia, so over the weekend I added one to ReTest.jl: ReTest.jl · ReTest.jl

Example usage from the docs where Julia is started in a package environment:

julia> using ReTest     # assumes ReTest.jl is installed in your base environment

retest> load            # activates Foo's test environment and loads `FooTests`

retest> dr              # display all testsets (dry-run)

retest> r stats=true    # run all tests with stats

retest> rf              # run last failing tests (run-failed)

For me it’s a really nice improvement to the testing workflow. But I’m sure there are plenty of edge-cases with various testing configurations, so caveat emptor and all that :sweat_smile:

Another cool thing is that ReTest now supports Preferences.jl for certain things: ReTest.jl · ReTest.jl

You can set settings from the REPL mode like this:

retest> set verbosity 2
retest> set stats true

And they’ll be persisted in a LocalPreferences.toml file for next time. Note that right now all of the available preferences opt out of invalidating the compilation cache so changing them takes effect immediately and will not trigger recompilation in the next session. I quite like how this is working out, we could add other formatting options in the future if folks are interested.

1 Like