Closed mpizenberg closed 3 years ago
I'm struggling with how to make the elm compiler not hang. Normally, if the elm.json
did not change since last time we compile, the compiler should assume that dependencies are good and immediately compile stuff. But if elm.json
is updated, the elm compiler checks the dependencies, and for that it does some weird network interaction, resulting in 5s of hanging when there is no network.
So I put much care in trying to keep files timestamps, by using tar
to create and extract an archive containing .elm
, elm.json
and elm-stuff
. Yet, when running bin/run-in-docker.sh
, we spend more than 5s in the elm compiler where this should take less then 1s. This (tar) is obviously not enough to prevent the network hang of the elm compiler, and I'd like to figure out how to fix it.
I've added tinyproxy to set a small proxy configured to fail all http requests. This effectively makes the elm compiler immediately switch to its offline mode and prevents the 5s hang :)
I've also added a line to "un-skip" all the skipped tests in the tests/Tests.elm
file.
Alright I think this is ready for review. Here is a recap of the changes:
~/.elm/
is now generated by the build step of the container, based on the elm.json
template file of the exercism/elm repository so it is the same as the one used to run tests in that repo. Previously we had manually pre-package a ~/.elm/
dir and we used to download it during the container build.jq
now to generate the results.json
in case the tests runner errors. This is much cleaner than the previous shell script.--report exercism
option so we don't need the post-processing python script anymore. This removes both the file and the need to have python installed in the container.package.json
which is not needed anymore.PS: the windows script run-in-docker.ps1
needs a small update to match the few changes in run-in-docker.sh
.
Excited to be able to test this update of the tests runner once #10 (which is also ready for merge) is merged :)
Improvements of the tests runner for elm.
templates/elm.json
file of the elm track--report exercism
option in the making)