Regarding Jane Street libraries,
dune runtest is not expected to work. Or rather, it might work but it is not checked and not guaranteed to work. The reason for this is that most projects under https://github.com/janestreet are developed inside Jane Street and are then simply exported to github. Inside Jane Street, we use different tools and different building and testing environments, so things don’t work out of the box when they are exported to github. The system requires constant testing and on-going maintenance.
When exporting the code, we make sure that release builds work well. We never did this work for running tests. The main reason for this is that making our code to build outside our walls is already quite a bit of work and I expect that doing the same work for the test suites would not be sustainable at this point. However, the future looks a bit brighter; we are currently in the process of switching our build system to dune inside Jane Street, which means that eventually things will be more similar between inside and outside Jane Street, and at this point it might become more realistic to ensure that the test suites of the various Jane Street projects can be executed outside of Jane Street.
Regarding the build failure you are observing, it is because the versioning of our packages is very inter-locked. This is because all the code that we export to github is developed inside a single mono-repository inside our walls, so we have a single head and no need for complex versioning. So if you want to build the master of one of the packages under https://github.com/janestreet, you need the development version of all its dependencies that come from Jane Street. You can do that easily by following the instruction on this page: https://github.com/janestreet/opam-repository
Finally, we have this page in the dune manual that explains how to write and run tests. I expect that it should be enough to get started, but if not please don’t hesitate to give us back feedback at https://github.com/ocaml/dune/issues