Hey all,
No question here, I just want to share the central tool of my development workflow I have used for years now.
Three years ago, I was working on an Angular project and I was amazed by the tooling. Especially, the ng serve
command. Basically, you run ng serve
while writing your code. It auto-refreshes the web app in the browser each time you save a file. It makes development incredibly smooth!
So back on a Julia package project, I wanted a similar tool. I wanted to see immediately whether my unit tests passed as soon as I saved a file with new changes . Together with a colleague, we built a first version of this tool using Revise. I later improved the tool to refresh the tests whenever code changes occur in either the package or the tests.
I created an “EmptyPackage” repository to share the scripts and the architecture :
GitHub - nablarise/EmptyPackage.jl
To run the tool :
- run the
runtests.sh
script. - the script calls
julia runtests.jl auto
to execute therun_tests_on_change
defined intest/revise.jl
To use this tool in your package :
-
copy
runtests.sh
,test/revise.jl
-
put your tests in a module and call your tests functions from a
run()
function -
copy
test/runtests.jl
and follow the instructions provided (Steps 2, 3, 4, 5).
It’s far from perfect. It suffers from the “limitations” of Revise/Julia. You’ll need to restart the tool when changing a type for instance. I’m also pretty unsure about how I handle the exceptions However, all the errors are clearly displayed in the console and the tool makes me more productive!!!
Feedback and suggestions are welcome!