I noticed something unfortunate when running the tests. Here's what I did:
- I accidentally had another instance of Forester already running.
- I ran the tests. They failed because they could not bind port 8080 (
Fatal error: exception Unix.Unix_error(Unix.EADDRINUSE, "bind", "")). - I killed my other process, and ran the tests again. The results were cached rather than running again.
- I tried running
dune runtest --forceand it had no impact. It still uses the cached results.
Basically, caching is not suitable for cram tests because they depend on the environment. We should find a way to ensure that the cram tests always run every time.
Comments
did:plc:jjiv56ot7d6sgethto3jr3r5
It looks like dune clean will get rid of the cache. God, I hate the OCaml ecosystem so much. It's so crazy that dune runtest --force does not do what it says it does.
did:plc:jjiv56ot7d6sgethto3jr3r5
I'm closing this because we can use dune clean, but let it be known that this was my last straw and I'm never creating a new project in OCaml again 😂
did:plc:4gj3ihsdh6fn3aqq5bdnw5w3
Yeah... I run the tests in the pre-commit hook. It copies the entire index into a temp directory and kills all running instances of forester, which works around this issue.